diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..888e85bd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +* +!background-jobs +!service +service/* +!service/scripts + +# Data-only folders that do not belong in the job image. +service/scripts/multipliers + +**/__pycache__ +**/*.pyc +**/.venv +**/.env +**/.env.* +**/out diff --git a/background-jobs/.dockerignore b/background-jobs/.dockerignore new file mode 100644 index 00000000..9b43b1ce --- /dev/null +++ b/background-jobs/.dockerignore @@ -0,0 +1,5 @@ +.env +.env.* +__pycache__/ +*.pyc +.venv/ diff --git a/background-jobs/.env.example b/background-jobs/.env.example new file mode 100644 index 00000000..51667cb8 --- /dev/null +++ b/background-jobs/.env.example @@ -0,0 +1,7 @@ +# Copy this file to `.env` and fill in the real values. +# `.env` is gitignored and is NOT baked into the image. +INSE_ELASTIC_URL=https://inse.nes.uni-due.de/elastic +INSE_ELASTIC_API_KEY=your-elastic-api-key-here +INSE_LLM_BASE_URL=https://project.nes.uni-due.de/llm2/v1/ +INSE_LLM_API_KEY=your-llm-api-key-here +INSE_LLM_MODEL=gemma4-e4b diff --git a/background-jobs/.gitignore b/background-jobs/.gitignore new file mode 100644 index 00000000..ccbef30f --- /dev/null +++ b/background-jobs/.gitignore @@ -0,0 +1,5 @@ +# Local secrets – never commit +.env + +__pycache__/ +*.pyc diff --git a/background-jobs/README.md b/background-jobs/README.md new file mode 100644 index 00000000..000e414c --- /dev/null +++ b/background-jobs/README.md @@ -0,0 +1,95 @@ +# Background Jobs + +Background Jobs sind Docker-Container, die regelmäßig oder manuell Elasticsearch-Daten verarbeiten. Sie werden vom Backend über den Docker-Socket gestartet. + +**Wichtig:** Jobs sind in der **Datenbank**, nicht im Image. Das Image enthält nur die ausführbaren Skripte. + +## Jobs anlegen + +**Frontend** (`/jobs`): + +- "Neuer Job" → Name + Command + optionales Image + Zeitplan + +**API**: + +```bash +curl -X POST -H "Authorization: Bearer $TOKEN" \ + -d '{"name": "Sync", "command": "python sync.py --sync-delta", "schedule": "0 3 * * *"}' \ + http://localhost:8000/api/background-jobs/tasks +``` + +Command-Beispiele: + +``` +python service/scripts/demo/demo.py 20 +python sync.py --sync-delta +python service/scripts/news/ude/run_pipeline.py --skip-upload --max-items 5 +python -m service.scripts.news.topic_mapper.map_news_topics --output-index docker-job_test --max-docs 50 +python -m service.scripts.projects.topic_mapper.map_project_topics --dry-run +sh -c "cd service/scripts/projects/bund && python gpc.data.py --skip-upload" +``` + +**Neue Jobs = kein Image-Rebuild.** Die Skripte sind bereits im Image; der Command wird direkt an Docker übergeben. + +## Image & Dockerfile + +Das [Dockerfile](../service/scripts/jobs-image/Dockerfile) kopiert den kompletten `service/scripts/`-Baum (Pfade im Container = Pfade im Repo) plus `background-jobs/app/` (sync.py) und hat keinen ENTRYPOINT. Neue Skripte unter `service/scripts` landen automatisch im nächsten Build — ohne Dockerfile-Änderung. Der Backend startet Container direkt: + +```python +docker.run(image="...", command="python sync.py --sync-delta") +``` + +**Skripte hinzugefügt oder geändert?** → Image neu bauen + pushen: + +```bash +docker build -f service/scripts/jobs-image/Dockerfile -t docker.nes.uni-due.de/inse/background-jobs:latest . +docker push docker.nes.uni-due.de/inse/background-jobs:latest +``` + +Lokal testen ohne Pull: + +```bash +export BACKGROUND_JOBS_PULL_BEFORE_RUN=false +``` + +## Scheduling + +Job mit `schedule: "0 3 * * *"` und `enabled: true` läuft automatisch täglich um 3:00 UTC. Manuell starten: "Jetzt ausführen" Button oder API. + +## Logs + +Während Laufzeit: Live vom Container. Nach Beendigung: Letzte 200 Zeilen in der DB. Frontend: "Logs anzeigen" Button. + +## Docker-Socket (Deployment) + +```yaml +# docker-compose +backend: + volumes: + - /var/run/docker.sock:/var/run/docker.sock +``` + +Ohne Socket-Mount funktioniert nichts. + +## Env-Variablen + +Standard-Image erhält automatisch: + +- `INSE_ELASTIC_URL`, `INSE_ELASTIC_API_KEY` +- `INSE_LLM_*`, `ELASTICSEARCH_INSE_*`, `SENTENCE_TRANSFORMERS_MODEL_NAME` + +Plus `env` aus der Job-Definition. + +**Eigene Images** bekommen nur die `env`-Variablen (Sicherheit). + +## API + +- `GET /api/background-jobs/tasks` — Jobs auflisten +- `POST /api/background-jobs/tasks` — Job anlegen +- `DELETE /api/background-jobs/tasks/{id}` — Job löschen +- `POST /api/background-jobs/tasks/{id}/run` — Run starten +- `PATCH /api/background-jobs/tasks/{id}` — Schedule ändern +- `GET /api/background-jobs/runs/{id}/logs` — Logs abrufen +- `POST /api/background-jobs/runs/{id}/stop` — Run stoppen + +Alle Endpoints erfordern Superadmin-Auth. diff --git a/background-jobs/app/elastic/client.py b/background-jobs/app/elastic/client.py new file mode 100644 index 00000000..1ef0c6dc --- /dev/null +++ b/background-jobs/app/elastic/client.py @@ -0,0 +1,151 @@ +import os +import requests +from requests.adapters import HTTPAdapter +from urllib.parse import quote +from dotenv import load_dotenv + +load_dotenv() + +INSE_URL = os.getenv("INSE_ELASTIC_URL", "https://inse.nes.uni-due.de/elastic") +INSE_API_KEY = os.getenv("INSE_ELASTIC_API_KEY") +if not INSE_API_KEY: + raise RuntimeError( + "INSE_ELASTIC_API_KEY is not set. Copy .env.example to .env and fill it in, " + "or pass it as an environment variable." + ) + +ES_HEADERS = { + "Authorization": f"ApiKey {INSE_API_KEY}", + "Content-Type": "application/json", +} + +_session = requests.Session() +_session.headers.update(ES_HEADERS) +_adapter = HTTPAdapter(pool_connections=32, pool_maxsize=32) +_session.mount("https://", _adapter) +_session.mount("http://", _adapter) + +def _send_es_request(method: str, url: str, payload: dict = None) -> dict: + + try: + response = _session.request( + method=method, + url=url, + json=payload, + ) + response.raise_for_status() + return response.json() + except requests.RequestException as error: + print(f"Send Request failed: ({method} {url}): {error}") + raise + +def add_entry(index: str, entry: dict): + + endpoint = f"{INSE_URL}/{index}/_doc" + + document_body = { + "news_id": entry["news_id"], + "relevant": int(entry["relevant"]), + "authors": entry["authors"], + "keywords": entry.get("keywords", []), + } + + response_data = _send_es_request("POST", endpoint, payload=document_body) + + created_id = response_data["_id"] + entry["_id"] = created_id + + return created_id + +def index_entry(index: str, document_id: str, entry: dict): + + encoded_document_id = quote(document_id, safe="") + endpoint = f"{INSE_URL}/{index}/_doc/{encoded_document_id}" + + document_body = { + "news_id": entry["news_id"], + "relevant": int(entry["relevant"]), + "authors": entry["authors"], + "keywords": entry.get("keywords", []), + } + + return _send_es_request("PUT", endpoint, payload=document_body) + +def update_entry(index: str, document_id: str, partial_doc: dict): + + encoded_document_id = quote(document_id, safe="") + endpoint = f"{INSE_URL}/{index}/_update/{encoded_document_id}" + + return _send_es_request("POST", endpoint, payload={"doc": partial_doc}) + +def get_entry(index: str, document_id: str) -> dict: + + encoded_document_id = quote(document_id, safe="") + endpoint = f"{INSE_URL}/{index}/_doc/{encoded_document_id}" + + return _send_es_request("GET", endpoint) + +def delete_entry(index: str, document_id: str): + + encoded_document_id = quote(document_id, safe="") + endpoint = f"{INSE_URL}/{index}/_doc/{encoded_document_id}" + + return _send_es_request("DELETE", endpoint) + +def get_all_entries(index: str, fields: list = None) -> list: + + if not fields: + source_fields = True + else: + source_fields = fields + + endpoint = f"{INSE_URL}/{index}/_search" + + page_size = 1000 + results = [] + last_sort_value = None + + while True: + payload = { + "query": {"match_all": {}}, + "size": page_size, + "sort": [{"_doc": "asc"}], + "_source": source_fields, + } + if last_sort_value is not None: + payload["search_after"] = last_sort_value + + response_data = _send_es_request("POST", endpoint, payload=payload) + results_list = response_data["hits"]["hits"] + + if not results_list: + break + + results.extend(results_list) + last_sort_value = results_list[-1]["sort"] + + return results + +def delete_all_entries(index: str): + + endpoint = f"{INSE_URL}/{index}/_delete_by_query" + + payload = { + "query": {"match_all": {}} + } + + return _send_es_request("POST", endpoint, payload=payload) + +def remove_field_all(index: str, field: str): + + endpoint = f"{INSE_URL}/{index}/_update_by_query" + + payload = { + "query": {"exists": {"field": field}}, + "script": { + "source": f"ctx._source.remove('{field}')", + "lang": "painless", + }, + } + + return _send_es_request("POST", endpoint, payload=payload) diff --git a/background-jobs/app/llm/client.py b/background-jobs/app/llm/client.py new file mode 100644 index 00000000..e798d14c --- /dev/null +++ b/background-jobs/app/llm/client.py @@ -0,0 +1,95 @@ +import os +import requests +from openai import OpenAI, APIConnectionError +from dotenv import load_dotenv + +load_dotenv() + +LLM_BASE_URL = os.getenv("INSE_LLM_BASE_URL", "https://project.nes.uni-due.de/llm2/v1/") +LLM_API_KEY = os.getenv("INSE_LLM_API_KEY") +if not LLM_API_KEY: + raise RuntimeError( + "INSE_LLM_API_KEY is not set. Copy .env.example to .env and fill it in, " + "or pass it as an environment variable." + ) +LLM_MODEL = os.getenv("INSE_LLM_MODEL", "gemma4-e4b") + +SYSTEM_PROMPT_RELEVANT = (""" + Du bewertest Nachrichtenartikel aus dem Campus-Aktuell-Bereich der Universität Duisburg-Essen. + Entscheide, ob der Artikel inhaltlich über eine konkrete Person berichtet, also über deren Werdegang, Forschung, Leistung, Auszeichnung oder Tätigkeit. + Falls du dir unsicher bist, ob eine Person im Mittelpunkt steht, dann entscheide dich bitte für die positivere Option (also 1), damit die Namensextraktion auf keinen Fall bei Artikeln mit Personenbezug versäumt wird. + Antworte mit 1, wenn eine konkrete Person im Mittelpunkt steht. + Antworte mit 0, wenn es sich um allgemeine Mitteilungen handelt, die keine einzelne Person in den Mittelpunkt stellen, zum Beispiel Veranstaltungs- und Terminhinweise, Spendenaufrufe, organisatorische Ankündigungen, allgemeine Universitätsinformationen oder Pressemitteilungen ohne Personenbezug. + Die bloße Nennung von Namen (etwa als Autor oder Ansprechpartner) reicht für eine 1 nicht aus; die Person muss inhaltlich Thema des Artikels sein. + Antworte ausschließlich mit einer einzigen Ziffer: 0 oder 1. +""") + +SYSTEM_PROMPT_NAMES = (""" + Aus dem nachfolgenden Campus-Aktuell-Artikel der Universität Duisburg-Essen: Nenne die Namen aller konkreten Personen, um die es im Artikel inhaltlich geht. + Es können mehrere Personen sein. Bitte achte darauf dass du nur die Namen der Personen nennst, die tatsächlich im Mittelpunkt des Artikels stehen. + Insbesondere am Ende von Artikeln werden oft Personen genannt, die nur als Ansprechpartner oder Organisator und sollen deshalb nicht genannt werden. + Antworte ausschließlich mit gültigem JSON in exakt diesem Format: {\"person\": [\"Vorname Nachname\", \"Vorname Nachname\"]} + Gib keine Erklärungen und kein Markdown aus, nur das JSON. +""") + +SYSTEM_PROMPT_KEYWORDS = (""" + Extrahiere aus dem nachfolgenden Campus-Aktuell-Artikel der Universität Duisburg-Essen die wichtigsten Schlagwörter (Keywords). + Wähle ausschließlich Begriffe oder Phrasen, die tatsächlich im Text vorkommen. Erfinde keine Begriffe, verallgemeinere nicht und nenne keine Oberbegriffe, die nicht im Text stehen. + Übersetze keine Begriffe – verwende ausschließlich Wörter und Phrasen in der Sprache des Artikels. + Gib jedes Schlagwort in seiner Grundform an: Bei deutschen Begriffen Substantive im Nominativ Singular; bei englischen Begriffen Substantive im Singular. Verwende den Plural nur, wenn der Begriff üblicherweise im Plural gebraucht wird. + Vermeide Redundanz: Wenn zwei mögliche Schlagwörter dieselbe Wortbasis teilen (z.B. „Forschung" und „Forschungsprojekt"), nenne nur den spezifischeren Begriff. + Nenne maximal sechs prägnante Begriffe oder kurze Phrasen. Konzentriere dich auf inhaltlich zentrale Begriffe, nicht auf Personennamen oder Datumsangaben. + Antworte ausschließlich mit gültigem JSON in exakt diesem Format: {\"keywords\": [\"Schlagwort\", \"Schlagwort\"]} + Gib keine Erklärungen und kein Markdown aus, nur das JSON. +""") + +_client = OpenAI( + base_url=LLM_BASE_URL, + api_key=LLM_API_KEY, + timeout=30, +) + +def call(system_prompt, user_prompt, model=LLM_MODEL, temperature=1.0, top_p=0.95): + try: + response = _client.chat.completions.create( + model=model, + messages=[ + {"role": "system", "content": system_prompt}, + {"role": "user", "content": user_prompt}, + ], + temperature=temperature, + top_p=top_p, + extra_body={"top_k": 64}, + ) + except APIConnectionError: + return None + + return response.choices[0].message.content or None + +def is_news_relevant(text: str) -> bool: + result = call(SYSTEM_PROMPT_RELEVANT, text) + if result is None: + return False + return result.strip() == "1" + +def extract_names(text: str) -> list[str]: + result = call(SYSTEM_PROMPT_NAMES, text) + if result is None: + return [] + try: + import json + data = json.loads(result) + return data.get("person", []) + except json.JSONDecodeError: + return [] + +def extract_keywords(text: str) -> list[str]: + result = call(SYSTEM_PROMPT_KEYWORDS, text) + if result is None: + return [] + try: + import json + data = json.loads(result) + return data.get("keywords", []) + except json.JSONDecodeError: + return [] diff --git a/background-jobs/app/sync.py b/background-jobs/app/sync.py new file mode 100644 index 00000000..7c1fed29 --- /dev/null +++ b/background-jobs/app/sync.py @@ -0,0 +1,246 @@ +import elastic.client as es_client +import llm.client as llm_client +import json +import argparse +import time +import logging +import threading +from concurrent.futures import ThreadPoolExecutor, as_completed + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) + +POSTPROC_INDEX = "aktuell_postproc" + +def print_pretty_json(data): + logger.info(json.dumps(data, indent=2)) + +def sync_single_news(news_id, max_retries=3): + attempt = 0 + while attempt < max_retries: + try: + news_text = es_client.get_entry("aktuell", news_id)["_source"]["full_content"] + is_news_relevant = llm_client.is_news_relevant(news_text) + authors = llm_client.extract_names(news_text) + keywords = llm_client.extract_keywords(news_text) + new_entry = { + "news_id": news_id, + "relevant": is_news_relevant, + "authors": authors, + "keywords": keywords, + } + es_client.add_entry("aktuell_postproc", new_entry) + return True + except Exception as error: + attempt += 1 + logger.warning(f"Warning syncing news_id {news_id} (Attempt {attempt}/{max_retries})") + if attempt < max_retries: + time.sleep(1) + else: + logger.error(f"Error: {news_id} - {error}") + return False + +def update_keywords_single(postproc_entry, target_index=POSTPROC_INDEX, max_retries=3): + doc_id = postproc_entry["_id"] + source = postproc_entry["_source"] + news_id = source["news_id"] + attempt = 0 + while attempt < max_retries: + try: + news_text = es_client.get_entry("aktuell", news_id)["_source"]["full_content"] + keywords = llm_client.extract_keywords(news_text) + if not keywords: + # Empty article or unparseable LLM answer: writing an empty list + # would look like a success and block a later retry. + logger.info(f"Skipped {news_id}: no keywords extracted.") + return False + if target_index == POSTPROC_INDEX: + es_client.update_entry(POSTPROC_INDEX, doc_id, {"keywords": keywords}) + else: + # Key the target doc on news_id so re-runs update it in place + # instead of piling up a new document each time. + es_client.index_entry( + target_index, + news_id, + { + "news_id": news_id, + "relevant": source.get("relevant", 0), + "authors": source.get("authors", []), + "keywords": keywords, + }, + ) + return True + except Exception as error: + attempt += 1 + logger.warning(f"Warning updating keywords for news_id {news_id} (Attempt {attempt}/{max_retries})") + if attempt < max_retries: + time.sleep(1) + else: + logger.error(f"Error: {news_id} - {error}") + return False + +def main(): + parser = argparse.ArgumentParser(description="Synchronize news articles from 'aktuell' index to 'aktuell_postproc' index with relevance and author extraction using LLM.") + + parser.add_argument( + "--delete-all", + action="store_true", + help="Delete all entries from index 'aktuell_postproc'.", + ) + + parser.add_argument( + "--sync-delta", + action="store_true", + help="Sync only missing entries from 'aktuell' to 'aktuell_postproc'.", + ) + + parser.add_argument( + "--update-keywords", + action="store_true", + help="Add 'keywords' to existing 'aktuell_postproc' entries that don't have them yet (keeps relevant/authors).", + ) + + parser.add_argument( + "--reset-keywords", + action="store_true", + help="Remove the 'keywords' field from all 'aktuell_postproc' entries (keeps relevant/authors). Run before re-extracting with a new prompt.", + ) + + parser.add_argument( + "--stats", + action="store_true", + help="Print statistics about the entries in 'aktuell_postproc' and 'aktuell'.", + ) + + parser.add_argument( + "--threads", + type=int, + default=4, + help="Number of threads for --sync-delta (Default: 4).", + ) + + parser.add_argument( + "--limit", + type=int, + default=None, + help="Process at most this many entries (used by --update-keywords, e.g. for a smoke test).", + ) + + parser.add_argument( + "--target-index", + default=POSTPROC_INDEX, + help=( + f"Index that --update-keywords writes to (default: {POSTPROC_INDEX}). Any other " + "index gets new documents instead of in-place updates, and every entry is " + "re-extracted rather than only those missing keywords." + ), + ) + + args = parser.parse_args() + + if args.delete_all: + es_client.delete_all_entries("aktuell_postproc") + + if args.reset_keywords: + result = es_client.remove_field_all("aktuell_postproc", "keywords") + logger.info(f"Removed 'keywords' from {result.get('updated', 0)} entries.") + + if args.sync_delta: + start_time = time.time() + aktuell_ids_raw = es_client.get_all_entries("aktuell", fields=["_id"]) + postproc_ids_raw = es_client.get_all_entries("aktuell_postproc", fields=["news_id"]) + + source_ids = set(entry["_id"] for entry in aktuell_ids_raw) + target_ids = set(entry["_source"]["news_id"] for entry in postproc_ids_raw) + missing_ids = source_ids - target_ids + + logger.info(f"Number of missing IDs: {len(missing_ids)}") + + missing_ids = list(missing_ids) + total = len(missing_ids) + + processed = 0 + succeeded = 0 + progress_lock = threading.Lock() + + with ThreadPoolExecutor(max_workers=args.threads) as executor: + futures = [executor.submit(sync_single_news, news_id) for news_id in missing_ids] + for future in as_completed(futures): + was_successful = future.result() + with progress_lock: + processed += 1 + if was_successful: + succeeded += 1 + logger.info(f"Sync: {processed} / {total}") + + end_time = time.time() + logger.info(f"Sync DONE: {succeeded} entries synced.") + logger.info(f"Time taken: {end_time - start_time} seconds.") + + if args.update_keywords: + start_time = time.time() + postproc_entries = es_client.get_all_entries( + POSTPROC_INDEX, fields=["news_id", "keywords", "relevant", "authors"] + ) + + if args.target_index == POSTPROC_INDEX: + pending = [entry for entry in postproc_entries if not entry["_source"].get("keywords")] + logger.info(f"Number of entries without keywords: {len(pending)}") + else: + # Writing elsewhere never marks the postproc entries, so the "missing + # keywords" filter would select the same entries on every run. Pick + # entries that already have keywords instead: those are known to come + # from articles with actual content, unlike the empty archive stubs. + pending = [entry for entry in postproc_entries if entry["_source"].get("keywords")] + logger.info(f"Re-extracting keywords into '{args.target_index}': {len(pending)} candidates.") + + if args.limit is not None: + pending = pending[:args.limit] + + total = len(pending) + logger.info(f"Processing {total} entries.") + + processed = 0 + succeeded = 0 + progress_lock = threading.Lock() + + with ThreadPoolExecutor(max_workers=args.threads) as executor: + futures = [ + executor.submit(update_keywords_single, entry, args.target_index) + for entry in pending + ] + for future in as_completed(futures): + was_successful = future.result() + with progress_lock: + processed += 1 + if was_successful: + succeeded += 1 + logger.info(f"Update keywords: {processed} / {total}") + + end_time = time.time() + logger.info(f"Update keywords DONE: {succeeded} entries updated.") + logger.info(f"Time taken: {end_time - start_time} seconds.") + + if args.stats: + aktuell_entries = es_client.get_all_entries("aktuell", fields=["_id"]) + logger.info(f"Total entries in 'aktuell': {len(aktuell_entries)}") + + postproc_entries = es_client.get_all_entries("aktuell_postproc", fields=["_id", "news_id", "relevant", "authors", "keywords"]) + total_entries = len(postproc_entries) + relevant_count = sum(1 for entry in postproc_entries if entry["_source"]["relevant"] == 1) + irrelevant_count = total_entries - relevant_count + news_with_extracted_names = sum(1 for entry in postproc_entries if entry["_source"]["authors"]) + news_without_extracted_names = total_entries - news_with_extracted_names + news_with_keywords = sum(1 for entry in postproc_entries if entry["_source"].get("keywords")) + news_without_keywords = total_entries - news_with_keywords + + logger.info(f"Total entries in 'aktuell_postproc': {total_entries}") + logger.info(f"Relevant entries: {relevant_count}") + logger.info(f"Irrelevant entries: {irrelevant_count}") + logger.info(f"Entries with extracted names: {news_with_extracted_names}") + logger.info(f"Entries without extracted names: {news_without_extracted_names}") + logger.info(f"Entries with keywords: {news_with_keywords}") + logger.info(f"Entries without keywords: {news_without_keywords}") + +if __name__ == "__main__": + main() diff --git a/llm_evaluations/eu_to_epo_uspto_patents_matching/eu_patents_to_EPO_USPTO.md b/llm_evaluations/eu_to_epo_uspto_patents_matching/eu_patents_to_EPO_USPTO.md index 89d12381..4a4595f7 100644 --- a/llm_evaluations/eu_to_epo_uspto_patents_matching/eu_patents_to_EPO_USPTO.md +++ b/llm_evaluations/eu_to_epo_uspto_patents_matching/eu_patents_to_EPO_USPTO.md @@ -15,10 +15,11 @@ The objective is to measure match coverage and determine which ID-matching strat Source: `cordis_eu_fp7_project_iprs` Patents tested: 5196(total) - 2270(others) -> 2926 (EP and US patents) -| Prefix | Count | + +| Prefix | Count | | --------- | --------: | -| EP | 1,952 | -| US | 974 | +| EP | 1,952 | +| US | 974 | | **Total** | **2,926** | ## Matching Strategies diff --git a/service/Dockerfile b/service/Dockerfile index 6ecf783c..d3ce6d2d 100644 --- a/service/Dockerfile +++ b/service/Dockerfile @@ -20,7 +20,9 @@ RUN pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-c "sqlmodel~=0.0.33" \ "argon2-cffi~=25.1.0" \ "pandas~=2.3.3" \ - "pypdf==6.14.2" + "pypdf==6.14.2"\ + "docker~=7.1.0" \ + "croniter~=6.0.0" COPY [ "src/main", "/home" ] COPY [ "src/data", "/data" ] diff --git a/service/build.gradle b/service/build.gradle index 066a7af3..488753d7 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -61,7 +61,7 @@ task exportOpenApiSpec(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", '-e', 'INSE_OPENALEX_WORKS_API_KEY', '--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", '-v', '/var/run/docker.sock:/var/run/docker.sock', '-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/scripts/demo/demo.py b/service/scripts/demo/demo.py new file mode 100644 index 00000000..5e505495 --- /dev/null +++ b/service/scripts/demo/demo.py @@ -0,0 +1,20 @@ +import sys +import time +import logging + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) + + +def main() -> None: + seconds = int(sys.argv[1]) if len(sys.argv) > 1 else 20 + logger.info(f"Demo job started, running for {seconds} seconds.") + for elapsed in range(1, seconds + 1): + time.sleep(1) + if elapsed % 5 == 0: + logger.info(f"Progress: {elapsed}/{seconds} seconds.") + logger.info("Demo job finished successfully.") + + +if __name__ == "__main__": + main() diff --git a/service/scripts/jobs-image/Dockerfile b/service/scripts/jobs-image/Dockerfile new file mode 100644 index 00000000..44a70636 --- /dev/null +++ b/service/scripts/jobs-image/Dockerfile @@ -0,0 +1,21 @@ +# Background-jobs worker image. Build from the repo root: +# docker build -f service/scripts/jobs-image/Dockerfile -t docker.nes.uni-due.de/inse/background-jobs:latest . +FROM python:3.13-slim + +WORKDIR /app + +# Headless Chrome for the bund foerderportal crawler (Selenium). +RUN apt-get update \ + && apt-get install -y --no-install-recommends chromium chromium-driver \ + && rm -rf /var/lib/apt/lists/* +ENV CHROME_BIN=/usr/bin/chromium \ + CHROMEDRIVER_PATH=/usr/bin/chromedriver + +# Install dependencies +COPY service/scripts/jobs-image/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the job code. +COPY background-jobs/app/ ./ + +COPY service/scripts/ ./service/scripts/ diff --git a/service/scripts/jobs-image/README.md b/service/scripts/jobs-image/README.md new file mode 100644 index 00000000..dfe8da7e --- /dev/null +++ b/service/scripts/jobs-image/README.md @@ -0,0 +1,137 @@ +# Job Images + +## Anlegen und Bearbeiten eines Jobs (UI) + +Ein Job im Frontend ist nur eine **Definition** in der Datenbank, die auf ein +Image zeigt. Der eigentliche Job-Code steckt im Image. Reihenfolge daher immer: +**erst das Image nach Nexus pushen, dann den Job in der UI anlegen.** + +### 1. Image bauen und pushen + +Aus dem Repo-Root (Build-Kontext = Root), Beispiel News-Crawler (jedes +Dockerfile nennt in seinem Kopf den eigenen Build-Befehl): + +```bash +docker build -f service/scripts/jobs-image/news-crawl/Dockerfile \ + -t docker.nes.uni-due.de/inse/jobs/news-crawl:latest . +docker push docker.nes.uni-due.de/inse/jobs/news-crawl:latest +``` + +Login zu Nexus vorher, falls nötig: `docker login docker.nes.uni-due.de` +(Zugangsdaten wie in der Backend-`.env`, `BACKGROUND_JOBS_REGISTRY_*`). + +Erst wenn Push erfolgreich war, taucht das Image in der Image-Auswahl der UI auf. + +### 2. Job anlegen + +1. Als **Superadmin** anmelden und die Seite **Jobs** öffnen. +2. Oben rechts prüfen, dass die Karten **Docker-Daemon** und **Nexus-Registry** + grün („Erreichbar") sind. Ist Nexus rot, bleibt die Image-Auswahl leer — + dann Registry/`.env` prüfen, bevor es weitergeht. +3. Auf **Neuer Job** klicken. Im Dialog: + - **Name** – Pflichtfeld, muss eindeutig sein (sonst 409). + - **Beschreibung**, **Ziel-Index** – optional, nur zur Anzeige. + - **Image** – Pflichtfeld. In das Feld tippen und aus der + Nexus-Autovervollständigung den passenden Tag wählen, z. B. + `docker.nes.uni-due.de/inse/jobs/news-crawl:latest`. Leer = Fehler. + - **Befehl** – optional. Wird an den `ENTRYPOINT` des Images **angehängt** + (z. B. `--max-items 50`). Leer lassen, wenn die Image-Defaults reichen. + - **Umgebungsvariablen** – optional, `KEY=VALUE` pro Zeile. Bei + Nexus-Images werden die INSE-Zugangsdaten (Elasticsearch/LLM) ohnehin + automatisch ergänzt; hier nur Zusätzliches/Overrides. +4. **Speichern**. Der Job erscheint in der Tabelle, zunächst ohne Zeitplan + (= nur manuell). + +### 3. Job ausführen und beobachten + +- **▶ Jetzt ausführen** startet einen Lauf. Das Backend pullt das Image und + startet einen Container namens `-run-`. +- **⏹ Stoppen** bricht einen laufenden Lauf ab. +- **🗎 Logs** zeigt die Container-Logs (live während des Laufs, danach die in der + DB gespeicherten letzten Zeilen) sowie Dauer bzw. „läuft seit". +- Schlägt der Pull fehl (Image gelöscht/nicht gepusht), wird der Lauf + **fehlgeschlagen** mit `failed to pull image …` im Log — dann Image neu pushen. + +### 4. Job bearbeiten + +- In der **Name**-Spalte erscheint beim Hovern ein **Stift**-Symbol → öffnet den + Bearbeiten-Dialog. Dort lassen sich **Name, Beschreibung, Ziel-Index, Image, + Befehl und Env** ändern (gleiche Validierung wie beim Anlegen). +- Das **Kalender**-Symbol in der Aktionsspalte öffnet den **Zeitplan**-Dialog: + Cron-Ausdruck setzen (5 Felder) und Job aktiv/inaktiv schalten. Ein Zeitplan + macht aus einem manuellen Job einen automatisch laufenden. +- Bearbeiten ist gesperrt, solange ein Lauf des Jobs läuft. + +### 5. Job löschen + +Das **Papierkorb**-Symbol entfernt die Job-Definition. Das Image in Nexus bleibt +davon unberührt (siehe unten zum Image-Löschen). + +One Docker image per job script. Each image installs only its own dependencies +and bakes its script as the `ENTRYPOINT`. Most jobs then run with no `command` +override — the job definition just points `image` at the matching tag. Where +several jobs share one script (the demos), they point at the same image and +differ only by their `command`. + +## Images + +| Job (DB name) | Image | Entrypoint | Notes | +| ----------------------- | --------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| News-Crawler | `jobs/news-crawl` | `run_pipeline.py` | scrapy<2.13, Twisted<24.7; uploads to `NEWS_UPLOAD_INDEX` | +| Bund-Crawler | `jobs/bund-crawl` | `gpc.data.py --max-rows 200` | headless Chrome; uploads to `BUND_UPLOAD_INDEX`; capped, full export is ~300k rows | +| Project-Topic-Mapping | `jobs/project-topics` | `map_project_topics --output-index docker-job_test` | reads projects_bund_v1; needs host backend | +| News-Topic-Mapping | `jobs/news-topics` | `map_news_topics --output-index aktuell_openalex_topics` | bundles both topic_mapper pkgs; needs host backend | +| News-Keyword-Extraction | `jobs/news-keywords` | `sync.py --update-keywords --target-index docker-job_test` | ES + LLM creds; writes to test index | +| Demo-Job A / B / C | `jobs/demo` | `demo.py` (seconds via command: `20` / `25` / `30`) | no dependencies; one image, three job rows | + +Each image is its own repository under the `jobs/` path namespace, prefixed +`docker.nes.uni-due.de/inse/` (e.g. `docker.nes.uni-due.de/inse/jobs/news-crawl:latest`). +The three demo jobs share the single `jobs/demo` repository. + +The entrypoints carry no run limits: anything set in the job's `command` field is +appended to the entrypoint, so limits (`--max-items`, `--max-docs`, `--limit`) are +passed per run from the UI. The one exception is the Bund-Crawler, which keeps a +`--max-rows` cap in the image because its full export is ~300k rows. + +## Build + +From the repo root (the build context must be the repo root so the Dockerfiles +can copy `service/scripts/…` and `background-jobs/app/`): + +```bash +docker build -f service/scripts/jobs-image/news-crawl/Dockerfile \ + -t docker.nes.uni-due.de/inse/jobs/news-crawl:latest . +docker push docker.nes.uni-due.de/inse/jobs/news-crawl:latest +``` + +Each image's Dockerfile header lists its own build command. + +## Running locally without pushing + +Before each run the backend pulls the job's image from the registry when it is a +registry image (host `docker.nes.uni-due.de`). **There is no fallback to a local +copy:** if the pull fails, the run is marked _failed_ and the error is written to +the run log — a stale local image is never used silently. To run a locally built +image without pushing it, skip the pull attempt entirely: + +```bash +export BACKGROUND_JOBS_PULL_BEFORE_RUN=false +``` + +With the pull disabled the backend uses whatever image with that tag exists on +the Docker host, so `docker build -t docker.nes.uni-due.de/inse/jobs/:latest .` +is enough for local runs. + +## Env vars + +Because every tag lives under the `docker.nes.uni-due.de` registry host, the +backend treats these as registry images and injects the INSE Elasticsearch / LLM +credentials automatically (plus any per-job `env`). + +Most images write to the test index by default: the crawlers upload into the +index named by `NEWS_UPLOAD_INDEX` / `BUND_UPLOAD_INDEX` (both baked to +`docker-job_test` in their Dockerfile), and the project mapper and the keyword +extraction write to `docker-job_test` via `--output-index` / `--target-index`. +The exception is News-Topic-Mapping, which writes to `aktuell_openalex_topics`. +To not contact Elasticsearch at all, pass `--skip-upload` (crawlers) or +`--dry-run` (mappers) through the job's command field. diff --git a/service/scripts/jobs-image/bund-crawl/Dockerfile b/service/scripts/jobs-image/bund-crawl/Dockerfile new file mode 100644 index 00000000..dcbebcbb --- /dev/null +++ b/service/scripts/jobs-image/bund-crawl/Dockerfile @@ -0,0 +1,28 @@ +# Bund-Crawler (foerderportal export via headless Chrome). Build from the repo root: +# docker build -f service/scripts/jobs-image/bund-crawl/Dockerfile -t docker.nes.uni-due.de/inse/jobs/bund-crawl:latest . +FROM python:3.13-slim + +WORKDIR /app +ENV PYTHONUNBUFFERED=1 +# Upload the crawled projects into the shared test index (gpc.data.py reads +# ELASTICSEARCH_INSE_* creds + BUND_UPLOAD_INDEX from the env). +ENV BUND_UPLOAD_INDEX=docker-job_test + +# Headless Chrome for the Selenium crawler. +RUN apt-get update \ + && apt-get install -y --no-install-recommends chromium chromium-driver \ + && rm -rf /var/lib/apt/lists/* +ENV CHROME_BIN=/usr/bin/chromium \ + CHROMEDRIVER_PATH=/usr/bin/chromedriver + +COPY service/scripts/jobs-image/bund-crawl/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY service/scripts/projects/bund/ ./service/scripts/projects/bund/ + +WORKDIR /app/service/scripts/projects/bund + +# Capped on purpose: the full export is ~300k rows, so an uncapped run would +# write that entire volume into BUND_UPLOAD_INDEX. Raise or drop the cap by +# passing --max-rows N through the job's command field. +ENTRYPOINT ["python", "gpc.data.py", "--max-rows", "200"] diff --git a/service/scripts/jobs-image/bund-crawl/requirements.txt b/service/scripts/jobs-image/bund-crawl/requirements.txt new file mode 100644 index 00000000..f660d056 --- /dev/null +++ b/service/scripts/jobs-image/bund-crawl/requirements.txt @@ -0,0 +1,3 @@ +selenium~=4.20 +pandas~=2.2 +requests~=2.32 diff --git a/service/scripts/jobs-image/news-crawl/Dockerfile b/service/scripts/jobs-image/news-crawl/Dockerfile new file mode 100644 index 00000000..86101794 --- /dev/null +++ b/service/scripts/jobs-image/news-crawl/Dockerfile @@ -0,0 +1,21 @@ +# News-Crawler (UDE 'aktuell'). Build from the repo root: +# docker build -f service/scripts/jobs-image/news-crawl/Dockerfile -t docker.nes.uni-due.de/inse/jobs/news-crawl:latest . +# +# scrapy<2.13 + Twisted<24.7 are load-bearing: the spiders use the removed +# start_requests() hook, and newer versions silently crawl 0 items. +FROM python:3.13-slim + +WORKDIR /app +ENV PYTHONUNBUFFERED=1 +# Upload the crawled articles into the shared test index (see upload_aktuell.py, +# which reads ELASTICSEARCH_INSE_* creds + NEWS_UPLOAD_INDEX from the env). +ENV NEWS_UPLOAD_INDEX=docker-job_test + +COPY service/scripts/jobs-image/news-crawl/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY service/scripts/news/ude/ ./service/scripts/news/ude/ + +# Uncapped: crawls every article and uploads to NEWS_UPLOAD_INDEX. Limit a run by +# passing --max-items N through the job's command field. +ENTRYPOINT ["python", "service/scripts/news/ude/run_pipeline.py"] diff --git a/service/scripts/jobs-image/news-crawl/requirements.txt b/service/scripts/jobs-image/news-crawl/requirements.txt new file mode 100644 index 00000000..394c2a2d --- /dev/null +++ b/service/scripts/jobs-image/news-crawl/requirements.txt @@ -0,0 +1,3 @@ +scrapy>=2.11,<2.13 +Twisted>=22.10,<24.7 +requests~=2.32 diff --git a/service/scripts/jobs-image/news-keywords/Dockerfile b/service/scripts/jobs-image/news-keywords/Dockerfile new file mode 100644 index 00000000..e8059947 --- /dev/null +++ b/service/scripts/jobs-image/news-keywords/Dockerfile @@ -0,0 +1,21 @@ +# News keyword extraction (LLM keyword extraction into docker-job_test). +# Build from the repo root: +# docker build -f service/scripts/jobs-image/news-keywords/Dockerfile -t docker.nes.uni-due.de/inse/jobs/news-keywords:latest . +# +# Needs Elasticsearch + LLM creds (injected as env vars by the backend for +# registry images). Calls the LLM once per entry. +FROM python:3.13-slim + +WORKDIR /app +ENV PYTHONUNBUFFERED=1 + +COPY service/scripts/jobs-image/news-keywords/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY background-jobs/app/ ./ + +# Writes into docker-job_test, leaving production aktuell_postproc untouched. +# A non-postproc target re-extracts entries that already have keywords (real +# content) and updates them in place, keyed on news_id (re-runs overwrite, no +# duplicates). Cap a run by appending --limit N via the job's command field. +ENTRYPOINT ["python", "sync.py", "--update-keywords", "--target-index", "docker-job_test"] diff --git a/service/scripts/jobs-image/news-keywords/requirements.txt b/service/scripts/jobs-image/news-keywords/requirements.txt new file mode 100644 index 00000000..d5f8a74c --- /dev/null +++ b/service/scripts/jobs-image/news-keywords/requirements.txt @@ -0,0 +1,3 @@ +requests~=2.32 +openai~=2.41 +python-dotenv~=1.0 diff --git a/service/scripts/jobs-image/news-topics/Dockerfile b/service/scripts/jobs-image/news-topics/Dockerfile new file mode 100644 index 00000000..916a9d82 --- /dev/null +++ b/service/scripts/jobs-image/news-topics/Dockerfile @@ -0,0 +1,24 @@ +# News-Topic-Mapping (news keywords -> OpenAlex topics). Build from the repo root: +# docker build -f service/scripts/jobs-image/news-topics/Dockerfile -t docker.nes.uni-due.de/inse/jobs/news-topics:latest . +# +# map_news_topics imports map_project_topics as its "base", so both topic_mapper +# packages must be present. Needs a reachable backend and Elasticsearch creds +# (injected as env vars by the backend for registry images). +FROM python:3.13-slim + +WORKDIR /app +ENV PYTHONUNBUFFERED=1 + +COPY service/scripts/jobs-image/news-topics/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY service/scripts/news/topic_mapper/ ./service/scripts/news/topic_mapper/ +COPY service/scripts/projects/topic_mapper/ ./service/scripts/projects/topic_mapper/ + +# Writes topic mappings into aktuell_openalex_topics. Only maps (article, keyword) +# pairs not already present in the output index; pass --overwrite to re-map all. +# Uncapped: limit a run by passing --max-docs N through the job's command field. +# host.docker.internal reaches the host backend for vector search. +ENTRYPOINT ["python", "-m", "service.scripts.news.topic_mapper.map_news_topics", \ + "--output-index", "aktuell_openalex_topics", \ + "--api-base-url", "http://host.docker.internal:8000"] diff --git a/service/scripts/jobs-image/news-topics/requirements.txt b/service/scripts/jobs-image/news-topics/requirements.txt new file mode 100644 index 00000000..7507eb03 --- /dev/null +++ b/service/scripts/jobs-image/news-topics/requirements.txt @@ -0,0 +1,2 @@ +httpx>=0.27 +python-dotenv>=1.0 diff --git a/service/scripts/jobs-image/project-topics/Dockerfile b/service/scripts/jobs-image/project-topics/Dockerfile new file mode 100644 index 00000000..f8a46a05 --- /dev/null +++ b/service/scripts/jobs-image/project-topics/Dockerfile @@ -0,0 +1,25 @@ +# Projekt-Topic-Mapping (bund keywords -> OpenAlex topics). Build from the repo root: +# docker build -f service/scripts/jobs-image/project-topics/Dockerfile -t docker.nes.uni-due.de/inse/jobs/project-topics:latest . +# +# Needs a reachable backend (vector search) and Elasticsearch creds. The creds +# arrive as env vars injected by the backend for registry images. +FROM python:3.13-slim + +WORKDIR /app +ENV PYTHONUNBUFFERED=1 + +COPY service/scripts/jobs-image/project-topics/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY service/scripts/projects/topic_mapper/ ./service/scripts/projects/topic_mapper/ + +# Writes topic mappings into docker-job_test. Only maps (project, keyword) pairs +# not already present in the output index, so an interrupted run can be resumed. +# There is no overwrite flag: to re-map all, point --output-index at a fresh index. +# Uncapped: limit a run by passing --max-docs N through the job's command field. +# host.docker.internal reaches the host backend for vector search. +ENTRYPOINT ["python", "-m", "service.scripts.projects.topic_mapper.map_project_topics", \ + "--source-index", "projects_bund_v1", \ + "--text-field", "Leistungsplansystematik_fullname", \ + "--output-index", "docker-job_test", \ + "--api-base-url", "http://host.docker.internal:8000"] diff --git a/service/scripts/jobs-image/project-topics/requirements.txt b/service/scripts/jobs-image/project-topics/requirements.txt new file mode 100644 index 00000000..7507eb03 --- /dev/null +++ b/service/scripts/jobs-image/project-topics/requirements.txt @@ -0,0 +1,2 @@ +httpx>=0.27 +python-dotenv>=1.0 diff --git a/service/scripts/jobs-image/requirements.txt b/service/scripts/jobs-image/requirements.txt new file mode 100644 index 00000000..6d1122cd --- /dev/null +++ b/service/scripts/jobs-image/requirements.txt @@ -0,0 +1,9 @@ +requests~=2.32 +openai~=2.41 +python-dotenv~=1.0 +scrapy>=2.11,<2.13 +Twisted>=22.10,<24.7 +httpx~=0.27 +selenium~=4.20 +pandas~=2.2 +elasticsearch>=7.17,<8 diff --git a/service/scripts/news/topic_mapper/README.md b/service/scripts/news/topic_mapper/README.md new file mode 100644 index 00000000..048058ec --- /dev/null +++ b/service/scripts/news/topic_mapper/README.md @@ -0,0 +1,80 @@ +# News → OpenAlex topic mapping + +Batch counterpart to `news.logic._match_topics_for_keywords`, which matches an +article's keywords on every detail request without persisting the result. This +script maps the LLM-extracted `keywords` of the enriched articles in +`aktuell_postproc` to OpenAlex topics via the backend's +`/api/topics/vector-search` endpoint, and persists one document per +(article, keyword) pair into an output index with the explicit mapping from +`news_mapping.py`: + +```json +{ + "news_id": "...", + "keyword": "", + "source_index": "aktuell_postproc", + "source_field": "keywords", + "topic_matches": [ + { + "rank": 1, + "topic_id": "...", + "topic_display_name": "...", + "subfield": "...", + "field": "...", + "domain": "...", + "match_score": null + } + ], + "match_method": "sentence_transformer", + "model_name": "...", + "built_at": "..." +} +``` + +`match_score` is `null` because the endpoint does not expose Elasticsearch +scores; `rank` preserves the search result order. + +This script only ever **reads** `aktuell_postproc` and writes into the separate test index. Caching the topics back into `aktuell_postproc` is done by the news detail endpoint (`news/logic.py`), not here. + +Keywords are **not** extracted here. `background-jobs/app/sync.py` (job `news`) +writes them into `aktuell_postproc` first, the same way the bund projects +already carry their keyword field before `map_project_topics.py` runs. + +The Elasticsearch plumbing (point-in-time scan, batched topic search, bulk +indexing, retries) is imported from +`service/scripts/projects/topic_mapper/map_project_topics.py` rather than +duplicated — that directory must stay next to this one. + +## Setup + +```bash +pip install -r requirements.txt +``` + +Credentials are read from `service/src/main/inse/.env` by default (override +with `--env-file`), and the backend must be running (e.g. `./gradlew serve`) +because the topic search goes through its API. + +## Usage + +```bash +python map_news_topics.py --output-index docker-job_test +``` + +Test run against a few articles without writing anything: + +```bash +python map_news_topics.py --output-index docker-job_test --dry-run --max-docs 50 +``` + +Runs are resumable: (article, keyword) pairs already present in the output +index are skipped, and each unique keyword is searched only once across all +articles that use it. Pairs whose search failed are left unwritten so the next +run retries them. + +## As a background job + +Packaged as the `news-topics` registry image (see +`service/scripts/jobs-image/news-topics/Dockerfile`), writing into +`aktuell_openalex_topics`. The run is uncapped; limit a run by passing +`--max-docs N` through the job's command field. diff --git a/service/scripts/news/topic_mapper/map_news_topics.py b/service/scripts/news/topic_mapper/map_news_topics.py new file mode 100644 index 00000000..f34dc42e --- /dev/null +++ b/service/scripts/news/topic_mapper/map_news_topics.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python3 +""" +map_news_topics.py — Map news keywords to OpenAlex topics. + +Batch counterpart to news.logic._match_topics_for_keywords. This script streams +the enriched articles from aktuell_postproc, reads their LLM-extracted +'keywords', matches every unique keyword against OpenAlex topics and persists +one document per (article, keyword) pair into a separate output index: + + {news_id, keyword, source_index, source_field, topic_matches[], + match_method, model_name, built_at} + +The source index is only ever read. Writing the topics back into +aktuell_postproc is the job of the news detail endpoint, not of this script. + +Keywords are not extracted here — sync.py (job 'news') writes them into +aktuell_postproc, the same way the bund projects already carry their keyword +field before map_project_topics.py runs. + +The run is resumable: (article, keyword) pairs already present in the output +index are skipped, so an interrupted run can simply be restarted. Each unique +keyword is searched only once, across all articles that use it. + +Usage: + python map_news_topics.py --output-index docker-job_test + +Requires ELASTICSEARCH_INSE_URL/ELASTICSEARCH_INSE_API_KEY in the environment +or in the service .env, plus a running backend serving +/api/topics/vector-search (e.g. ./gradlew serve). +""" +from __future__ import annotations + +import argparse +import asyncio +import hashlib +import json +import logging +import os +import sys +from datetime import datetime, timezone +from pathlib import Path + +from dotenv import load_dotenv + +sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "projects" / "topic_mapper")) +import map_project_topics as base + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from news_mapping import NEWS_TOPICS_MAPPING + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) + +SOURCE_INDEX = "aktuell_postproc" +KEYWORD_FIELD = "keywords" +NEWS_ID_FIELD = "news_id" + + +async def ensure_index(index: str, cluster: str) -> None: + """Creates the output index with the explicit mapping if it does not exist.""" + url, headers = base.es_headers(cluster) + client = base.get_http_client() + + response = await client.head(f"{url}/{index}", headers=headers) + if response.status_code == 200: + logger.info("Output index '%s' already exists.", index) + return + + response = await client.put( + f"{url}/{index}", json={"mappings": NEWS_TOPICS_MAPPING}, headers=headers + ) + response.raise_for_status() + logger.info("Created output index '%s' with explicit mapping.", index) + + +def output_doc_id(news_id: str, keyword: str) -> str: + """Stable id per (article, keyword) pair. + + Derived from news_id rather than the aktuell_postproc document id, so a + reindex of the postproc index does not duplicate the mappings. + """ + digest = hashlib.sha1(keyword.encode("utf-8")).hexdigest()[:12] + return f"{news_id}::{digest}" + + +async def fetch_source_entries(cluster: str, max_docs: int | None) -> dict[str, tuple[str, str]]: + """Returns output_doc_id -> (news_id, keyword) for every enriched article.""" + entries: dict[str, tuple[str, str]] = {} + total = 0 + docs_with_keywords = 0 + + async for hit in base.scan( + index=SOURCE_INDEX, + cluster=cluster, + query={"exists": {"field": KEYWORD_FIELD}}, + source=[NEWS_ID_FIELD, KEYWORD_FIELD], + ): + total += 1 + doc_source = hit.get("_source", {}) + keywords = base.extract_text_values(doc_source, KEYWORD_FIELD) + news_id = doc_source.get(NEWS_ID_FIELD) + if keywords and news_id: + docs_with_keywords += 1 + for keyword in keywords: + entries[output_doc_id(news_id, keyword)] = (news_id, keyword) + if total % 50000 == 0: + logger.info("Scanned %d source documents...", total) + if max_docs and total >= max_docs: + logger.info("Stopping scan at --max-docs=%d.", max_docs) + break + + logger.info( + "Scanned %d documents from '%s', %d with non-empty '%s' (%d article/keyword pairs).", + total, + SOURCE_INDEX, + docs_with_keywords, + KEYWORD_FIELD, + len(entries), + ) + return entries + + +async def run(args: argparse.Namespace) -> None: + built_at = datetime.now(timezone.utc).isoformat() + model_name = os.getenv("SENTENCE_TRANSFORMERS_MODEL_NAME") + + await base.check_backend(args.api_base_url) + + if not args.dry_run: + await ensure_index(index=args.output_index, cluster=args.output_cluster) + + entries = await fetch_source_entries(cluster=args.source_cluster, max_docs=args.max_docs) + if not entries: + logger.warning("No keywords in '%s' — run the 'news' job first.", SOURCE_INDEX) + return + + if args.overwrite: + logger.info("--overwrite: re-mapping every pair, existing documents are replaced.") + covered = set() + else: + covered = await base.fetch_covered_doc_ids( + index=args.output_index, cluster=args.output_cluster + ) + pending = {doc_id: entry for doc_id, entry in entries.items() if doc_id not in covered} + logger.info( + "Coverage: %d/%d pairs already in '%s', %d still to be processed.", + len(entries) - len(pending), + len(entries), + args.output_index, + len(pending), + ) + if not pending: + logger.info("Nothing left to process.") + return + + docs_by_keyword: dict[str, list[tuple[str, str]]] = {} + for doc_id, (news_id, keyword) in pending.items(): + docs_by_keyword.setdefault(keyword, []).append((doc_id, news_id)) + unique_keywords = sorted(docs_by_keyword) + logger.info( + "%d unique keywords cover the %d pending pairs.", len(unique_keywords), len(pending) + ) + + backup_docs: list[dict] = [] + docs_done = 0 + keywords_done = 0 + + for start in range(0, len(unique_keywords), args.text_batch_size): + chunk = unique_keywords[start : start + args.text_batch_size] + matches_by_keyword = await base.match_keywords( + chunk, + api_base_url=args.api_base_url, + top_k=args.top_k, + search_type=args.search_type, + ) + + documents = [] + for keyword in chunk: + if keyword not in matches_by_keyword: + continue # search failed — left for the next run + for doc_id, news_id in docs_by_keyword[keyword]: + documents.append( + ( + doc_id, + { + "news_id": news_id, + "keyword": keyword, + "source_index": SOURCE_INDEX, + "source_field": KEYWORD_FIELD, + "topic_matches": matches_by_keyword[keyword], + "match_method": base.MATCH_METHOD, + "model_name": model_name, + "built_at": built_at, + }, + ) + ) + + if documents and not args.dry_run: + await base.bulk_index( + index=args.output_index, cluster=args.output_cluster, documents=documents + ) + if args.output: + backup_docs.extend(doc for _, doc in documents) + + keywords_done += len(chunk) + docs_done += len(documents) + logger.info( + "Progress: %d/%d keywords, %d/%d pending pairs indexed into '%s'.", + keywords_done, + len(unique_keywords), + docs_done, + len(pending), + args.output_index, + ) + + skipped = len(pending) - docs_done + if skipped: + logger.warning( + "%d pairs were NOT indexed due to failed searches — rerun the script to retry.", + skipped, + ) + + if args.output: + output_path = Path(args.output) + output_path.parent.mkdir(parents=True, exist_ok=True) + output_path.write_text( + json.dumps(backup_docs, indent=2, ensure_ascii=False), encoding="utf-8" + ) + logger.info("Wrote local JSON backup (%d documents) to %s", len(backup_docs), output_path) + + logger.info( + "Done. %d documents indexed this run, %d covered in total.", + docs_done, + len(covered) + docs_done, + ) + + +def main() -> None: + parser = argparse.ArgumentParser( + description="Map the keywords of enriched news articles to OpenAlex topics.", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=( + "Examples:\n" + " python map_news_topics.py --output-index docker-job_test\n" + " python map_news_topics.py --output-index docker-job_test --dry-run --max-docs 50" + ), + ) + parser.add_argument( + "--output-index", required=True, help="Index to persist the topic mappings into" + ) + parser.add_argument( + "--source-cluster", + default="inse", + choices=["inse", "nes"], + help=f"Cluster holding '{SOURCE_INDEX}' (default: inse)", + ) + parser.add_argument( + "--output-cluster", + default="inse", + choices=["inse", "nes"], + help="Cluster of the output index (default: inse)", + ) + parser.add_argument( + "--api-base-url", + default=base.DEFAULT_API_BASE_URL, + help=f"Base URL of the running backend (default: {base.DEFAULT_API_BASE_URL})", + ) + parser.add_argument( + "--top-k", + type=int, + default=1, + help=( + "Number of topic matches per keyword (default: 1, matching the single " + "match the news detail endpoint shows). Only truncates the result list; " + "ranking is unaffected." + ), + ) + parser.add_argument( + "--search-type", + default="hybrid", + choices=["hybrid", "semantic"], + help="Topic search type, mirrors vector_search_topics (default: hybrid)", + ) + parser.add_argument( + "--text-batch-size", + type=int, + default=base.TEXT_BATCH_SIZE, + help=f"Unique keywords searched per chunk (default: {base.TEXT_BATCH_SIZE})", + ) + parser.add_argument( + "--env-file", + default=str(base.DEFAULT_ENV_FILE), + help=f"Path to a .env with Elasticsearch credentials (default: {base.DEFAULT_ENV_FILE})", + ) + parser.add_argument( + "--max-docs", + type=int, + default=None, + help=f"Stop scanning '{SOURCE_INDEX}' after N documents (for test runs)", + ) + parser.add_argument( + "--output", + default=None, + help="Optional path for a local JSON backup of the documents built this run", + ) + parser.add_argument( + "--overwrite", + action="store_true", + help=( + "Re-map pairs that are already in the output index instead of skipping " + "them; document ids are deterministic, so they are replaced in place " + "(use after changing --top-k or --search-type)" + ), + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Build the mapping without creating/writing the output index", + ) + args = parser.parse_args() + + if args.env_file and Path(args.env_file).exists(): + load_dotenv(dotenv_path=args.env_file) + + asyncio.run(run(args)) + + +if __name__ == "__main__": + main() diff --git a/service/scripts/news/topic_mapper/news_mapping.py b/service/scripts/news/topic_mapper/news_mapping.py new file mode 100644 index 00000000..28a6d909 --- /dev/null +++ b/service/scripts/news/topic_mapper/news_mapping.py @@ -0,0 +1,30 @@ +"""Elasticsearch mapping for news -> OpenAlex topic mapping indices. + +One document per (news article, keyword) pair. Articles in aktuell_postproc +carry up to KEYWORD_LIMIT keywords each, so an article normally yields +several documents. +""" + +NEWS_TOPICS_MAPPING = { + "properties": { + "news_id": {"type": "keyword"}, + "keyword": {"type": "text", "fields": {"keyword": {"type": "keyword"}}}, + "source_index": {"type": "keyword"}, + "source_field": {"type": "keyword"}, + "topic_matches": { + "type": "nested", + "properties": { + "rank": {"type": "integer"}, + "topic_id": {"type": "keyword"}, + "topic_display_name": {"type": "keyword"}, + "subfield": {"type": "keyword"}, + "field": {"type": "keyword"}, + "domain": {"type": "keyword"}, + "match_score": {"type": "float"}, + }, + }, + "match_method": {"type": "keyword"}, + "model_name": {"type": "keyword"}, + "built_at": {"type": "date"}, + } +} diff --git a/service/scripts/news/topic_mapper/requirements.txt b/service/scripts/news/topic_mapper/requirements.txt new file mode 100644 index 00000000..7507eb03 --- /dev/null +++ b/service/scripts/news/topic_mapper/requirements.txt @@ -0,0 +1,2 @@ +httpx>=0.27 +python-dotenv>=1.0 diff --git a/service/scripts/news/ude/run_pipeline.py b/service/scripts/news/ude/run_pipeline.py index abd86228..5f54229c 100644 --- a/service/scripts/news/ude/run_pipeline.py +++ b/service/scripts/news/ude/run_pipeline.py @@ -3,6 +3,12 @@ import sys import os import shutil import time +import argparse +import logging + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) + def run_command(command, cwd=None): """Run a shell command and exit if it fails.""" @@ -12,11 +18,27 @@ def run_command(command, cwd=None): #capture_output=True, #supresses output from subprocess text=True) if result.returncode != 0: - print(f"Command failed: {command}") - print("Error output:\n", result.stderr) + logger.error(f"Command failed: {command}") + logger.error(f"Error output:\n{result.stderr}") sys.exit(result.returncode) if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Crawl the UDE 'aktuell' news pages and upload the articles to Elasticsearch." + ) + parser.add_argument( + "--skip-upload", + action="store_true", + help="Only crawl into out/*.json and never connect to Elasticsearch", + ) + parser.add_argument( + "--max-items", + type=int, + default=None, + help="Stop each spider after N items (for short test runs)", + ) + args = parser.parse_args() + start_time = time.time() base_dir = os.path.dirname(os.path.abspath(__file__)) @@ -31,19 +53,27 @@ if __name__ == "__main__": output_file_meta = os.path.join(out_dir, "meta.json") - print("Running Scrapy link crawler...") - run_command(f"scrapy crawl aktuell-links -O \"{output_file_links}\"", cwd=crawler_dir) + limit = f" -s CLOSESPIDER_ITEMCOUNT={args.max_items}" if args.max_items else "" - print("Running Scrapy meta crawler...") - run_command(f"scrapy crawl aktuell-metadata -O \"{output_file_meta}\"", cwd=crawler_dir) + logger.info("Running Scrapy link crawler...") + run_command(f"scrapy crawl aktuell-links -O \"{output_file_links}\"{limit}", cwd=crawler_dir) - print("Running upload script") - run_command(f"{sys.executable} upload_aktuell.py {output_file_meta}", cwd=base_dir) + logger.info("Running Scrapy meta crawler...") + run_command(f"scrapy crawl aktuell-metadata -O \"{output_file_meta}\"{limit}", cwd=crawler_dir) + + if args.skip_upload: + logger.info("Skipping upload (--skip-upload): Elasticsearch was not contacted.") + else: + logger.info("Running upload script") + run_command(f"{sys.executable} upload_aktuell.py {output_file_meta}", cwd=base_dir) end_time = time.time() runtime_seconds = end_time - start_time - runtime_hours = runtime_seconds / 3600 - - print(f"Runtime: {runtime_hours:.2f} hours") - print("Finished crawling and uploading UDE news articles.") + runtime_hours = runtime_seconds / 3600 + + logger.info(f"Runtime: {runtime_hours:.2f} hours") + if args.skip_upload: + logger.info("Finished crawling UDE news articles (no upload).") + else: + logger.info("Finished crawling and uploading UDE news articles.") diff --git a/service/scripts/news/ude/upload_aktuell.py b/service/scripts/news/ude/upload_aktuell.py index 72a9654e..c97bcb3e 100644 --- a/service/scripts/news/ude/upload_aktuell.py +++ b/service/scripts/news/ude/upload_aktuell.py @@ -1,231 +1,39 @@ -from elasticsearch import Elasticsearch import sys import os import json -from datetime import datetime import time +import logging +from urllib.parse import quote -# elasticsearch-connection should be adjusted -# uni-server -es = Elasticsearch() +import requests -index_name = "aktuell-test" #test indices to make sure everything works before uploading to the real index, ps. you lack rights to push to the real index, please contact the admin if you want to push to the real index +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) +# The INSE key is index-scoped and can't hit cluster endpoints (e.g. GET /), so +# the elasticsearch client's ping/product-check would 403. We talk to the index +# endpoint directly over HTTP with the ApiKey header, like the other jobs do. +ES_URL = os.getenv("ELASTICSEARCH_INSE_URL", "http://localhost:9200").rstrip("/") +ES_API_KEY = os.getenv("ELASTICSEARCH_INSE_API_KEY") +# Default is a test index — you lack rights to push to the production index; +# contact the ES admin for that. Override via NEWS_UPLOAD_INDEX. +# The target index is never created here: an index that doesn't exist yet gets +# ES dynamic mapping, without the searchabilityAnalyzer the search relies on. +# Create it with the proper mapping before pointing a run at a new index. +INDEX_NAME = os.getenv("NEWS_UPLOAD_INDEX", "aktuell-test") -# checks if elastic is up and creates the index if not already done -def check_elastic(): - if not es.ping(): - sys.exit("No connection to Elasticsearch") +_session = requests.Session() +_session.headers.update({"Content-Type": "application/json"}) +if ES_API_KEY: + _session.headers.update({"Authorization": f"ApiKey {ES_API_KEY}"}) - if not es.indices.exists(index=index_name): - settings = { - "analysis": { - "analyzer": { - "searchabilityAnalyzer": { - "type": "custom", - "tokenizer": "standard", - "filter": [ - "lowercase", - "asciifolding" - ] - } - } - } - } - mappings = { - "properties": { - "subtitle": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "maintitle": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "author": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "date": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "date_year": { - "type": "long", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "date_full": { - "type": "long", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "intro_content": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "main_content": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "further_content": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "redaktion": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "full_content": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "tags": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - }, - "tags_nested": { - "type": "nested", - "properties": { - "tag": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 250 - } - } - } - } - }, - #"links": { - # "type": "text", - # "analyzer": "searchabilityAnalyzer", - # "search_analyzer": "searchabilityAnalyzer", - # "fields": { - # "keyword": { - # "type": "keyword", - # "ignore_above": 256 - # } - # } - #}, - "links_nested": { - "type": "nested", - "properties": { - "url": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 250 - } - } - }, - "text": { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 250 - } - } - } - } - }, - } - } - es.indices.create(index=index_name, mappings=mappings, settings=settings) def upload(path): - with open(path, "r", encoding='utf-8') as json_file: - + with open(path, "r", encoding="utf-8") as json_file: try: json_loaded = json.load(json_file) + uploaded = 0 for news in json_loaded: time.sleep(10 / 1000) id = (str(news["date"]) + "_" + str(news["author"]) + "_" + str(news["maintitle"])).replace(" ", "").replace("/", "").replace("ö", "").replace("ä", "").replace("ü", "").replace("Ö", "").replace("Ä", "").replace("Ü", "").replace(".", "").replace("?", "") @@ -241,7 +49,7 @@ def upload(path): for p in range(len(tags)): tags_nested.append({"tag": tags[p]}) - dict = { + document = { "subtitle": news["subtitle"], "maintitle": news["maintitle"], "tags": news["tags"], @@ -255,21 +63,25 @@ def upload(path): "tags_nested": tags_nested, "date_year": news["date_year"], "date_full": news["date_full"], - #"links": news["links"], "links_nested": links_nested, "url": news["url"] } - es.index(index=index_name, id=id, document=dict) + response = _session.put( + f"{ES_URL}/{INDEX_NAME}/_doc/{quote(id, safe='')}", + json=document, + ) + response.raise_for_status() + uploaded += 1 + + logger.info(f"Uploaded {uploaded} news articles to '{INDEX_NAME}'.") except Exception as e: - print("--- Failed to upload news.") - print(e) + logger.error(f"Failed to upload news: {e}") + # main - entry point if __name__ == '__main__': - check_elastic() - if len(sys.argv) != 2: sys.exit("No path given.") upload(sys.argv[1]) diff --git a/service/scripts/projects/bund/gpc.data.py b/service/scripts/projects/bund/gpc.data.py index 56b77702..2d538982 100644 --- a/service/scripts/projects/bund/gpc.data.py +++ b/service/scripts/projects/bund/gpc.data.py @@ -12,14 +12,34 @@ import pandas as pd import json from datetime import datetime import sys -from elasticsearch import Elasticsearch, helpers -from elasticsearch.helpers import bulk,BulkIndexError import os +import math +import requests import hashlib +import argparse +import logging + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s") +logger = logging.getLogger(__name__) download_path=os.path.abspath(os.getcwd()) -es = Elasticsearch() + +# The INSE key is index-scoped and can't hit cluster endpoints (e.g. GET /), so +# the elasticsearch client's ping/product-check would 403. We POST to _bulk +# directly over HTTP with the ApiKey header, like the other jobs do. +ES_URL = os.getenv("ELASTICSEARCH_INSE_URL", "http://localhost:9200").rstrip("/") +ES_API_KEY = os.getenv("ELASTICSEARCH_INSE_API_KEY") +# Default is a test index — you lack rights to push to the production index; +# contact the ES admin for that. Override via BUND_UPLOAD_INDEX. +# The target index is never created here: an index that doesn't exist yet gets +# ES dynamic mapping, without the searchabilityAnalyzer the search relies on. +# Create it with the proper mapping before pointing a run at a new index. +INDEX_NAME = os.getenv("BUND_UPLOAD_INDEX", "projects_bund_test") + +_session = requests.Session() +if ES_API_KEY: + _session.headers.update({"Authorization": f"ApiKey {ES_API_KEY}"}) def crawl_data(link,driver): driver.get(link) @@ -41,123 +61,61 @@ def crawl_data(link,driver): time.sleep(2) # Switch to the alert and Clicks the "OK" button Alert(driver).accept() - print("downloading data") + logger.info("downloading data") else: # The element is likely a honeypot, do not interact - print("Honeypot detected, skipping interaction") + logger.info("Honeypot detected, skipping interaction") -def check_elastic_online(): - if not es.ping(): - sys.exit("No connection to Elasticsearch") - else : - print("Elasticsearch connection established") -def check_elastic_index(df, index_name): - - if not es.indices.exists(index=index_name): - print(index_name + " index wasn't found. Creating a new one..") - settings = { - "analysis": { - "analyzer": { - "searchabilityAnalyzer": { - "type": "custom", - "tokenizer": "standard", - "filter": [ - "lowercase", - "asciifolding" - ] - } - } - } - } - mappings = {} - properties = {} +def _clean(value): + # pandas/numpy scalars -> native python; NaN -> None (ES rejects NaN in JSON). + if hasattr(value, "item"): + value = value.item() + if isinstance(value, float) and math.isnan(value): + return None + return value - for key in list(df.columns): - if key in ("funding_start", "funding_end", "datum"): - properties[key] = { - "type": "date", - "format": "dd.MM.yyyy" - } - elif key == "Publikationsdatum": - properties[key] = { - "type": "date", - "format": "yyyy" - } - elif key == "unix_timestamp": - properties[key] = { - "type": "long" - } - elif key == "Fördersumme": - properties[key] = { - "type": "float" - } - elif key == "new": - properties[key] = { - "type": "boolean" - } - else: - properties[key] = { - "type": "text", - "analyzer": "searchabilityAnalyzer", - "search_analyzer": "searchabilityAnalyzer", - "fields": { - "keyword": { - "type": "keyword", - "ignore_above": 256 - } - } - } - - mappings["properties"] = properties - es.indices.create(index=index_name, mappings=mappings, settings=settings) - es.indices.refresh(index=index_name) - print("The new index '"+index_name+"' has been created") - else: - print(index_name + " already exists. Uploading data...") +def upload_data(df, index_name): + logger.info("Uploading data...") -def upload_data(df,index_name): - def fill_docs_to_upload(row): + docs = [] + for _, row in df.iterrows(): doc_id = hashlib.sha256(str(row['Förderkennzeichen']).encode('utf-8')).hexdigest() - doc = { - "_op_type": "update", # Update existing documents - "_index": index_name, - "_id": doc_id, - "doc": { - "new":False - }, - "upsert":{ - **row.to_dict(), - "new":True - } - } + source = {key: _clean(val) for key, val in row.to_dict().items()} + source["new"] = True + docs.append((doc_id, source)) - docs_to_upload.append(doc) - print("Uploading data...") - - try: - check_elastic_index(df, index_name) - except Exception as e: - print("Error while creating index") - print(e) - - docs_to_upload = [] - df.apply(fill_docs_to_upload,axis=1) - def bulk_docs(docs,data_rate): - response_sum = 0 - for i in range(0, len(docs), data_rate): - try: - response = helpers.bulk(es,docs[i:i + data_rate]) - response_sum = response_sum + response[0] - except BulkIndexError as e: - print(f"{len(e.errors)} document(s) failed to index.") - for error in e.errors: - print("Error details:", error) - print ("Upload is completed. "+ str(response_sum) +" documents have been uploaded." ) data_rate = 200 - bulk_docs(docs_to_upload,data_rate) + uploaded = 0 + for i in range(0, len(docs), data_rate): + batch = docs[i:i + data_rate] + lines = [] + for doc_id, source in batch: + # update + upsert: flag an existing project as not-new, or create an + # unseen one from the row (with new=True). + lines.append(json.dumps({"update": {"_index": index_name, "_id": doc_id}})) + lines.append(json.dumps({"doc": {"new": False}, "upsert": source}, default=str)) + payload = ("\n".join(lines) + "\n").encode("utf-8") + response = _session.post( + f"{ES_URL}/_bulk", + data=payload, + headers={"Content-Type": "application/x-ndjson"}, + ) + response.raise_for_status() + result = response.json() + if result.get("errors"): + failed = [item for item in result["items"] + if next(iter(item.values())).get("status", 200) >= 300] + logger.error(f"{len(failed)} document(s) failed to index.") + for item in failed[:5]: + logger.error(f"Error details: {item}") + uploaded += len(batch) - len(failed) + else: + uploaded += len(batch) + + logger.info(f"Upload is completed. {uploaded} documents have been uploaded to '{index_name}'.") @@ -170,7 +128,7 @@ def wait_for_file_complete(download_path,file_name): fname.endswith(".part") or fname.endswith(".crdownload") for fname in os.listdir(download_path) ): - print(f"Download complete: {file_name}") + logger.info(f"Download complete: {file_name}") return True if any(fname.endswith((".part", ".crdownload")) for fname in os.listdir(download_path)): time.sleep(1) @@ -180,7 +138,7 @@ def wait_for_file_complete(download_path,file_name): def format_data(df): - print("Formattind data...") + logger.info("Formatting data...") df.drop(list(df.filter(regex='.1|Unnamed')), axis=1, inplace=True) def clean_format(text): if isinstance(text, str): @@ -233,7 +191,10 @@ def setup_chrome_driver(download_path): "download.directory_upgrade": True, "plugins.always_open_pdf_externally": True, }) - chromedriver_path = "/home/inse/miniconda3/envs/airflow/bin/chromedriver" + chrome_bin = os.getenv("CHROME_BIN") + if chrome_bin: + options.binary_location = chrome_bin + chromedriver_path = os.getenv("CHROMEDRIVER_PATH", "/usr/bin/chromedriver") service = Service(executable_path=chromedriver_path) driver = webdriver.Chrome(service=service, options=options) return driver @@ -241,7 +202,23 @@ def setup_chrome_driver(download_path): # main - entry point if __name__ == '__main__': - print("Starting") + parser = argparse.ArgumentParser( + description="Crawl the bund foerderportal project export and upload it to Elasticsearch." + ) + parser.add_argument( + "--skip-upload", + action="store_true", + help="Only crawl and format the export; never connect to Elasticsearch", + ) + parser.add_argument( + "--max-rows", + type=int, + default=None, + help="Keep at most this many rows of the formatted export (e.g. for a smoke test).", + ) + args = parser.parse_args() + + logger.info("Starting") file_path = os.path.join(os.path.abspath(os.getcwd()), 'Suchliste.csv') if not os.path.exists(file_path): driver = setup_chrome_driver(download_path) @@ -249,14 +226,19 @@ if __name__ == '__main__': crawl_data(link_to_crawl,driver) wait_for_file_complete(download_path, "Suchliste.csv") driver.close() - - + + file = pd.read_csv(file_path,encoding = "latin1",sep=";") df = pd.DataFrame(file) df_formatted = format_data(df) - - index_name = "projects_bund_test" #test indices to make sure everything works before uploading to the real index, ps. you lack rights to push to the real index, please contact the admin if you want to push to the real index - check_elastic_online() - upload_data(df_formatted,index_name) - os.remove(file_path) + + if args.max_rows: + df_formatted = df_formatted.head(args.max_rows) + + if args.skip_upload: + logger.info(f"Skipping upload (--skip-upload): Elasticsearch was not contacted. " + f"Formatted {len(df_formatted)} rows.") + else: + upload_data(df_formatted, INDEX_NAME) + os.remove(file_path) \ No newline at end of file diff --git a/service/src/main/inse/.env b/service/src/main/inse/.env index a5a055f2..36f353cf 100644 --- a/service/src/main/inse/.env +++ b/service/src/main/inse/.env @@ -16,4 +16,8 @@ ELASTICSEARCH_INSE_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FM SENTENCE_TRANSFORMERS_MODEL_NAME=intfloat/multilingual-e5-base TOKEN_ISSUER_ID=inse -TOKEN_HMAC_KEY=9dd09c80dd0796fa24bd2007f4cf57fc28c9a38909b7e83bb2d73121c5bc69c7 \ No newline at end of file +TOKEN_HMAC_KEY=9dd09c80dd0796fa24bd2007f4cf57fc28c9a38909b7e83bb2d73121c5bc69c7 + +# Docker-Registry-Login für Background-Jobs (Nexus, nes.uni-due.de) +BACKGROUND_JOBS_REGISTRY_USERNAME=student +BACKGROUND_JOBS_REGISTRY_PASSWORD=nes-student! \ No newline at end of file diff --git a/service/src/main/inse/background_jobs/__init__.py b/service/src/main/inse/background_jobs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/service/src/main/inse/background_jobs/model.py b/service/src/main/inse/background_jobs/model.py new file mode 100644 index 00000000..2a19fbef --- /dev/null +++ b/service/src/main/inse/background_jobs/model.py @@ -0,0 +1,146 @@ +""" +Database tables and API schemas for the background job runner. +""" + +from datetime import datetime, timezone +from enum import StrEnum +from typing import Optional + +from pydantic import BaseModel +from sqlmodel import JSON, Column, Field, SQLModel + + +class JobRunStatus(StrEnum): + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + STOPPED = "stopped" + + +class JobTriggeredBy(StrEnum): + SCHEDULE = "schedule" + MANUAL = "manual" + + +def utcnow() -> datetime: + return datetime.now(timezone.utc).replace(tzinfo=None) + + +class JobDefinition(SQLModel, table=True): + __tablename__ = "background_job_definition" + + id: Optional[int] = Field(default=None, primary_key=True) + name: str = Field( + index=True, unique=True, description="Human-readable job name shown in the UI." + ) + description: str = Field(default="", description="What this job does.") + target_index: str = Field( + default="", description="Elasticsearch index the job writes to (UI info)." + ) + image: Optional[str] = Field( + default=None, + description="Docker image to run. Null falls back to the configured " + "background-jobs image.", + ) + command: Optional[str] = Field( + default=None, + description="Command passed to the image. Null uses the job name (for " + "known jobs) or the image's default entrypoint.", + ) + env: dict[str, str] = Field( + default_factory=dict, + sa_column=Column(JSON), + description="Extra environment variables passed to the container.", + ) + schedule: Optional[str] = Field( + default=None, + description="Cron expression in UTC (e.g. '0 3 * * *'). Null = manual only.", + ) + enabled: bool = Field( + default=True, description="Disabled definitions are never scheduled." + ) + next_run_at: Optional[datetime] = Field( + default=None, description="Computed by the scheduler from the cron expression." + ) + created_at: datetime = Field(default_factory=utcnow) + + +class JobRun(SQLModel, table=True): + __tablename__ = "background_job_run" + + id: Optional[int] = Field(default=None, primary_key=True) + definition_id: int = Field( + foreign_key="background_job_definition.id", index=True + ) + container_id: Optional[str] = Field(default=None) + status: JobRunStatus = Field(default=JobRunStatus.RUNNING) + triggered_by: JobTriggeredBy = Field( + description="Whether the scheduler or a superadmin started this run." + ) + started_at: datetime = Field(default_factory=utcnow) + finished_at: Optional[datetime] = Field(default=None) + exit_code: Optional[int] = Field(default=None) + logs: Optional[str] = Field( + default=None, + description="Captured stdout/stderr, filled in when the run finishes " + "(the container itself is removed afterwards).", + ) + + +class JobDefinitionCreateRequest(BaseModel): + name: str + image: Optional[str] = None + command: Optional[str] = None + env: dict[str, str] = {} + description: str = "" + target_index: str = "" + schedule: Optional[str] = None + enabled: bool = True + + +class JobDefinitionUpdateRequest(BaseModel): + name: Optional[str] = None + image: Optional[str] = None + command: Optional[str] = None + env: Optional[dict[str, str]] = None + description: Optional[str] = None + target_index: Optional[str] = None + schedule: Optional[str] = None + enabled: Optional[bool] = None + + +class BackgroundJobTask(BaseModel): + id: int + name: str + description: str + target_index: str + image: Optional[str] + command: Optional[str] + env: dict[str, str] + schedule: Optional[str] + enabled: bool + next_run_at: Optional[datetime] + last_run: Optional[JobRun] + status: str + + +class JobRunLogs(BaseModel): + run_id: int + status: JobRunStatus + logs: str + + +class DockerHealth(BaseModel): + reachable: bool + detail: str + + +class RegistryHealth(BaseModel): + reachable: bool + detail: str + host: str + + +class AvailableImages(BaseModel): + images: list[str] + detail: str = "" diff --git a/service/src/main/inse/background_jobs/router.py b/service/src/main/inse/background_jobs/router.py new file mode 100644 index 00000000..57b3704b --- /dev/null +++ b/service/src/main/inse/background_jobs/router.py @@ -0,0 +1,161 @@ +from fastapi import APIRouter, Depends, Query, Response, status +from sqlmodel import Session + +from inse.auth import service as auth_service +from inse.auth.model import AccessTokenMetadata +from inse.database import get_session +from inse.tags import Tags + +from . import service +from .model import ( + AvailableImages, + BackgroundJobTask, + DockerHealth, + RegistryHealth, + JobDefinitionCreateRequest, + JobDefinitionUpdateRequest, + JobRun, + JobRunLogs, +) + +router = APIRouter(prefix="/api/background-jobs", tags=[Tags.BACKGROUND_JOBS]) + + +@router.get( + "/tasks", + operation_id="getBackgroundJobTasks", + response_model=list[BackgroundJobTask], +) +async def get_tasks( + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> list[BackgroundJobTask]: + return service.get_tasks(session, access_token) + + +@router.post( + "/tasks", + operation_id="createBackgroundJobTask", + response_model=BackgroundJobTask, + status_code=status.HTTP_201_CREATED, +) +async def create_task( + payload: JobDefinitionCreateRequest, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> BackgroundJobTask: + return service.create_task(session, access_token, payload) + + +@router.delete( + "/tasks/{task_id}", + operation_id="deleteBackgroundJobTask", + status_code=status.HTTP_204_NO_CONTENT, +) +async def delete_task( + task_id: int, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> Response: + service.delete_task(session, access_token, task_id) + return Response(status_code=status.HTTP_204_NO_CONTENT) + + +@router.patch( + "/tasks/{task_id}", + operation_id="updateBackgroundJobTask", + response_model=BackgroundJobTask, +) +async def update_task( + task_id: int, + payload: JobDefinitionUpdateRequest, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> BackgroundJobTask: + return service.update_task(session, access_token, task_id, payload) + + +@router.post( + "/tasks/{task_id}/run", + operation_id="runBackgroundJobTask", + response_model=JobRun, +) +async def run_task( + task_id: int, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> JobRun: + return service.trigger_run(session, access_token, task_id) + + +@router.get( + "/tasks/{task_id}/runs", + operation_id="getBackgroundJobTaskRuns", + response_model=list[JobRun], +) +async def get_task_runs( + task_id: int, + limit: int = Query(default=20, ge=1, le=100), + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> list[JobRun]: + return service.get_task_runs(session, access_token, task_id, limit) + + +@router.get( + "/runs/{run_id}/logs", + operation_id="getBackgroundJobRunLogs", + response_model=JobRunLogs, +) +async def get_run_logs( + run_id: int, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> JobRunLogs: + return service.get_run_logs(session, access_token, run_id) + + +@router.post( + "/runs/{run_id}/stop", + operation_id="stopBackgroundJobRun", + response_model=JobRun, +) +async def stop_run( + run_id: int, + session: Session = Depends(get_session), + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> JobRun: + return service.stop_run(session, access_token, run_id) + + +@router.get( + "/available-images", + operation_id="getBackgroundJobAvailableImages", + response_model=AvailableImages, +) +async def get_available_images( + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> AvailableImages: + return service.get_available_images(access_token) + + +@router.get( + "/docker-health", + operation_id="getBackgroundJobsDockerHealth", + response_model=DockerHealth, +) +async def docker_health( + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> DockerHealth: + return service.docker_health(access_token) + + +@router.get( + "/registry-health", + operation_id="getBackgroundJobsRegistryHealth", + response_model=RegistryHealth, +) +async def registry_health( + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, +) -> RegistryHealth: + return service.registry_health(access_token) diff --git a/service/src/main/inse/background_jobs/runner.py b/service/src/main/inse/background_jobs/runner.py new file mode 100644 index 00000000..8e964f5e --- /dev/null +++ b/service/src/main/inse/background_jobs/runner.py @@ -0,0 +1,376 @@ +""" +Launches background job containers via the host's Docker daemon and runs the +periodic schedule/reconcile loop. +""" + +import asyncio +import logging +import re +from datetime import datetime +from threading import RLock +from typing import Optional + +import docker +import httpx +from croniter import croniter +from docker.errors import NotFound +from sqlalchemy import update as sa_update +from sqlmodel import Session, select + +from inse import config +from inse.database import engine + +from .model import JobDefinition, JobRun, JobRunStatus, JobTriggeredBy, utcnow + +logger = logging.getLogger(__name__) + +settings = config.get_settings() + +RUN_STATE_LOCK = RLock() + +_client: Optional[docker.DockerClient] = None + + +def get_docker_client() -> docker.DockerClient: + global _client + if _client is None: + _client = docker.from_env() + return _client + + +def docker_reachable() -> tuple[bool, str]: + try: + get_docker_client().ping() + return True, "ok" + except Exception as error: # noqa: BLE001 + return False, str(error) + + +def registry_reachable() -> tuple[bool, str]: + username = settings.background_jobs_registry_username + password = settings.background_jobs_registry_password + auth = (username, password) if username and password else None + host = registry_host() + try: + with httpx.Client(timeout=8.0, auth=auth) as client: + response = client.get(f"https://{host}/v2/") + if response.status_code == 200: + return True, "ok" + if response.status_code == 401: + return False, "authentication failed (401)" + return False, f"unexpected status {response.status_code}" + except Exception as error: # noqa: BLE001 + return False, str(error) + + +def compute_next_run(schedule: str) -> datetime: + return croniter(schedule, utcnow()).get_next(datetime) + + +def job_environment() -> dict[str, str]: + environment = { + "INSE_ELASTIC_URL": settings.elasticsearch_inse_url, + "INSE_ELASTIC_API_KEY": settings.elasticsearch_inse_api_key, + "INSE_LLM_BASE_URL": settings.llm_api_url, + "INSE_LLM_API_KEY": settings.llm_api_key, + "INSE_LLM_MODEL": settings.llm_model, + "ELASTICSEARCH_INSE_URL": settings.elasticsearch_inse_url, + "ELASTICSEARCH_INSE_API_KEY": settings.elasticsearch_inse_api_key, + "SENTENCE_TRANSFORMERS_MODEL_NAME": settings.sentence_transformers_model_name, + } + return {key: value for key, value in environment.items() if value} + + +def registry_host() -> str: + return settings.background_jobs_image.split("/", 1)[0] + + +REGISTRY_IMAGE_LIMIT = 500 + + +def list_registry_images() -> tuple[list[str], str]: + username = settings.background_jobs_registry_username + password = settings.background_jobs_registry_password + if not username or not password: + return [], "registry credentials are not configured" + + host = registry_host() + base = f"https://{host}" + try: + with httpx.Client(timeout=10.0, auth=(username, password)) as client: + catalog = client.get( + f"{base}/v2/_catalog", params={"n": REGISTRY_IMAGE_LIMIT} + ) + catalog.raise_for_status() + repositories = catalog.json().get("repositories", []) or [] + + images: list[str] = [] + for repository in repositories: + try: + response = client.get(f"{base}/v2/{repository}/tags/list") + response.raise_for_status() + tags = response.json().get("tags") or [] + except Exception: # noqa: BLE001 + tags = [] + if tags: + images.extend(f"{host}/{repository}:{tag}" for tag in tags) + else: + images.append(f"{host}/{repository}") + return sorted(images), "" + except Exception as error: # noqa: BLE001 + logger.warning("Could not list registry images.", exc_info=True) + return [], str(error) + + +def resolve_image(definition: JobDefinition) -> Optional[str]: + return definition.image or None + + +def is_registry_image(image: Optional[str]) -> bool: + return bool(image) and image.split("/", 1)[0] == registry_host() + + +def container_name(definition: JobDefinition, run: JobRun) -> str: + slug = definition.name.lower() + slug = ( + slug.replace("ä", "ae") + .replace("ö", "oe") + .replace("ü", "ue") + .replace("ß", "ss") + ) + slug = re.sub(r"[^a-z0-9]+", "-", slug).strip("-")[:40].strip("-") + return f"{slug or 'job'}-run-{run.id}" + + +def resolve_command(definition: JobDefinition): + return definition.command or None + + +def resolve_environment(definition: JobDefinition) -> dict[str, str]: + base = job_environment() if is_registry_image(resolve_image(definition)) else {} + return {**base, **(definition.env or {})} + + +def registry_auth() -> Optional[dict[str, str]]: + if ( + settings.background_jobs_registry_username + and settings.background_jobs_registry_password + ): + return { + "username": settings.background_jobs_registry_username, + "password": settings.background_jobs_registry_password, + } + return None + + +def pull_image(image: str) -> None: + get_docker_client().images.pull(image, auth_config=registry_auth()) + logger.info("Pulled image '%s' from the registry.", image) + + +def start_run( + session: Session, definition: JobDefinition, triggered_by: JobTriggeredBy +) -> JobRun: + run = JobRun(definition_id=definition.id, triggered_by=triggered_by) + session.add(run) + session.commit() + session.refresh(run) + + image = resolve_image(definition) + if not image: + run.status = JobRunStatus.FAILED + run.finished_at = utcnow() + run.logs = "[system] No image configured for this job." + session.add(run) + session.commit() + session.refresh(run) + return run + + if settings.background_jobs_pull_before_run and is_registry_image(image): + try: + pull_image(image) + except Exception as error: # noqa: BLE001 + run.status = JobRunStatus.FAILED + run.finished_at = utcnow() + run.logs = ( + f"[system] Failed to pull image '{image}' from the registry.\n" + f"[system] {error}" + ) + session.add(run) + session.commit() + session.refresh(run) + return run + + try: + container = get_docker_client().containers.run( + image=image, + command=resolve_command(definition), + environment=resolve_environment(definition), + detach=True, + name=container_name(definition, run), + remove=False, + ) + run.container_id = container.id + except Exception as error: # noqa: BLE001 + run.status = JobRunStatus.FAILED + run.finished_at = utcnow() + run.logs = ( + f"[system] Failed to start the container for image '{image}'.\n" + f"[system] {error}" + ) + + session.add(run) + session.commit() + session.refresh(run) + return run + + +def has_running_run(session: Session, definition_id: int) -> bool: + return ( + session.exec( + select(JobRun).where( + JobRun.definition_id == definition_id, + JobRun.status == JobRunStatus.RUNNING, + ) + ).first() + is not None + ) + + +def schedule_due_jobs(session: Session) -> None: + now = utcnow() + scheduled = session.exec( + select(JobDefinition).where( + JobDefinition.enabled == True, # noqa: E712 + JobDefinition.schedule != None, # noqa: E711 + ) + ).all() + + for definition in scheduled: + if definition.next_run_at is None: + definition.next_run_at = compute_next_run(definition.schedule) + session.add(definition) + continue + if definition.next_run_at > now: + continue + + if has_running_run(session, definition.id): + logger.info( + "Skipping '%s': previous run still running.", definition.name + ) + else: + run = start_run(session, definition, JobTriggeredBy.SCHEDULE) + logger.info( + "Started scheduled run %s of '%s'.", run.id, definition.name + ) + + definition.next_run_at = compute_next_run(definition.schedule) + session.add(definition) + + session.commit() + + +def finalize_run( + session: Session, + run: JobRun, + *, + new_status: JobRunStatus, + expected_status: JobRunStatus = JobRunStatus.RUNNING, + exit_code: Optional[int] = None, + logs: Optional[str] = None, +) -> bool: + values: dict = {"status": new_status, "finished_at": utcnow()} + if exit_code is not None: + values["exit_code"] = exit_code + if logs is not None: + values["logs"] = logs + result = session.execute( + sa_update(JobRun) + .where(JobRun.id == run.id, JobRun.status == expected_status) + .values(**values) + ) + return result.rowcount > 0 + + +def append_system_log(logs: str, message: str) -> str: + base = logs.rstrip() + return f"{base}\n[system] {message}" if base else f"[system] {message}" + + +def remove_container(container, run_id: int) -> None: + try: + container.remove() + except Exception: # noqa: BLE001 + logger.warning( + "Could not remove container for run %s.", run_id, exc_info=True + ) + + +def reconcile_runs(session: Session) -> None: + with RUN_STATE_LOCK: + _reconcile_runs(session) + + +def _reconcile_runs(session: Session) -> None: + running = session.exec( + select(JobRun).where(JobRun.status == JobRunStatus.RUNNING) + ).all() + for run in running: + if not run.container_id: + continue + try: + container = get_docker_client().containers.get(run.container_id) + except NotFound: + applied = finalize_run( + session, + run, + new_status=JobRunStatus.FAILED, + logs=(run.logs or "") + + "\n[container disappeared before reconciliation]", + ) + if applied: + session.commit() + logger.info( + "Run %s finished: failed (container disappeared).", run.id + ) + continue + + container.reload() + if container.status in ("exited", "dead"): + exit_code = container.attrs["State"]["ExitCode"] + new_status = ( + JobRunStatus.SUCCEEDED if exit_code == 0 else JobRunStatus.FAILED + ) + applied = finalize_run( + session, + run, + new_status=new_status, + exit_code=exit_code, + logs=container.logs().decode("utf-8", errors="replace"), + ) + if applied: + session.commit() + remove_container(container, run.id) + logger.info( + "Run %s finished: %s (exit %s).", run.id, new_status, exit_code + ) + session.commit() + + +def tick() -> None: + with Session(engine) as session: + schedule_due_jobs(session) + reconcile_runs(session) + + +async def scheduler_loop() -> None: + logger.info( + "Background job scheduler started (tick every %ss).", + settings.background_jobs_tick_seconds, + ) + while True: + try: + await asyncio.to_thread(tick) + except Exception: # noqa: BLE001 + logger.exception("Background job scheduler tick failed.") + await asyncio.sleep(settings.background_jobs_tick_seconds) diff --git a/service/src/main/inse/background_jobs/service.py b/service/src/main/inse/background_jobs/service.py new file mode 100644 index 00000000..9f27b30e --- /dev/null +++ b/service/src/main/inse/background_jobs/service.py @@ -0,0 +1,401 @@ +""" +Business logic for the superadmin-only background job endpoints. +""" + +import logging + +from croniter import croniter +from docker.errors import APIError, NotFound +from fastapi import HTTPException, status +from sqlmodel import Session, col, select + +from inse import config +from inse.auth.model import AccessTokenMetadata, UserRole + +from . import runner +from .model import ( + AvailableImages, + BackgroundJobTask, + DockerHealth, + RegistryHealth, + JobDefinition, + JobDefinitionCreateRequest, + JobDefinitionUpdateRequest, + JobRun, + JobRunLogs, + JobRunStatus, + JobTriggeredBy, + utcnow, +) + +logger = logging.getLogger(__name__) + +settings = config.get_settings() + + +def _require_super_admin(access_token: AccessTokenMetadata) -> None: + if access_token.effective_role != UserRole.SUPER_ADMIN: + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Only superadmins can manage background jobs.", + ) + + +def _get_definition(session: Session, definition_id: int) -> JobDefinition: + definition = session.get(JobDefinition, definition_id) + if not definition: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail=f"Unknown background job task id {definition_id}.", + ) + return definition + + +def _get_run(session: Session, run_id: int) -> JobRun: + run = session.get(JobRun, run_id) + if not run: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail=f"Unknown background job run id {run_id}.", + ) + return run + + +def _last_run(session: Session, definition_id: int) -> JobRun | None: + return session.exec( + select(JobRun) + .where(JobRun.definition_id == definition_id) + .order_by(col(JobRun.id).desc()) + ).first() + + +def _to_task(session: Session, definition: JobDefinition) -> BackgroundJobTask: + last_run = _last_run(session, definition.id) + if last_run is None: + derived_status = "idle" + elif last_run.status == JobRunStatus.RUNNING: + derived_status = "running" + else: + derived_status = last_run.status.value + return BackgroundJobTask( + id=definition.id, + name=definition.name, + description=definition.description, + target_index=definition.target_index, + image=definition.image, + command=definition.command, + env=definition.env or {}, + schedule=definition.schedule, + enabled=definition.enabled, + next_run_at=definition.next_run_at, + last_run=last_run, + status=derived_status, + ) + + +def get_tasks( + session: Session, access_token: AccessTokenMetadata +) -> list[BackgroundJobTask]: + _require_super_admin(access_token) + definitions = session.exec( + select(JobDefinition).order_by(col(JobDefinition.id)) + ).all() + return [_to_task(session, definition) for definition in definitions] + + +def create_task( + session: Session, + access_token: AccessTokenMetadata, + payload: JobDefinitionCreateRequest, +) -> BackgroundJobTask: + _require_super_admin(access_token) + name = payload.name.strip() + if not name: + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail="Task name must not be empty.", + ) + image = (payload.image or "").strip() + if not image: + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail="An image must be selected.", + ) + if payload.schedule is not None and not croniter.is_valid(payload.schedule): + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail=f"Invalid cron expression: '{payload.schedule}'.", + ) + if session.exec(select(JobDefinition).where(JobDefinition.name == name)).first(): + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"A task named '{name}' already exists.", + ) + + definition = JobDefinition( + name=name, + image=image, + command=payload.command, + env=payload.env or {}, + description=payload.description, + target_index=payload.target_index, + schedule=payload.schedule, + enabled=payload.enabled, + ) + if definition.enabled and definition.schedule: + definition.next_run_at = runner.compute_next_run(definition.schedule) + session.add(definition) + session.commit() + session.refresh(definition) + logger.info("Created background job task '%s'.", name) + return _to_task(session, definition) + + +def delete_task( + session: Session, access_token: AccessTokenMetadata, definition_id: int +) -> None: + _require_super_admin(access_token) + definition = _get_definition(session, definition_id) + if runner.has_running_run(session, definition.id): + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"'{definition.name}' is running. Stop the run first.", + ) + runs = session.exec( + select(JobRun).where(JobRun.definition_id == definition.id) + ).all() + for run in runs: + session.delete(run) + session.delete(definition) + session.commit() + logger.info( + "Deleted background job task '%s' (%d runs removed).", + definition.name, + len(runs), + ) + + +def update_task( + session: Session, + access_token: AccessTokenMetadata, + definition_id: int, + payload: JobDefinitionUpdateRequest, +) -> BackgroundJobTask: + _require_super_admin(access_token) + changes = payload.model_dump(exclude_unset=True) + if changes.get("schedule") is not None and not croniter.is_valid( + changes["schedule"] + ): + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail=f"Invalid cron expression: '{changes['schedule']}'.", + ) + + if "name" in changes: + name = (changes["name"] or "").strip() + if not name: + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail="Task name must not be empty.", + ) + duplicate = session.exec( + select(JobDefinition).where( + JobDefinition.name == name, + JobDefinition.id != definition_id, + ) + ).first() + if duplicate: + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"A task named '{name}' already exists.", + ) + changes["name"] = name + + if "image" in changes: + image = (changes["image"] or "").strip() + if not image: + raise HTTPException( + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + detail="An image must be selected.", + ) + changes["image"] = image + + definition = _get_definition(session, definition_id) + for key, value in changes.items(): + setattr(definition, key, value) + if "schedule" in changes or "enabled" in changes: + definition.next_run_at = ( + runner.compute_next_run(definition.schedule) + if definition.enabled and definition.schedule + else None + ) + session.add(definition) + session.commit() + session.refresh(definition) + return _to_task(session, definition) + + +def trigger_run( + session: Session, access_token: AccessTokenMetadata, definition_id: int +) -> JobRun: + _require_super_admin(access_token) + definition = _get_definition(session, definition_id) + if runner.has_running_run(session, definition.id): + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"'{definition.name}' is already running.", + ) + return runner.start_run(session, definition, JobTriggeredBy.MANUAL) + + +def get_task_runs( + session: Session, + access_token: AccessTokenMetadata, + definition_id: int, + limit: int, +) -> list[JobRun]: + _require_super_admin(access_token) + _get_definition(session, definition_id) + return session.exec( + select(JobRun) + .where(JobRun.definition_id == definition_id) + .order_by(col(JobRun.id).desc()) + .limit(limit) + ).all() + + +LOG_TAIL_LINES = 200 + + +def _tail_log_lines(text: str, limit: int = LOG_TAIL_LINES) -> str: + lines = text.splitlines() + if len(lines) <= limit: + return text + return "\n".join(lines[-limit:]) + + +def get_run_logs( + session: Session, access_token: AccessTokenMetadata, run_id: int +) -> JobRunLogs: + _require_super_admin(access_token) + run = _get_run(session, run_id) + if run.status == JobRunStatus.RUNNING and run.container_id: + try: + container = runner.get_docker_client().containers.get(run.container_id) + return JobRunLogs( + run_id=run_id, + status=run.status, + logs=container.logs(tail=LOG_TAIL_LINES).decode( + "utf-8", errors="replace" + ), + ) + except Exception: # noqa: BLE001 + pass + return JobRunLogs( + run_id=run_id, status=run.status, logs=_tail_log_lines(run.logs or "") + ) + + +def stop_run( + session: Session, access_token: AccessTokenMetadata, run_id: int +) -> JobRun: + _require_super_admin(access_token) + with runner.RUN_STATE_LOCK: + run = _get_run(session, run_id) + session.refresh(run) + if run.status != JobRunStatus.RUNNING or not run.container_id: + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"Run {run_id} is not running.", + ) + + requested_at = utcnow().isoformat(timespec="seconds") + "Z" + stop_message = f"Stop requested at {requested_at}." + try: + container = runner.get_docker_client().containers.get(run.container_id) + container.reload() + except NotFound as error: + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail=f"Container for run {run_id} no longer exists.", + ) from error + except Exception as error: # noqa: BLE001 + logger.warning( + "Could not inspect run %s before stopping.", run_id, exc_info=True + ) + raise HTTPException( + status_code=status.HTTP_502_BAD_GATEWAY, + detail=f"Could not inspect container for run {run_id}.", + ) from error + + stopped_by_request = False + if container.status not in ("exited", "dead"): + try: + container.stop(timeout=2) + stopped_by_request = True + except APIError as error: + if error.status_code != 304: + logger.warning("Could not stop run %s.", run_id, exc_info=True) + raise HTTPException( + status_code=status.HTTP_502_BAD_GATEWAY, + detail=f"Could not stop container for run {run_id}.", + ) from error + except Exception as error: # noqa: BLE001 + logger.warning("Could not stop run %s.", run_id, exc_info=True) + raise HTTPException( + status_code=status.HTTP_502_BAD_GATEWAY, + detail=f"Could not stop container for run {run_id}.", + ) from error + + container.reload() + exit_code = container.attrs["State"]["ExitCode"] + logs = container.logs().decode("utf-8", errors="replace") + logs = runner.append_system_log(logs, stop_message) + if stopped_by_request: + new_status = JobRunStatus.STOPPED + logs = runner.append_system_log( + logs, f"Container stopped (exit {exit_code})." + ) + else: + new_status = ( + JobRunStatus.SUCCEEDED if exit_code == 0 else JobRunStatus.FAILED + ) + logs = runner.append_system_log( + logs, "Stop request arrived after the container had exited." + ) + + applied = runner.finalize_run( + session, + run, + new_status=new_status, + exit_code=exit_code, + logs=logs, + ) + if not applied: + session.rollback() + session.refresh(run) + return run + session.commit() + runner.remove_container(container, run.id) + session.refresh(run) + return run + + +def get_available_images(access_token: AccessTokenMetadata) -> AvailableImages: + _require_super_admin(access_token) + images, detail = runner.list_registry_images() + return AvailableImages(images=images, detail=detail) + + +def docker_health(access_token: AccessTokenMetadata) -> DockerHealth: + _require_super_admin(access_token) + reachable, detail = runner.docker_reachable() + return DockerHealth(reachable=reachable, detail=detail) + + +def registry_health(access_token: AccessTokenMetadata) -> RegistryHealth: + _require_super_admin(access_token) + reachable, detail = runner.registry_reachable() + return RegistryHealth( + reachable=reachable, detail=detail, host=runner.registry_host() + ) diff --git a/service/src/main/inse/background_jobs/test_stop.py b/service/src/main/inse/background_jobs/test_stop.py new file mode 100644 index 00000000..edea90f8 --- /dev/null +++ b/service/src/main/inse/background_jobs/test_stop.py @@ -0,0 +1,146 @@ +from types import SimpleNamespace + +import pytest +from fastapi import HTTPException +from sqlmodel import Session, SQLModel, create_engine + +from inse.auth.model import UserRole + +from . import runner, service +from .model import JobRun, JobRunStatus, JobTriggeredBy + + +class FakeContainer: + def __init__( + self, *, status: str, exit_code: int, logs: str, stop_error=None + ): + self.status = status + self.attrs = {"State": {"ExitCode": exit_code}} + self._logs = logs + self.stop_calls = 0 + self.removed = False + self.stop_error = stop_error + + def reload(self) -> None: + pass + + def stop(self, timeout: int) -> None: + assert timeout == 2 + self.stop_calls += 1 + if self.stop_error: + raise self.stop_error + self.status = "exited" + self.attrs["State"]["ExitCode"] = 143 + + def logs(self, tail=None) -> bytes: + return self._logs.encode() + + def remove(self) -> None: + self.removed = True + + +@pytest.fixture() +def session(): + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) + SQLModel.metadata.create_all(engine) + with Session(engine) as database_session: + yield database_session + + +def _token(): + return SimpleNamespace(effective_role=UserRole.SUPER_ADMIN) + + +def _run(session: Session, status: JobRunStatus = JobRunStatus.RUNNING) -> JobRun: + run = JobRun( + definition_id=1, + container_id="container-id", + status=status, + triggered_by=JobTriggeredBy.MANUAL, + ) + session.add(run) + session.commit() + session.refresh(run) + return run + + +def _use_container(monkeypatch, container: FakeContainer) -> None: + client = SimpleNamespace( + containers=SimpleNamespace(get=lambda container_id: container) + ) + monkeypatch.setattr(runner, "get_docker_client", lambda: client) + + +def test_stop_running_container_records_stopped_and_system_logs( + session, monkeypatch +): + run = _run(session) + container = FakeContainer(status="running", exit_code=0, logs="Progress: 5/20") + _use_container(monkeypatch, container) + + result = service.stop_run(session, _token(), run.id) + + assert result.status == JobRunStatus.STOPPED + assert result.exit_code == 143 + assert container.stop_calls == 1 + assert container.removed is True + assert "Progress: 5/20" in result.logs + assert "[system] Stop requested at" in result.logs + assert "[system] Container stopped (exit 143)." in result.logs + + +def test_late_stop_preserves_successful_container_result(session, monkeypatch): + run = _run(session) + container = FakeContainer( + status="exited", + exit_code=0, + logs="Demo job finished successfully.", + ) + _use_container(monkeypatch, container) + + result = service.stop_run(session, _token(), run.id) + + assert result.status == JobRunStatus.SUCCEEDED + assert result.exit_code == 0 + assert container.stop_calls == 0 + assert container.removed is True + assert "Demo job finished successfully." in result.logs + assert "Stop request arrived after the container had exited." in result.logs + + +def test_reconciler_keeps_running_container_after_backend_restart( + session, monkeypatch +): + run = _run(session) + container = FakeContainer(status="running", exit_code=0, logs="Partial output") + _use_container(monkeypatch, container) + + runner.reconcile_runs(session) + session.refresh(run) + + assert run.status == JobRunStatus.RUNNING + assert run.exit_code is None + assert container.stop_calls == 0 + assert container.removed is False + + +def test_failed_docker_stop_leaves_database_run_running(session, monkeypatch): + run = _run(session) + container = FakeContainer( + status="running", + exit_code=0, + logs="Partial output", + stop_error=RuntimeError("Docker unavailable"), + ) + _use_container(monkeypatch, container) + + with pytest.raises(HTTPException) as error: + service.stop_run(session, _token(), run.id) + session.refresh(run) + + assert run.status == JobRunStatus.RUNNING + assert error.value.status_code == 502 + assert run.finished_at is None + assert container.removed is False diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py index ba0c1765..aebc16c6 100644 --- a/service/src/main/inse/config.py +++ b/service/src/main/inse/config.py @@ -7,6 +7,7 @@ that can be adjusted via environment variables. from functools import lru_cache import logging +from pathlib import Path from typing import Dict, List, Literal, Optional from pydantic_settings import BaseSettings, SettingsConfigDict from dotenv import load_dotenv @@ -14,7 +15,10 @@ from dotenv import load_dotenv logger = logging.getLogger(__name__) -load_dotenv() +# Anchor the .env to this file's directory so it loads regardless of the +# process working directory. +ENV_FILE = Path(__file__).resolve().parent / ".env" +load_dotenv(ENV_FILE) class Settings(BaseSettings): @@ -43,6 +47,20 @@ class Settings(BaseSettings): llm_api_key: Optional[str] = None llm_model: Optional[str] = None + # Background job runner config (Docker-out-of-Docker) + background_jobs_image: str = "docker.nes.uni-due.de/inse/background-jobs:latest" + background_jobs_scheduler_enabled: bool = True + background_jobs_tick_seconds: int = 5 + # Pull the job image from the registry before each run so an updated tag + # (e.g. :latest) is picked up. Disable for local image development, where + # a locally built image would otherwise be overwritten by the registry. + background_jobs_pull_before_run: bool = True + # Credentials for pulling the job image from a private registry (e.g. the + # Nexus at docker.nes.uni-due.de). Needed because the runner pulls via the + # Docker SDK inside the service container, which has no `docker login` creds. + background_jobs_registry_username: Optional[str] = None + background_jobs_registry_password: Optional[str] = None + # Sentence Transformers config sentence_transformers_model_name: str = "intfloat/multilingual-e5-base" @@ -52,7 +70,7 @@ class Settings(BaseSettings): elasticsearch_inse_url: Optional[str] = None elasticsearch_inse_api_key: Optional[str] = None - model_config = SettingsConfigDict(env_file=".env") + model_config = SettingsConfigDict(env_file=str(ENV_FILE)) allowed_origins: List[str] = ["http://localhost:4200"] diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 65f076d7..38fe9d80 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -6,6 +6,7 @@ for fastapi that loads the service and the webapp. """ +import asyncio from contextlib import asynccontextmanager, contextmanager import logging @@ -44,6 +45,8 @@ from inse.bookmarks.router import router as bookmarks_router from inse.institutions.router import router as institutions_router from inse.database import create_db_and_tables, get_session from inse.auth.service import create_predefined_accounts +from inse.background_jobs.router import router as background_jobs_router +from inse.background_jobs.runner import scheduler_loop as background_jobs_scheduler_loop from . import config from .service import router as service_router @@ -77,7 +80,17 @@ async def lifespan(app: FastAPI): create_db_and_tables() with contextmanager(get_session)() as session: create_predefined_accounts(session, "../data/predefined_accounts.json") + + background_jobs_scheduler_task = None + if settings.background_jobs_scheduler_enabled: + background_jobs_scheduler_task = asyncio.create_task( + background_jobs_scheduler_loop() + ) + yield + + if background_jobs_scheduler_task is not None: + background_jobs_scheduler_task.cancel() logger.info("Shutting down the application...") @@ -122,6 +135,7 @@ app.include_router(dashboard_router) app.include_router(dfg_institutions_router) app.include_router(dfg_persons_router) app.include_router(bookmarks_router) +app.include_router(background_jobs_router) app.include_router(eu_organizations_router) app.add_middleware( diff --git a/service/src/main/inse/middleware/etag_cache.py b/service/src/main/inse/middleware/etag_cache.py index a209b386..24a67239 100644 --- a/service/src/main/inse/middleware/etag_cache.py +++ b/service/src/main/inse/middleware/etag_cache.py @@ -8,23 +8,23 @@ from starlette.middleware.base import BaseHTTPMiddleware from starlette.requests import Request from starlette.responses import Response -# Responses whose contents depend on the current account or effective -# organization must never be reused by the browser. -NO_STORE_PATH_PREFIXES = ( - "/api/auth/v2", - "/api/accounts", - "/api/bookmarks", - "/api/organizations", - "/api/dashboard", - "/api/rank/rank-author", - "/api/works/v2/classification/", -) - -NO_STORE_PATH_FRAGMENTS = ( - "/company-connections", - "/primary-category-aggregations", -) - +# Responses whose contents depend on the current account or effective +# organization must never be reused by the browser. +NO_STORE_PATH_PREFIXES = ( + "/api/auth/v2", + "/api/accounts", + "/api/background-jobs", + "/api/bookmarks", + "/api/organizations", + "/api/dashboard", + "/api/rank/rank-author", + "/api/works/v2/classification/", +) + +NO_STORE_PATH_FRAGMENTS = ( + "/company-connections", + "/primary-category-aggregations", +) # POST is opt-out. Add any endpoint here that MUTATES state (create/update/delete/ # trigger side effects), even if it "usually" returns 200. EXCLUDED_POST_PATHS = ( @@ -91,61 +91,61 @@ class ETagCacheMiddleware(BaseHTTPMiddleware): return f"{user_id}:{base}" return base - def _content_type(self, response: Response) -> str | None: - return response.headers.get("content-type") - - def _requires_no_store(self, request: Request) -> bool: - path = request.url.path - return path.startswith(NO_STORE_PATH_PREFIXES) or any( - fragment in path for fragment in NO_STORE_PATH_FRAGMENTS - ) - - def _set_no_store_headers(self, response: Response) -> None: - response.headers["Cache-Control"] = "private, no-store, max-age=0" - response.headers["Pragma"] = "no-cache" - response.headers["Expires"] = "0" - self._append_vary_authorization(response.headers) - - @staticmethod - def _append_vary_authorization(headers) -> None: - vary_values = [ - value.strip() - for value in headers.get("Vary", "").split(",") - if value.strip() - ] - if not any(value.lower() == "authorization" for value in vary_values): - vary_values.append("Authorization") - headers["Vary"] = ", ".join(vary_values) - - def _cache_response_headers( - self, request: Request, etag: str, content_type: str | None - ) -> dict[str, str]: - cache_control = f"max-age={self.ttl}" - headers = {"ETag": etag, "Cache-Control": cache_control} - if request.headers.get("authorization"): - headers["Cache-Control"] = f"private, {cache_control}" - headers["Vary"] = "Authorization" - if content_type: - headers["Content-Type"] = content_type - return headers - - def _is_cacheable_request(self, request: Request) -> bool: - if self._requires_no_store(request): - return False + def _content_type(self, response: Response) -> str | None: + return response.headers.get("content-type") + + def _requires_no_store(self, request: Request) -> bool: + path = request.url.path + return path.startswith(NO_STORE_PATH_PREFIXES) or any( + fragment in path for fragment in NO_STORE_PATH_FRAGMENTS + ) + + def _set_no_store_headers(self, response: Response) -> None: + response.headers["Cache-Control"] = "private, no-store, max-age=0" + response.headers["Pragma"] = "no-cache" + response.headers["Expires"] = "0" + self._append_vary_authorization(response.headers) + + @staticmethod + def _append_vary_authorization(headers) -> None: + vary_values = [ + value.strip() + for value in headers.get("Vary", "").split(",") + if value.strip() + ] + if not any(value.lower() == "authorization" for value in vary_values): + vary_values.append("Authorization") + headers["Vary"] = ", ".join(vary_values) + + def _cache_response_headers( + self, request: Request, etag: str, content_type: str | None + ) -> dict[str, str]: + cache_control = f"max-age={self.ttl}" + headers = {"ETag": etag, "Cache-Control": cache_control} + if request.headers.get("authorization"): + headers["Cache-Control"] = f"private, {cache_control}" + headers["Vary"] = "Authorization" + if content_type: + headers["Content-Type"] = content_type + return headers + + def _is_cacheable_request(self, request: Request) -> bool: + if self._requires_no_store(request): + return False if request.method == "GET": return True if request.method == "POST": return not request.url.path.startswith(EXCLUDED_POST_PATHS) return False - async def dispatch(self, request: Request, call_next): - if self._requires_no_store(request): - response = await call_next(request) - self._set_no_store_headers(response) - return response - - if not self._is_cacheable_request(request): - return await call_next(request) + async def dispatch(self, request: Request, call_next): + if self._requires_no_store(request): + response = await call_next(request) + self._set_no_store_headers(response) + return response + + if not self._is_cacheable_request(request): + return await call_next(request) body_bytes = b"" if request.method == "POST": @@ -165,21 +165,21 @@ class ETagCacheMiddleware(BaseHTTPMiddleware): client_etag = request.headers.get("if-none-match") # Cache hit + not expired - if entry: - if client_etag == entry["etag"]: - headers = self._cache_response_headers( - request, - entry["etag"], - entry.get("content_type"), - ) - return Response(status_code=304, headers=headers) - - headers = self._cache_response_headers( - request, - entry["etag"], - entry.get("content_type"), - ) - return Response( + if entry: + if client_etag == entry["etag"]: + headers = self._cache_response_headers( + request, + entry["etag"], + entry.get("content_type"), + ) + return Response(status_code=304, headers=headers) + + headers = self._cache_response_headers( + request, + entry["etag"], + entry.get("content_type"), + ) + return Response( content=entry["body"], status_code=entry["status_code"], headers=headers, @@ -204,9 +204,9 @@ class ETagCacheMiddleware(BaseHTTPMiddleware): }, ) - headers = self._cache_response_headers(request, etag, content_type) - return Response( + headers = self._cache_response_headers(request, etag, content_type) + return Response( content=body, status_code=response.status_code, headers=headers, - ) + ) diff --git a/service/src/main/inse/middleware/test_etag_cache.py b/service/src/main/inse/middleware/test_etag_cache.py new file mode 100644 index 00000000..72108082 --- /dev/null +++ b/service/src/main/inse/middleware/test_etag_cache.py @@ -0,0 +1,53 @@ +from fastapi import FastAPI +from fastapi.testclient import TestClient + +from inse.middleware.etag_cache import ETagCacheMiddleware + + +def _app_with_counter(): + app = FastAPI() + calls = {"get": 0, "post": 0} + + @app.get("/api/background-jobs/tasks") + def get_tasks(): + calls["get"] += 1 + return {"call": calls["get"]} + + @app.post("/api/background-jobs/tasks/4/run") + def run_task(): + calls["post"] += 1 + return {"call": calls["post"]} + + app.add_middleware(ETagCacheMiddleware, ttl=120) + return app, calls + + +def test_background_job_gets_are_never_cached(): + app, calls = _app_with_counter() + + with TestClient(app) as client: + first = client.get("/api/background-jobs/tasks") + second = client.get( + "/api/background-jobs/tasks", + headers={"If-None-Match": first.headers.get("etag", "")}, + ) + + assert first.status_code == 200 + assert second.status_code == 200 + assert first.json() == {"call": 1} + assert second.json() == {"call": 2} + assert calls["get"] == 2 + + +def test_background_job_post_side_effects_are_never_replayed_from_cache(): + app, calls = _app_with_counter() + + with TestClient(app) as client: + first = client.post("/api/background-jobs/tasks/4/run") + second = client.post("/api/background-jobs/tasks/4/run") + + assert first.status_code == 200 + assert second.status_code == 200 + assert first.json() == {"call": 1} + assert second.json() == {"call": 2} + assert calls["post"] == 2 diff --git a/service/src/main/inse/news/logic.py b/service/src/main/inse/news/logic.py index bb423948..659620e8 100644 --- a/service/src/main/inse/news/logic.py +++ b/service/src/main/inse/news/logic.py @@ -12,16 +12,18 @@ from inse.exceptions import ElasticsearchException from ..integrations import elasticsearch, llm from ..persons.logic import find_ude_author_by_name, get_author_name_by_id -from ..topics.logic import vector_search_topics +from ..topics.logic import vector_search_topics_batch from .model import MatchedTopic, MentionedPerson, NewsArticle, NewsArticleDetail, NewsPage logger = logging.getLogger(__name__) -TOPIC_LIMIT = 4 -TOPIC_QUERY_CONTENT_CHARS = 300 TOPIC_NUM_CANDIDATES = 100 TOPIC_SIMILARITY = 0.5 -TOPIC_MATCHES_PER_KEYWORD = 1 + +TOPICS_INDEX = "aktuell_openalex_topics" +TOPICS_INDEX_MAX_PAIRS = 100 + +_SESSION_TOPIC_CACHE: dict[str, list] = {} KEYWORD_LIMIT = 6 KEYWORD_CONTENT_CHARS = 4000 @@ -253,14 +255,14 @@ async def get_news_by_id(news_id: str) -> NewsArticleDetail: source = response.get("_source", {}) relevant, authors, cached_keywords, postproc_id = await _get_postproc_labels(news_id) - keywords = await _get_article_keywords( + keywords, postproc_id = await _get_article_keywords( news_id, postproc_id, cached_keywords, source.get("maintitle"), source.get("full_content"), ) - topics = await _match_topics_for_keywords(keywords) + topics = await _get_article_topics(news_id, keywords) return NewsArticleDetail( id=response.get("_id"), @@ -282,15 +284,15 @@ async def _get_article_keywords( cached_keywords: list, maintitle: str | None, full_content: str | None, -) -> list: +) -> tuple[list, str | None]: if cached_keywords: - return cached_keywords + return cached_keywords, postproc_id text = " ".join( part for part in (maintitle, (full_content or "")[:KEYWORD_CONTENT_CHARS]) if part ).strip() if not text: - return [] + return [], postproc_id raw = await llm.call( system_prompt=KEYWORD_SYSTEM_PROMPT, @@ -300,9 +302,61 @@ async def _get_article_keywords( keywords = _parse_keywords(raw) if keywords: - await _store_keywords(news_id, postproc_id, keywords) + postproc_id = await _store_keywords(news_id, postproc_id, keywords) - return keywords + return keywords, postproc_id + + +async def _get_article_topics(news_id: str, keywords: list) -> list: + indexed = await get_article_topics_from_index(news_id) + if indexed: + return indexed + + if news_id in _SESSION_TOPIC_CACHE: + return _SESSION_TOPIC_CACHE[news_id] + + topics = await _match_topics_for_keywords(keywords) + + if topics: + _SESSION_TOPIC_CACHE[news_id] = topics + + return topics + + +async def get_article_topics_from_index(news_id: str) -> list: + try: + response = await elasticsearch.search( + index=TOPICS_INDEX, + query={"term": {"news_id.keyword": news_id}}, + source=["keyword", "topic_matches"], + size=TOPICS_INDEX_MAX_PAIRS, + cluster="inse", + ) + except Exception: + logger.exception(f"Topic-index lookup for {news_id} failed.") + return [] + + matched = [] + seen_ids = set() + for hit in response.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + keyword = source.get("keyword") + for match in source.get("topic_matches") or []: + topic_id = match.get("topic_id") + if not topic_id or topic_id in seen_ids: + continue + seen_ids.add(topic_id) + matched.append( + MatchedTopic( + id=topic_id, + display_name=match.get("topic_display_name"), + subfield_name=match.get("subfield"), + field_name=match.get("field"), + domain_name=match.get("domain"), + source_keyword=keyword, + ) + ) + return matched def _parse_keywords(raw: str) -> list: @@ -330,7 +384,8 @@ def _parse_keywords(raw: str) -> list: return keywords[:KEYWORD_LIMIT] -async def _store_keywords(news_id: str, postproc_id: str | None, keywords: list) -> None: +async def _store_keywords(news_id: str, postproc_id: str | None, keywords: list) -> str | None: + """Caches the keywords and returns the postproc document id they landed in.""" try: if postproc_id: await elasticsearch.update( @@ -339,42 +394,48 @@ async def _store_keywords(news_id: str, postproc_id: str | None, keywords: list) doc={"keywords": keywords}, cluster="inse", ) - else: - await elasticsearch.index_doc( - index="aktuell_postproc", - doc_id=news_id, - document={"news_id": news_id, "keywords": keywords}, - cluster="inse", - ) + return postproc_id + + await elasticsearch.index_doc( + index="aktuell_postproc", + doc_id=news_id, + document={"news_id": news_id, "keywords": keywords}, + cluster="inse", + ) + return news_id except Exception: logger.exception(f"Failed to cache keywords for {news_id}.") + return postproc_id async def _match_topics_for_keywords(keywords: list) -> list: + if not keywords: + return [] + + try: + response = await vector_search_topics_batch(keywords=keywords) + except Exception: + logger.exception(f"Topic-Matching fuer {len(keywords)} Keywords fehlgeschlagen.") + return [] + matched = [] seen_ids = set() - for keyword in keywords: - try: - response = await vector_search_topics(query=keyword, limit=TOPIC_MATCHES_PER_KEYWORD) - except Exception: - logger.exception(f"Topic-Matching fuer Keyword '{keyword}' fehlgeschlagen.") + for match in response.results or []: + topic = match.topic + if not topic or not topic.id or topic.id in seen_ids: continue - - for topic in response.results or []: - if not topic.id or topic.id in seen_ids: - continue - seen_ids.add(topic.id) - matched.append( - MatchedTopic( - id=topic.id, - display_name=topic.display_name, - subfield_name=topic.subfield.display_name if topic.subfield else None, - field_name=topic.var_field.display_name if topic.var_field else None, - domain_name=topic.domain.display_name if topic.domain else None, - source_keyword=keyword, - ) + seen_ids.add(topic.id) + matched.append( + MatchedTopic( + id=topic.id, + display_name=topic.display_name, + subfield_name=topic.subfield.display_name if topic.subfield else None, + field_name=topic.var_field.display_name if topic.var_field else None, + domain_name=topic.domain.display_name if topic.domain else None, + source_keyword=match.keyword, ) + ) return matched diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 2e264875..3440bd2f 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -23,3 +23,4 @@ class Tags(StrEnum): DFG_INSTITUTIONS = "DFG Institutions" DFG_PERSONS = "DFG Persons" + BACKGROUND_JOBS = "Background Jobs" diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md index dfa7b6e7..2df9da7b 100644 --- a/webapp/src/app/api/README.md +++ b/webapp/src/app/api/README.md @@ -46,10 +46,10 @@ npm link In your project: ```console -npm link +npm link ``` -__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +**Note for Windows users:** The Angular CLI has troubles to use linked npm packages. Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. @@ -58,22 +58,22 @@ Published packages are not effected by this issue. In your Angular project: ```typescript - import { ApplicationConfig } from '@angular/core'; import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi() - ], + providers: [ + // ... + provideHttpClient(), + provideApi(), + ], }; ``` **NOTE** If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: + ```typescript import { ApiModule } from ''; ``` @@ -86,11 +86,11 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi('http://localhost:9999') - ], + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999'), + ], }; ``` @@ -101,15 +101,15 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi({ - withCredentials: true, - username: 'user', - password: 'password' - }) - ], + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password', + }), + ], }; ``` @@ -120,21 +120,22 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi, Configuration } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - { - provide: Configuration, - useFactory: (authService: AuthService) => new Configuration({ - basePath: 'http://localhost:9999', - withCredentials: true, - username: authService.getUsername(), - password: authService.getPassword(), - }), - deps: [AuthService], - multi: false - } - ], + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => + new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false, + }, + ], }; ``` @@ -151,12 +152,12 @@ import { HttpClientModule } from '@angular/common/http'; import { environment } from '../environments/environment'; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideUserApi(environment.basePath), - provideAdminApi(environment.basePath), - ], + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], }; ``` @@ -176,8 +177,8 @@ Example value for use in your Configuration-Provider: ```typescript new Configuration({ - encodeParam: (param: Param) => myFancyParamEncoder(param), -}) + encodeParam: (param: Param) => myFancyParamEncoder(param), +}); ``` [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts index dcf56358..d9ec8f2e 100644 --- a/webapp/src/app/api/api.base.service.ts +++ b/webapp/src/app/api/api.base.service.ts @@ -1,83 +1,109 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, + HttpParameterCodec, +} from '@angular/common/http'; import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:8000'; - public defaultHeaders = new HttpHeaders(); - public configuration: Configuration; - public encoder: HttpParameterCodec; + protected basePath = 'http://localhost:8000'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; - constructor(basePath?: string|string[], configuration?: Configuration) { - this.configuration = configuration || new Configuration(); - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } + constructor(basePath?: string | string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } - protected canConsumeForm(consumes: string[]): boolean { - return consumes.indexOf('multipart/form-data') !== -1; - } + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } - protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { - // If the value is an object (but not a Date), recursively add its keys. - if (typeof value === 'object' && !(value instanceof Date)) { - return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); - } - return this.addToHttpParamsRecursive(httpParams, value, key); + protected addToHttpParams( + httpParams: HttpParams, + value: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive( + httpParams, + value, + isDeep ? key : undefined, + isDeep, + ); } + return this.addToHttpParamsRecursive(httpParams, value, key); + } - protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { - if (value === null || value === undefined) { - return httpParams; - } - if (typeof value === 'object') { - // If JSON format is preferred, key must be provided. - if (key != null) { - return isDeep - ? Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ) - : httpParams.append(key, JSON.stringify(value)); - } - // Otherwise, if it's an array, add each element. - if (Array.isArray(value)) { - value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, value.toISOString()); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach(k => { - const paramKey = key ? `${key}.${k}` : k; - httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); - }); - } - return httpParams; - } else if (key != null) { - return httpParams.append(key, value); - } - throw Error("key may not be null if value is not object or array"); + protected addToHttpParamsRecursive( + httpParams: HttpParams, + value?: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + if (value === null || value === undefined) { + return httpParams; } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach( + (elem) => + (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), + ); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error('key may not be null if value is Date'); + } + } else { + Object.keys(value).forEach((k) => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive( + httpParams, + value[k], + paramKey, + ); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error('key may not be null if value is not object or array'); + } } diff --git a/webapp/src/app/api/api.module.ts b/webapp/src/app/api/api.module.ts index 58d341fb..e29250f2 100644 --- a/webapp/src/app/api/api.module.ts +++ b/webapp/src/app/api/api.module.ts @@ -1,30 +1,42 @@ -import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { + NgModule, + ModuleWithProviders, + SkipSelf, + Optional, +} from '@angular/core'; import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; - @NgModule({ - imports: [], + imports: [], declarations: [], - exports: [], - providers: [] + exports: [], + providers: [], }) export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] - }; - } + public static forRoot( + configurationFactory: () => Configuration, + ): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [{ provide: Configuration, useFactory: configurationFactory }], + }; + } - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { - if (parentModule) { - throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); - } - if (!http) { - throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); - } + constructor( + @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient, + ) { + if (parentModule) { + throw new Error( + 'ApiModule is already loaded. Import in your base AppModule only.', + ); } + if (!http) { + throw new Error( + 'You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575', + ); + } + } } diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index 88d6b87a..bbb6f26d 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -2,6 +2,8 @@ export * from './auth.service'; import { AuthService } from './auth.service'; export * from './authorsV2.service'; import { AuthorsV2Service } from './authorsV2.service'; +export * from './backgroundJobs.service'; +import { BackgroundJobsService } from './backgroundJobs.service'; export * from './bookmarks.service'; import { BookmarksService } from './bookmarks.service'; export * from './companyConnections.service'; @@ -46,4 +48,30 @@ export * from './works.service'; import { WorksService } from './works.service'; export * from './worksV2.service'; import { WorksV2Service } from './worksV2.service'; -export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, RankingService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service]; +export const APIS = [ + AuthService, + AuthorsV2Service, + BackgroundJobsService, + BookmarksService, + CompanyConnectionsService, + DFGInstitutionsService, + DFGPersonsService, + DashboardService, + FundingService, + INSEServiceService, + InstitutionsService, + InstitutionsV2Service, + KeywordsService, + NewsService, + OrganizationService, + PatentsService, + PersonNetworkService, + PersonsService, + ProjectsService, + RankingService, + TopicsService, + TopicsV2Service, + UniversityRankingsService, + WorksService, + WorksV2Service, +]; diff --git a/webapp/src/app/api/api/auth.service.ts b/webapp/src/app/api/api/auth.service.ts index a906d12f..e504fdc9 100644 --- a/webapp/src/app/api/api/auth.service.ts +++ b/webapp/src/app/api/api/auth.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AccessResponse } from '../model/accessResponse'; @@ -50,964 +56,1749 @@ import { OtkResponse } from '../model/otkResponse'; import { UpdateAccountRequest } from '../model/updateAccountRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Change Password + * Change the user\'s password and invalidate existing tokens. + * @endpoint post /api/auth/v2/change-password + * @param bodyChangePassword + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyChangePassword === null || bodyChangePassword === undefined) { + throw new Error( + 'Required parameter bodyChangePassword was null or undefined when calling changePassword.', + ); } - /** - * Change Password - * Change the user\'s password and invalidate existing tokens. - * @endpoint post /api/auth/v2/change-password - * @param bodyChangePassword - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyChangePassword === null || bodyChangePassword === undefined) { - throw new Error('Required parameter bodyChangePassword was null or undefined when calling changePassword.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/change-password`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyChangePassword, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Create Account - * @endpoint post /api/accounts - * @param createAccountRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createAccountRequest === null || createAccountRequest === undefined) { - throw new Error('Required parameter createAccountRequest was null or undefined when calling createAccount.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * Delete Account - * @endpoint delete /api/accounts/{account_id} - * @param accountId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteAccount(accountId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling deleteAccount.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Get Access Token - * Retrieve an access token for the authenticated user. - * @endpoint post /api/auth/v2/access - * @param bodyGetAccessToken - * @param idToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { - throw new Error('Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.'); - } + let localVarPath = `/api/auth/v2/change-password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: bodyChangePassword, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/access`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyGetAccessToken, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Create Account + * @endpoint post /api/accounts + * @param createAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (createAccountRequest === null || createAccountRequest === undefined) { + throw new Error( + 'Required parameter createAccountRequest was null or undefined when calling createAccount.', + ); } - /** - * Get Current Account - * @endpoint get /api/accounts/me - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCurrentAccount(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCurrentAccount(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCurrentAccount(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCurrentAccount(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/me`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Health Check - * @endpoint get /api/auth/v2/health - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public healthCheckApiAuthV2HealthGet(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public healthCheckApiAuthV2HealthGet(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public healthCheckApiAuthV2HealthGet(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public healthCheckApiAuthV2HealthGet(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/health`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * List Organizations - * @endpoint get /api/accounts/organizations - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccountOrganizations(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccountOrganizations(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listAccountOrganizations(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listAccountOrganizations(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * List Accounts - * @endpoint get /api/accounts - * @param page - * @param pageSize - * @param offset - * @param search - * @param organizationId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - offset, 'offset'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - organizationId, 'organization_id'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Delete Account + * @endpoint delete /api/accounts/{account_id} + * @param accountId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (accountId === null || accountId === undefined) { + throw new Error( + 'Required parameter accountId was null or undefined when calling deleteAccount.', + ); } - /** - * Login with One-Time Key - * Login using a one-time key (OTK) sent to the user\'s email. - * @endpoint post /api/auth/v2/login - * @param bodyLogin - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public login(bodyLogin: BodyLogin, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public login(bodyLogin: BodyLogin, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public login(bodyLogin: BodyLogin, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public login(bodyLogin: BodyLogin, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyLogin === null || bodyLogin === undefined) { - throw new Error('Required parameter bodyLogin was null or undefined when calling login.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/login`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyLogin, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Logout - * Logout the authenticated user. - * @endpoint post /api/auth/v2/logout - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public logout(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public logout(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public logout(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public logout(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/logout`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Refresh Access Token - * Refresh the access token using a valid refresh token. - * @endpoint post /api/auth/v2/refresh - * @param refreshToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public refreshAccessToken(refreshToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public refreshAccessToken(refreshToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshAccessToken(refreshToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshAccessToken(refreshToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/refresh`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Get Access Token + * Retrieve an access token for the authenticated user. + * @endpoint post /api/auth/v2/access + * @param bodyGetAccessToken + * @param idToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { + throw new Error( + 'Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.', + ); } - /** - * Request One-Time Key - * Request a one-time key (OTK) for authentication using email and password. - * @endpoint post /api/auth/v2/request-otk - * @param bodyRequestOtk - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyRequestOtk === null || bodyRequestOtk === undefined) { - throw new Error('Required parameter bodyRequestOtk was null or undefined when calling requestOtk.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/request-otk`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyRequestOtk, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Request Password Reset - * Request a one-time password reset link for the given email address. - * @endpoint post /api/auth/v2/request-password-reset - * @param bodyRequestPasswordReset - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyRequestPasswordReset === null || bodyRequestPasswordReset === undefined) { - throw new Error('Required parameter bodyRequestPasswordReset was null or undefined when calling requestPasswordReset.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/request-password-reset`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyRequestPasswordReset, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // 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, + ); } - /** - * Reset Password - * Reset the user\'s password using a one-time password reset token. - * @endpoint post /api/auth/v2/reset-password - * @param bodyResetPassword - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public resetPassword(bodyResetPassword: BodyResetPassword, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyResetPassword === null || bodyResetPassword === undefined) { - throw new Error('Required parameter bodyResetPassword was null or undefined when calling resetPassword.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/reset-password`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyResetPassword, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Update Account - * @endpoint put /api/accounts/{account_id} - * @param accountId - * @param updateAccountRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling updateAccount.'); - } - if (updateAccountRequest === null || updateAccountRequest === undefined) { - throw new Error('Required parameter updateAccountRequest was null or undefined when calling updateAccount.'); - } + let localVarPath = `/api/auth/v2/access`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyGetAccessToken, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Get Current Account + * @endpoint get /api/accounts/me + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCurrentAccount( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/me`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Health Check + * @endpoint get /api/auth/v2/health + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public healthCheckApiAuthV2HealthGet( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public healthCheckApiAuthV2HealthGet( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public healthCheckApiAuthV2HealthGet( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public healthCheckApiAuthV2HealthGet( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/health`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * List Organizations + * @endpoint get /api/accounts/organizations + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse> + >; + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpEvent> + >; + public listAccountOrganizations( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request< + Array + >('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * List Accounts + * @endpoint get /api/accounts + * @param page + * @param pageSize + * @param offset + * @param search + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + offset, + 'offset', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + organizationId, + 'organization_id', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Login with One-Time Key + * Login using a one-time key (OTK) sent to the user\'s email. + * @endpoint post /api/auth/v2/login + * @param bodyLogin + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public login( + bodyLogin: BodyLogin, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public login( + bodyLogin: BodyLogin, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public login( + bodyLogin: BodyLogin, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public login( + bodyLogin: BodyLogin, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyLogin === null || bodyLogin === undefined) { + throw new Error( + 'Required parameter bodyLogin was null or undefined when calling login.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/login`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyLogin, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Logout + * Logout the authenticated user. + * @endpoint post /api/auth/v2/logout + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logout( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public logout( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public logout( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public logout( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/logout`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Refresh Access Token + * Refresh the access token using a valid refresh token. + * @endpoint post /api/auth/v2/refresh + * @param refreshToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public refreshAccessToken( + refreshToken?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public refreshAccessToken( + refreshToken?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public refreshAccessToken( + refreshToken?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public refreshAccessToken( + refreshToken?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/refresh`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Request One-Time Key + * Request a one-time key (OTK) for authentication using email and password. + * @endpoint post /api/auth/v2/request-otk + * @param bodyRequestOtk + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyRequestOtk === null || bodyRequestOtk === undefined) { + throw new Error( + 'Required parameter bodyRequestOtk was null or undefined when calling requestOtk.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/request-otk`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyRequestOtk, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Request Password Reset + * Request a one-time password reset link for the given email address. + * @endpoint post /api/auth/v2/request-password-reset + * @param bodyRequestPasswordReset + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public requestPasswordReset( + bodyRequestPasswordReset: BodyRequestPasswordReset, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public requestPasswordReset( + bodyRequestPasswordReset: BodyRequestPasswordReset, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestPasswordReset( + bodyRequestPasswordReset: BodyRequestPasswordReset, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestPasswordReset( + bodyRequestPasswordReset: BodyRequestPasswordReset, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + bodyRequestPasswordReset === null || + bodyRequestPasswordReset === undefined + ) { + throw new Error( + 'Required parameter bodyRequestPasswordReset was null or undefined when calling requestPasswordReset.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/request-password-reset`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: bodyRequestPasswordReset, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Reset Password + * Reset the user\'s password using a one-time password reset token. + * @endpoint post /api/auth/v2/reset-password + * @param bodyResetPassword + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public resetPassword( + bodyResetPassword: BodyResetPassword, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public resetPassword( + bodyResetPassword: BodyResetPassword, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public resetPassword( + bodyResetPassword: BodyResetPassword, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public resetPassword( + bodyResetPassword: BodyResetPassword, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyResetPassword === null || bodyResetPassword === undefined) { + throw new Error( + 'Required parameter bodyResetPassword was null or undefined when calling resetPassword.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/reset-password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: bodyResetPassword, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Update Account + * @endpoint put /api/accounts/{account_id} + * @param accountId + * @param updateAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (accountId === null || accountId === undefined) { + throw new Error( + 'Required parameter accountId was null or undefined when calling updateAccount.', + ); + } + if (updateAccountRequest === null || updateAccountRequest === undefined) { + throw new Error( + 'Required parameter updateAccountRequest was null or undefined when calling updateAccount.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/authorsV2.service.ts b/webapp/src/app/api/api/authorsV2.service.ts index 867f89cf..c031d014 100644 --- a/webapp/src/app/api/api/authorsV2.service.ts +++ b/webapp/src/app/api/api/authorsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorPage } from '../model/authorPage'; @@ -22,137 +28,231 @@ import { AuthorPage } from '../model/authorPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthorsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of authors for a given search term based on their display name. + * @endpoint get /api/authors/v2/autocomplete/selector + * @param query A search term to filter authors by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteAuthorsForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteAuthorsForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteAuthorsForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteAuthorsForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a paginated list of authors for a given search term based on their display name. - * @endpoint get /api/authors/v2/autocomplete/selector - * @param query A search term to filter authors by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteAuthorsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteAuthorsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteAuthorsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteAuthorsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/authors/v2/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/authors/v2/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a paginated list of authors for a given list of author IDs. + * @endpoint get /api/authors/v2/authors/id + * @param authorIds A list of author IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorsByIds( + authorIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorsByIds( + authorIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorsByIds( + authorIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorsByIds( + authorIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', ); + }); } - /** - * Returns a paginated list of authors for a given list of author IDs. - * @endpoint get /api/authors/v2/authors/id - * @param authorIds A list of author IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorsByIds(authorIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorsByIds(authorIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorsByIds(authorIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorsByIds(authorIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/authors/v2/authors/id`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/authors/v2/authors/id`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + '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/backgroundJobs.service.ts b/webapp/src/app/api/api/backgroundJobs.service.ts new file mode 100644 index 00000000..8df591c2 --- /dev/null +++ b/webapp/src/app/api/api/backgroundJobs.service.ts @@ -0,0 +1,1334 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { AvailableImages } from '../model/availableImages'; +// @ts-ignore +import { BackgroundJobTask } from '../model/backgroundJobTask'; +// @ts-ignore +import { DockerHealth } from '../model/dockerHealth'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { JobDefinitionCreateRequest } from '../model/jobDefinitionCreateRequest'; +// @ts-ignore +import { JobDefinitionUpdateRequest } from '../model/jobDefinitionUpdateRequest'; +// @ts-ignore +import { JobRun } from '../model/jobRun'; +// @ts-ignore +import { JobRunLogs } from '../model/jobRunLogs'; +// @ts-ignore +import { RegistryHealth } from '../model/registryHealth'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class BackgroundJobsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Create Task + * @endpoint post /api/background-jobs/tasks + * @param jobDefinitionCreateRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createBackgroundJobTask( + jobDefinitionCreateRequest: JobDefinitionCreateRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createBackgroundJobTask( + jobDefinitionCreateRequest: JobDefinitionCreateRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createBackgroundJobTask( + jobDefinitionCreateRequest: JobDefinitionCreateRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createBackgroundJobTask( + jobDefinitionCreateRequest: JobDefinitionCreateRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + jobDefinitionCreateRequest === null || + jobDefinitionCreateRequest === undefined + ) { + throw new Error( + 'Required parameter jobDefinitionCreateRequest was null or undefined when calling createBackgroundJobTask.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: jobDefinitionCreateRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Delete Task + * @endpoint delete /api/background-jobs/tasks/{task_id} + * @param taskId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (taskId === null || taskId === undefined) { + throw new Error( + 'Required parameter taskId was null or undefined when calling deleteBackgroundJobTask.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks/${this.configuration.encodeParam({ name: 'taskId', value: taskId, 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, + }, + ); + } + + /** + * Get Run Logs + * @endpoint get /api/background-jobs/runs/{run_id}/logs + * @param runId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobRunLogs( + runId: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getBackgroundJobRunLogs( + runId: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobRunLogs( + runId: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobRunLogs( + runId: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (runId === null || runId === undefined) { + throw new Error( + 'Required parameter runId was null or undefined when calling getBackgroundJobRunLogs.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/runs/${this.configuration.encodeParam({ name: 'runId', value: runId, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}/logs`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Task Runs + * @endpoint get /api/background-jobs/tasks/{task_id}/runs + * @param taskId + * @param limit + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobTaskRuns( + taskId: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobTaskRuns( + taskId: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getBackgroundJobTaskRuns( + taskId: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getBackgroundJobTaskRuns( + taskId: number, + limit?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (taskId === null || taskId === undefined) { + throw new Error( + 'Required parameter taskId was null or undefined when calling getBackgroundJobTaskRuns.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks/${this.configuration.encodeParam({ name: 'taskId', value: taskId, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}/runs`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Tasks + * @endpoint get /api/background-jobs/tasks + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobTasks( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobTasks( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getBackgroundJobTasks( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getBackgroundJobTasks( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Available Images + * @endpoint get /api/background-jobs/available-images + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobAvailableImages( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getBackgroundJobAvailableImages( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobAvailableImages( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobAvailableImages( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/available-images`; + 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, + }, + ); + } + + /** + * Docker Health + * @endpoint get /api/background-jobs/docker-health + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobsDockerHealth( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getBackgroundJobsDockerHealth( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobsDockerHealth( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobsDockerHealth( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/docker-health`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Registry Health + * @endpoint get /api/background-jobs/registry-health + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBackgroundJobsRegistryHealth( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getBackgroundJobsRegistryHealth( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobsRegistryHealth( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getBackgroundJobsRegistryHealth( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/registry-health`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Run Task + * @endpoint post /api/background-jobs/tasks/{task_id}/run + * @param taskId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public runBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public runBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public runBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public runBackgroundJobTask( + taskId: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (taskId === null || taskId === undefined) { + throw new Error( + 'Required parameter taskId was null or undefined when calling runBackgroundJobTask.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks/${this.configuration.encodeParam({ name: 'taskId', value: taskId, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}/run`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Stop Run + * @endpoint post /api/background-jobs/runs/{run_id}/stop + * @param runId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public stopBackgroundJobRun( + runId: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public stopBackgroundJobRun( + runId: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public stopBackgroundJobRun( + runId: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public stopBackgroundJobRun( + runId: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (runId === null || runId === undefined) { + throw new Error( + 'Required parameter runId was null or undefined when calling stopBackgroundJobRun.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/runs/${this.configuration.encodeParam({ name: 'runId', value: runId, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}/stop`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Update Task + * @endpoint patch /api/background-jobs/tasks/{task_id} + * @param taskId + * @param jobDefinitionUpdateRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateBackgroundJobTask( + taskId: number, + jobDefinitionUpdateRequest: JobDefinitionUpdateRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateBackgroundJobTask( + taskId: number, + jobDefinitionUpdateRequest: JobDefinitionUpdateRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateBackgroundJobTask( + taskId: number, + jobDefinitionUpdateRequest: JobDefinitionUpdateRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateBackgroundJobTask( + taskId: number, + jobDefinitionUpdateRequest: JobDefinitionUpdateRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (taskId === null || taskId === undefined) { + throw new Error( + 'Required parameter taskId was null or undefined when calling updateBackgroundJobTask.', + ); + } + if ( + jobDefinitionUpdateRequest === null || + jobDefinitionUpdateRequest === undefined + ) { + throw new Error( + 'Required parameter jobDefinitionUpdateRequest was null or undefined when calling updateBackgroundJobTask.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/background-jobs/tasks/${this.configuration.encodeParam({ name: 'taskId', value: taskId, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'patch', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: jobDefinitionUpdateRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/bookmarks.service.ts b/webapp/src/app/api/api/bookmarks.service.ts index 3e0ec2e8..198f796e 100644 --- a/webapp/src/app/api/api/bookmarks.service.ts +++ b/webapp/src/app/api/api/bookmarks.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreatePersonBookmark } from '../model/createPersonBookmark'; @@ -24,206 +30,375 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBookmarkResponse } from '../model/personBookmarkResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class BookmarksService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Bookmark Person + * @endpoint put /api/bookmarks/persons/{person_id} + * @param personId + * @param createPersonBookmark + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (personId === null || personId === undefined) { + throw new Error( + 'Required parameter personId was null or undefined when calling bookmarkPerson.', + ); + } + if (createPersonBookmark === null || createPersonBookmark === undefined) { + throw new Error( + 'Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.', + ); } - /** - * Bookmark Person - * @endpoint put /api/bookmarks/persons/{person_id} - * @param personId - * @param createPersonBookmark - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (personId === null || personId === undefined) { - throw new Error('Required parameter personId was null or undefined when calling bookmarkPerson.'); - } - if (createPersonBookmark === null || createPersonBookmark === undefined) { - throw new Error('Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createPersonBookmark, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * List Person Bookmarks - * @endpoint get /api/bookmarks/persons - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listPersonBookmarks(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listPersonBookmarks(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listPersonBookmarks(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listPersonBookmarks(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/bookmarks/persons`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * Remove Person Bookmark - * @endpoint delete /api/bookmarks/persons/{person_id} - * @param personId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (personId === null || personId === undefined) { - throw new Error('Required parameter personId was null or undefined when calling removePersonBookmark.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPersonBookmark, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * List Person Bookmarks + * @endpoint get /api/bookmarks/persons + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/bookmarks/persons`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Remove Person Bookmark + * @endpoint delete /api/bookmarks/persons/{person_id} + * @param personId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (personId === null || personId === undefined) { + throw new Error( + 'Required parameter personId was null or undefined when calling removePersonBookmark.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/companyConnections.service.ts b/webapp/src/app/api/api/companyConnections.service.ts index 133e8298..e9018fad 100644 --- a/webapp/src/app/api/api/companyConnections.service.ts +++ b/webapp/src/app/api/api/companyConnections.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CompanyConnectionsAvailability } from '../model/companyConnectionsAvailability'; @@ -24,137 +30,249 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse' import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CompanyConnectionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Check whether company connections are available for an author. + * @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability + * @param authorId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCompanyConnectionsAvailability( + authorId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCompanyConnectionsAvailability( + authorId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsAvailability( + authorId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsAvailability( + authorId: string, + secureFgpAcc?: 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 getCompanyConnectionsAvailability.', + ); } - /** - * Check whether company connections are available for an author. - * @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability - * @param authorId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: 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 getCompanyConnectionsAvailability.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections/availability`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get possible company connections by OpenAlex author ID. - * @endpoint get /api/inse-service/authors/{author_id}/company-connections - * @param authorId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections/availability`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get possible company connections by OpenAlex author ID. + * @endpoint get /api/inse-service/authors/{author_id}/company-connections + * @param authorId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCompanyConnectionsByAuthor( + authorId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCompanyConnectionsByAuthor( + authorId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/dFGInstitutions.service.ts b/webapp/src/app/api/api/dFGInstitutions.service.ts index 2582d69a..811cb490 100644 --- a/webapp/src/app/api/api/dFGInstitutions.service.ts +++ b/webapp/src/app/api/api/dFGInstitutions.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage'; @@ -22,137 +28,231 @@ import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DFGInstitutionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/institutions/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of institutions based on a search term for autocomplete functionality. - * @endpoint get /api/dfg/institutions/autocomplete/selector - * @param query A search term to filter institutions by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/dfg/institutions/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/institutions/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/dfg/institutions/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - /** - * Returns a list of institutions based on their IDs. - * @endpoint get /api/dfg/institutions/ids - * @param institutionIds A list of institution IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/institutions/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/institutions/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + '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/dFGPersons.service.ts b/webapp/src/app/api/api/dFGPersons.service.ts index edfcf946..19c2589a 100644 --- a/webapp/src/app/api/api/dFGPersons.service.ts +++ b/webapp/src/app/api/api/dFGPersons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage'; @@ -22,137 +28,231 @@ import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DFGPersonsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of persons based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/persons/autocomplete/selector + * @param query A search term to filter persons by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of persons based on a search term for autocomplete functionality. - * @endpoint get /api/dfg/persons/autocomplete/selector - * @param query A search term to filter persons by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/dfg/persons/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/persons/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of persons based on their IDs. + * @endpoint get /api/dfg/persons/ids + * @param personIds A list of person IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonsByIds( + personIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (personIds) { + personIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'person_ids', ); + }); } - /** - * Returns a list of persons based on their IDs. - * @endpoint get /api/dfg/persons/ids - * @param personIds A list of person IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgPersonsByIds(personIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgPersonsByIds(personIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonsByIds(personIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonsByIds(personIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (personIds) { - personIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'person_ids'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/persons/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/persons/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + '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/dashboard.service.ts b/webapp/src/app/api/api/dashboard.service.ts index 5bf6b615..247dfab8 100644 --- a/webapp/src/app/api/api/dashboard.service.ts +++ b/webapp/src/app/api/api/dashboard.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DashboardStatisticValue } from '../model/dashboardStatisticValue'; @@ -28,477 +34,897 @@ import { TopAuthorStatistics } from '../model/topAuthorStatistics'; import { TopicHeatmap } from '../model/topicHeatmap'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DashboardService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Dashboard Bmbf Projects + * @endpoint get /api/dashboard/statistics/projects/bmbf + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Bmbf Projects - * @endpoint get /api/dashboard/statistics/projects/bmbf - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/projects/bmbf`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Dfg Projects - * @endpoint get /api/dashboard/statistics/projects/dfg - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardDfgProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/bmbf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Dfg Projects + * @endpoint get /api/dashboard/statistics/projects/dfg + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/projects/dfg`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Eu Projects - * @endpoint get /api/dashboard/statistics/projects/eu - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardEuProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/projects/eu`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Persons - * @endpoint get /api/dashboard/statistics/persons - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardPersons(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardPersons(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPersons(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPersons(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/dfg`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Eu Projects + * @endpoint get /api/dashboard/statistics/projects/eu + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/persons`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Publications - * @endpoint get /api/dashboard/statistics/publications - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardPublications(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardPublications(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPublications(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPublications(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Statistics - * @endpoint get /api/dashboard/statistics - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardStatistics(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardStatistics(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardStatistics(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardStatistics(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Persons + * @endpoint get /api/dashboard/statistics/persons + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardPersons( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardPersons( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPersons( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPersons( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Top Authors - * @endpoint get /api/dashboard/top-authors - * @param worksPeriod - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - worksPeriod, 'works_period'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/top-authors`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Topic Heatmap - * @endpoint get /api/dashboard/topic-heatmap - * @param fromYear - * @param toYear - * @param limit - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/persons`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fromYear, 'from_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - toYear, 'to_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); + /** + * Dashboard Publications + * @endpoint get /api/dashboard/statistics/publications + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardPublications( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardPublications( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPublications( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPublications( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/topic-heatmap`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Dashboard Statistics + * @endpoint get /api/dashboard/statistics + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardStatistics( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Dashboard Top Authors + * @endpoint get /api/dashboard/top-authors + * @param worksPeriod + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + worksPeriod, + 'works_period', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/top-authors`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Dashboard Topic Heatmap + * @endpoint get /api/dashboard/topic-heatmap + * @param fromYear + * @param toYear + * @param limit + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fromYear, + 'from_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + toYear, + 'to_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/topic-heatmap`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts index 46772768..f1f0a1a7 100644 --- a/webapp/src/app/api/api/funding.service.ts +++ b/webapp/src/app/api/api/funding.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; @@ -24,138 +30,246 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class FundingService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get funding organizations by author. + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFundersByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getFundersByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getFundersByAuthor.', + ); } - /** - * Get funding organizations by author. - * @endpoint get /api/inse-service/authors/{author_id}/funders - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get funded publications by author. - * @endpoint get /api/inse-service/authors/{author_id}/publications - * @param authorId - * @param page - * @param pageSize - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funded publications by author. + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPublicationsByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/iNSEService.service.ts b/webapp/src/app/api/api/iNSEService.service.ts index 1149c309..da26fff7 100644 --- a/webapp/src/app/api/api/iNSEService.service.ts +++ b/webapp/src/app/api/api/iNSEService.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,205 +9,355 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class INSEServiceService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + saveJson, + 'save_json', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - saveJson, 'save_json'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy( + topic: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public countTopicHierarchy( + topic: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling countTopicHierarchy.', + ); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); } - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicHierarchy( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/institutions.service.ts b/webapp/src/app/api/api/institutions.service.ts index 641a3b13..b837e00e 100644 --- a/webapp/src/app/api/api/institutions.service.ts +++ b/webapp/src/app/api/api/institutions.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteResponse } from '../model/autocompleteResponse'; @@ -28,295 +34,591 @@ import { InstitutionPage } from '../model/institutionPage'; import { InstitutionsListResponse } from '../model/institutionsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class InstitutionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns institution options for autocomplete inputs. + * @endpoint get /api/inse-service/institutions/autocomplete + * @param query Institution search text, for example \'Duisburg Essen\'. + * @param countryCode Optional ISO country code filter. + * @param type Optional institution type filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling autocompleteInstitutions.', + ); } - /** - * Returns institution options for autocomplete inputs. - * @endpoint get /api/inse-service/institutions/autocomplete - * @param query Institution search text, for example \'Duisburg Essen\'. - * @param countryCode Optional ISO country code filter. - * @param type Optional institution type filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling autocompleteInstitutions.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + countryCode, + 'countryCode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + type, + 'type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - countryCode, 'countryCode'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - type, 'type'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a single institution by ID. - * Returns a single institution by its OpenAlex ID. - * @endpoint get /api/inse-service/institutions/{id} - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionById(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionById(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionById(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionById(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getInstitutionById.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a list of OpenAlex institutions. - * @endpoint get /api/inse-service/institutions - * @param search Full-text search, for example \'Duisburg Essen\'. - * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'country_code\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/inse-service/institutions/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filter, 'filter'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sort, 'sort'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - groupBy, 'group_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - perPage, 'per_page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - cursor, 'cursor'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sample, 'sample'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - select, 'select'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Returns a single institution by ID. + * Returns a single institution by its OpenAlex ID. + * @endpoint get /api/inse-service/institutions/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionById( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionById( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionById( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionById( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getInstitutionById.', + ); } - /** - * Searches for institutions by name. - * Searches for institutions by name with pagination. - * @endpoint get /api/inse-service/institutions/search - * @param name Institution name to search for, for example \'University of Duisburg Essen\'. - * @param page Page number (0-indexed). - * @param size Number of institutions per page. - * @param sortBy Field to sort by, either \'relevance\', \'name\', \'works_count\', or \'citations_count\'. - * @param sortingDirection Sorting direction, either \'asc\' or \'desc\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - name, 'name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortingDirection, 'sorting_direction'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a list of OpenAlex institutions. + * @endpoint get /api/inse-service/institutions + * @param search Full-text search, for example \'Duisburg Essen\'. + * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'country_code\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filter, + 'filter', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + groupBy, + 'group_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + perPage, + 'per_page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + cursor, + 'cursor', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sample, + 'sample', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + select, + 'select', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for institutions by name. + * Searches for institutions by name with pagination. + * @endpoint get /api/inse-service/institutions/search + * @param name Institution name to search for, for example \'University of Duisburg Essen\'. + * @param page Page number (0-indexed). + * @param size Number of institutions per page. + * @param sortBy Field to sort by, either \'relevance\', \'name\', \'works_count\', or \'citations_count\'. + * @param sortingDirection Sorting direction, either \'asc\' or \'desc\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + name, + 'name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortingDirection, + 'sorting_direction', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/institutionsV2.service.ts b/webapp/src/app/api/api/institutionsV2.service.ts index ba8bc1a0..a2007b35 100644 --- a/webapp/src/app/api/api/institutionsV2.service.ts +++ b/webapp/src/app/api/api/institutionsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { InstitutionPageV2 } from '../model/institutionPageV2'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class InstitutionsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/institutions/v2/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of institutions based on a search term for autocomplete functionality. - * @endpoint get /api/institutions/v2/autocomplete/selector - * @param query A search term to filter institutions by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/institutions/v2/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/institutions/v2/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/institutions/v2/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionsByIds( + institutionIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - /** - * Returns a list of institutions based on their IDs. - * @endpoint get /api/institutions/v2/ids - * @param institutionIds A list of institution IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/institutions/v2/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/institutions/v2/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/keywords.service.ts b/webapp/src/app/api/api/keywords.service.ts index fa73019b..6aed478b 100644 --- a/webapp/src/app/api/api/keywords.service.ts +++ b/webapp/src/app/api/api/keywords.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { ExtractedKeywordsResponse } from '../model/extractedKeywordsResponse'; @@ -28,149 +34,250 @@ import { PatentsByKeywordsRequest } from '../model/patentsByKeywordsRequest'; import { PatentsByKeywordsResponse } from '../model/patentsByKeywordsResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class KeywordsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Extracts keywords from text. + * @endpoint post /api/inse-service/keywords/extract + * @param keywordsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public extractKeywords( + keywordsRequest: KeywordsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public extractKeywords( + keywordsRequest: KeywordsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public extractKeywords( + keywordsRequest: KeywordsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public extractKeywords( + keywordsRequest: KeywordsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (keywordsRequest === null || keywordsRequest === undefined) { + throw new Error( + 'Required parameter keywordsRequest was null or undefined when calling extractKeywords.', + ); } - /** - * Extracts keywords from text. - * @endpoint post /api/inse-service/keywords/extract - * @param keywordsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public extractKeywords(keywordsRequest: KeywordsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (keywordsRequest === null || keywordsRequest === undefined) { - throw new Error('Required parameter keywordsRequest was null or undefined when calling extractKeywords.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/keywords/extract`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: keywordsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Find patents matching extracted OpenAlex keywords. - * @endpoint post /api/inse-service/keywords/patents - * @param patentsByKeywordsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (patentsByKeywordsRequest === null || patentsByKeywordsRequest === undefined) { - throw new Error('Required parameter patentsByKeywordsRequest was null or undefined when calling getPatentsByKeywords.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/keywords/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patentsByKeywordsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/keywords/extract`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Find patents matching extracted OpenAlex keywords. + * @endpoint post /api/inse-service/keywords/patents + * @param patentsByKeywordsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByKeywords( + patentsByKeywordsRequest: PatentsByKeywordsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByKeywords( + patentsByKeywordsRequest: PatentsByKeywordsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByKeywords( + patentsByKeywordsRequest: PatentsByKeywordsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByKeywords( + patentsByKeywordsRequest: PatentsByKeywordsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + patentsByKeywordsRequest === null || + patentsByKeywordsRequest === undefined + ) { + throw new Error( + 'Required parameter patentsByKeywordsRequest was null or undefined when calling getPatentsByKeywords.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/keywords/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patentsByKeywordsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/news.service.ts b/webapp/src/app/api/api/news.service.ts index 8ff477cf..eb6e0f11 100644 --- a/webapp/src/app/api/api/news.service.ts +++ b/webapp/src/app/api/api/news.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -24,567 +30,1151 @@ import { NewsArticleDetail } from '../model/newsArticleDetail'; import { NewsPage } from '../model/newsPage'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class NewsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor.', + ); } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'authorId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor_1.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'authorId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsById(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (newsId === null || newsId === undefined) { - throw new Error('Required parameter newsId was null or undefined when calling getNewsById.'); - } + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor_1.', + ); } - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById_2(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsById_2(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById_2(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById_2(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (newsId === null || newsId === undefined) { - throw new Error('Required parameter newsId was null or undefined when calling getNewsById_2.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById.', + ); } - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling searchNews.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling searchNews_4.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById_2( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById_2( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById_2.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews_4.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/organization.service.ts b/webapp/src/app/api/api/organization.service.ts index 14fb942d..4315e7c1 100644 --- a/webapp/src/app/api/api/organization.service.ts +++ b/webapp/src/app/api/api/organization.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreateOrganizationRequest } from '../model/createOrganizationRequest'; @@ -28,287 +34,545 @@ import { OrganizationPage } from '../model/organizationPage'; import { UpdateOrganizationRequest } from '../model/updateOrganizationRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class OrganizationService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Create Organization + * @endpoint post /api/organizations + * @param createOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse + >; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + createOrganizationRequest === null || + createOrganizationRequest === undefined + ) { + throw new Error( + 'Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.', + ); } - /** - * Create Organization - * @endpoint post /api/organizations - * @param createOrganizationRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createOrganizationRequest === null || createOrganizationRequest === undefined) { - throw new Error('Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Delete Organization - * @endpoint delete /api/organizations/{organization_id} - * @param organizationId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganisation.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * Get Organizations - * @endpoint get /api/organizations - * @param page - * @param pageSize - * @param offset - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - offset, 'offset'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Update Organization - * @endpoint put /api/organizations/{organization_id} - * @param organizationId - * @param updateOrganizationRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error('Required parameter organizationId was null or undefined when calling updateOrganisation.'); - } - if (updateOrganizationRequest === null || updateOrganizationRequest === undefined) { - throw new Error('Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.'); - } + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Delete Organization + * @endpoint delete /api/organizations/{organization_id} + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error( + 'Required parameter organizationId was null or undefined when calling deleteOrganisation.', + ); } + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Organizations + * @endpoint get /api/organizations + * @param page + * @param pageSize + * @param offset + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + offset, + 'offset', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Update Organization + * @endpoint put /api/organizations/{organization_id} + * @param organizationId + * @param updateOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse + >; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error( + 'Required parameter organizationId was null or undefined when calling updateOrganisation.', + ); + } + if ( + updateOrganizationRequest === null || + updateOrganizationRequest === undefined + ) { + throw new Error( + 'Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index c3f30c46..1694be0b 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AllPatentsResponse } from '../model/allPatentsResponse'; @@ -32,396 +38,769 @@ import { PatentsByInstitutionResponse } from '../model/patentsByInstitutionRespo import { RebuildResponse } from '../model/rebuildResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PatentsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get all patents with pagination and search. + * @endpoint get /api/inse-service/patents + * @param page + * @param size + * @param search + * @param source + * @param sortBy + * @param sortDirection + * @param yearFrom + * @param yearTo + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + source, + 'source', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'year_from', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'year_to', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get all patents with pagination and search. - * @endpoint get /api/inse-service/patents - * @param page - * @param size - * @param search - * @param source - * @param sortBy - * @param sortDirection - * @param yearFrom - * @param yearTo - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - source, 'source'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortDirection, 'sort_direction'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'year_from'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'year_to'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Get pre-indexed org patents for an institution. - * @endpoint get /api/inse-service/institutions/{id}/org-patents - * @param id - * @param matchType Filter patents by match type. - * @param page - * @param size - * @param source - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getOrgPatentsByInstitution.'); - } + let localVarPath = `/api/inse-service/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - matchType, 'match_type'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - source, 'source'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Get pre-indexed org patents for an institution. + * @endpoint get /api/inse-service/institutions/{id}/org-patents + * @param id + * @param matchType Filter patents by match type. + * @param page + * @param size + * @param source + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getOrgPatentsByInstitution.', + ); } - /** - * Get a single patent by identifier with optional title fallback. - * @endpoint get /api/inse-service/patents/{identifier} - * @param identifier - * @param prefix - * @param title - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + matchType, + 'match_type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + source, + 'source', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - prefix, 'prefix'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get patents matched to an author by name. - * @endpoint get /api/inse-service/authors/{author_id}/patents - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPatentsByAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Get patents matched to an institution by assignee name. - * @endpoint get /api/inse-service/institutions/{id}/patents - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByInstitution(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentsByInstitution(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByInstitution(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByInstitution(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPatentsByInstitution.'); - } + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Get a single patent by identifier with optional title fallback. + * @endpoint get /api/inse-service/patents/{identifier} + * @param identifier + * @param prefix + * @param title + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.', + ); } - /** - * Trigger a background rebuild of the org_patents index for an institution. - * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public rebuildOrgPatents(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public rebuildOrgPatents(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public rebuildOrgPatents(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public rebuildOrgPatents(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling rebuildOrgPatents.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + prefix, + 'prefix', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents/rebuild`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an institution by assignee name. + * @endpoint get /api/inse-service/institutions/{id}/patents + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByInstitution( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByInstitution( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByInstitution( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByInstitution( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPatentsByInstitution.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Trigger a background rebuild of the org_patents index for an institution. + * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public rebuildOrgPatents( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public rebuildOrgPatents( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rebuildOrgPatents( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rebuildOrgPatents( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling rebuildOrgPatents.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents/rebuild`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/personNetwork.service.ts index b1183ff6..5b468938 100644 --- a/webapp/src/app/api/api/personNetwork.service.ts +++ b/webapp/src/app/api/api/personNetwork.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CollaborationNetwork } from '../model/collaborationNetwork'; @@ -24,86 +30,139 @@ import { FilterProperties } from '../model/filterProperties'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PersonNetworkService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawUserId === null || rawUserId === undefined) { + throw new Error( + 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', + ); } - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: filterProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index fe6947f6..2dd47272 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorsListResponse } from '../model/authorsListResponse'; @@ -26,725 +32,1449 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBio } from '../model/personBio'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PersonsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Generates a bio for a person by author ID. + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling generatePersonBio.', + ); } - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/inse-service/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID.', + ); + } - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID_1( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID_1.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName_3( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName_3( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_3( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_3( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName_3.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName_3.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionId Filter by OpenAlex institution ID + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param yearFilterEnabled Apply the selected affiliation year rule + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionId, + 'institutionId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFilterEnabled, + 'yearFilterEnabled', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionId Filter by OpenAlex institution ID + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param yearFilterEnabled Apply the selected affiliation year rule + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList_4( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList_4( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_4( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_4( + query?: string, + institutionId?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + yearFilterEnabled?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionId, + 'institutionId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFilterEnabled, + 'yearFilterEnabled', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID_1(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID_1(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID_1(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID_1(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID_1.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName_3(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName_3(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName_3(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName_3(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName_3.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName_3.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionId Filter by OpenAlex institution ID - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param yearFilterEnabled Apply the selected affiliation year rule - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionId, 'institutionId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sortBy'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFilterEnabled, 'yearFilterEnabled'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterMode, 'filterMode'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterYear, 'filterYear'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionId Filter by OpenAlex institution ID - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param yearFilterEnabled Apply the selected affiliation year rule - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList_4(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList_4(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList_4(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList_4(query?: string, institutionId?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, yearFilterEnabled?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionId, 'institutionId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sortBy'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFilterEnabled, 'yearFilterEnabled'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterMode, 'filterMode'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterYear, 'filterYear'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/ranking.service.ts b/webapp/src/app/api/api/ranking.service.ts index ccfa74ad..f6f99a28 100644 --- a/webapp/src/app/api/api/ranking.service.ts +++ b/webapp/src/app/api/api/ranking.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorMetricsRequest } from '../model/authorMetricsRequest'; @@ -34,283 +40,497 @@ import { RankedAuthor } from '../model/rankedAuthor'; import { SelectedAuthorsRequest } from '../model/selectedAuthorsRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class RankingService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Rank Author + * @endpoint post /api/rank/rank-author + * @param keywordToAuthorRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public rankAuthorApiRankRankAuthorPost( + keywordToAuthorRequest: KeywordToAuthorRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rankAuthorApiRankRankAuthorPost( + keywordToAuthorRequest: KeywordToAuthorRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public rankAuthorApiRankRankAuthorPost( + keywordToAuthorRequest: KeywordToAuthorRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public rankAuthorApiRankRankAuthorPost( + keywordToAuthorRequest: KeywordToAuthorRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + keywordToAuthorRequest === null || + keywordToAuthorRequest === undefined + ) { + throw new Error( + 'Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthorApiRankRankAuthorPost.', + ); } - /** - * Rank Author - * @endpoint post /api/rank/rank-author - * @param keywordToAuthorRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public rankAuthorApiRankRankAuthorPost(keywordToAuthorRequest: KeywordToAuthorRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (keywordToAuthorRequest === null || keywordToAuthorRequest === undefined) { - throw new Error('Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthorApiRankRankAuthorPost.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/rank/rank-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: keywordToAuthorRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Static Stats - * @endpoint post /api/rank/static-stats - * @param authorMetricsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public staticStatsApiRankStaticStatsPost(authorMetricsRequest: AuthorMetricsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorMetricsRequest === null || authorMetricsRequest === undefined) { - throw new Error('Required parameter authorMetricsRequest was null or undefined when calling staticStatsApiRankStaticStatsPost.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/rank/static-stats`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: authorMetricsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * Topic Profile - * @endpoint post /api/rank/topic-profile - * @param selectedAuthorsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public topicProfileApiRankTopicProfilePost(selectedAuthorsRequest: SelectedAuthorsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (selectedAuthorsRequest === null || selectedAuthorsRequest === undefined) { - throw new Error('Required parameter selectedAuthorsRequest was null or undefined when calling topicProfileApiRankTopicProfilePost.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/rank/topic-profile`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: selectedAuthorsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Topic Stats - * @endpoint post /api/rank/topic-stats - * @param selectedAuthorsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public topicStatsApiRankTopicStatsPost(selectedAuthorsRequest: SelectedAuthorsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (selectedAuthorsRequest === null || selectedAuthorsRequest === undefined) { - throw new Error('Required parameter selectedAuthorsRequest was null or undefined when calling topicStatsApiRankTopicStatsPost.'); - } + let localVarPath = `/api/rank/rank-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordToAuthorRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/rank/topic-stats`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: selectedAuthorsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Static Stats + * @endpoint post /api/rank/static-stats + * @param authorMetricsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public staticStatsApiRankStaticStatsPost( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public staticStatsApiRankStaticStatsPost( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public staticStatsApiRankStaticStatsPost( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public staticStatsApiRankStaticStatsPost( + authorMetricsRequest: AuthorMetricsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorMetricsRequest === null || authorMetricsRequest === undefined) { + throw new Error( + 'Required parameter authorMetricsRequest was null or undefined when calling staticStatsApiRankStaticStatsPost.', + ); } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/rank/static-stats`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: authorMetricsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Topic Profile + * @endpoint post /api/rank/topic-profile + * @param selectedAuthorsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public topicProfileApiRankTopicProfilePost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public topicProfileApiRankTopicProfilePost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicProfileApiRankTopicProfilePost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicProfileApiRankTopicProfilePost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + selectedAuthorsRequest === null || + selectedAuthorsRequest === undefined + ) { + throw new Error( + 'Required parameter selectedAuthorsRequest was null or undefined when calling topicProfileApiRankTopicProfilePost.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/rank/topic-profile`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: selectedAuthorsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Topic Stats + * @endpoint post /api/rank/topic-stats + * @param selectedAuthorsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public topicStatsApiRankTopicStatsPost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public topicStatsApiRankTopicStatsPost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicStatsApiRankTopicStatsPost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicStatsApiRankTopicStatsPost( + selectedAuthorsRequest: SelectedAuthorsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + selectedAuthorsRequest === null || + selectedAuthorsRequest === undefined + ) { + throw new Error( + 'Required parameter selectedAuthorsRequest was null or undefined when calling topicStatsApiRankTopicStatsPost.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/rank/topic-stats`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: selectedAuthorsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index ef7b0c7f..5a51e233 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteResponse } from '../model/autocompleteResponse'; @@ -28,484 +34,929 @@ import { KeywordsTopicsResponse } from '../model/keywordsTopicsResponse'; import { TopicsListResponse } from '../model/topicsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class TopicsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns topic options for autocomplete inputs. + * @endpoint get /api/topics/autocomplete + * @param query Topic search text, for example \'machine learning\'. + * @param domainId Optional OpenAlex domain id filter. + * @param fieldId Optional OpenAlex field id filter. + * @param subfieldId Optional OpenAlex subfield id filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling autocompleteTopics.', + ); } - /** - * Returns topic options for autocomplete inputs. - * @endpoint get /api/topics/autocomplete - * @param query Topic search text, for example \'machine learning\'. - * @param domainId Optional OpenAlex domain id filter. - * @param fieldId Optional OpenAlex field id filter. - * @param subfieldId Optional OpenAlex subfield id filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling autocompleteTopics.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + domainId, + 'domainId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fieldId, + 'fieldId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + subfieldId, + 'subfieldId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - domainId, 'domainId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fieldId, 'fieldId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - subfieldId, 'subfieldId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/topics/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + saveJson, + 'save_json', + ); - let localVarPath = `/api/topics/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy( + topic: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public countTopicHierarchy( + topic: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling countTopicHierarchy.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - saveJson, 'save_json'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicHierarchy( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of OpenAlex topics. - * @endpoint get /api/topics - * @param search Full-text search, for example \'machine learning\'. - * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'domain.id\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filter, 'filter'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sort, 'sort'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - groupBy, 'group_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - perPage, 'per_page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - cursor, 'cursor'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sample, 'sample'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - select, 'select'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Semantic / vector search for topics using a keyword/sentence. - * @endpoint get /api/topics/vector-search - * @param query Word or sentence to search by similarity. - * @param limit Maximum number of topics to return. - * @param searchType Search approach: \'hybrid\' or \'semantic\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling vectorSearchTopics.'); - } + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'searchType'); + /** + * Returns a list of OpenAlex topics. + * @endpoint get /api/topics + * @param search Full-text search, for example \'machine learning\'. + * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'domain.id\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filter, + 'filter', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + groupBy, + 'group_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + perPage, + 'per_page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + cursor, + 'cursor', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sample, + 'sample', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + select, + 'select', + ); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/vector-search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Batch semantic / vector search for multiple keywords. - * @endpoint post /api/topics/vector-search/batch - * @param keywordsTopicsRequest - * @param searchType Search approach: \'hybrid\' or \'semantic\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (keywordsTopicsRequest === null || keywordsTopicsRequest === undefined) { - throw new Error('Required parameter keywordsTopicsRequest was null or undefined when calling vectorSearchTopicsBatch.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'searchType'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/vector-search/batch`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: keywordsTopicsRequest, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Semantic / vector search for topics using a keyword/sentence. + * @endpoint get /api/topics/vector-search + * @param query Word or sentence to search by similarity. + * @param limit Maximum number of topics to return. + * @param searchType Search approach: \'hybrid\' or \'semantic\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling vectorSearchTopics.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'searchType', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Batch semantic / vector search for multiple keywords. + * @endpoint post /api/topics/vector-search/batch + * @param keywordsTopicsRequest + * @param searchType Search approach: \'hybrid\' or \'semantic\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopicsBatch( + keywordsTopicsRequest: KeywordsTopicsRequest, + searchType?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public vectorSearchTopicsBatch( + keywordsTopicsRequest: KeywordsTopicsRequest, + searchType?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopicsBatch( + keywordsTopicsRequest: KeywordsTopicsRequest, + searchType?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopicsBatch( + keywordsTopicsRequest: KeywordsTopicsRequest, + searchType?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (keywordsTopicsRequest === null || keywordsTopicsRequest === undefined) { + throw new Error( + 'Required parameter keywordsTopicsRequest was null or undefined when calling vectorSearchTopicsBatch.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'searchType', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search/batch`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordsTopicsRequest, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/topicsV2.service.ts b/webapp/src/app/api/api/topicsV2.service.ts index 92f5b93f..be3be9da 100644 --- a/webapp/src/app/api/api/topicsV2.service.ts +++ b/webapp/src/app/api/api/topicsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { TopicPageV2 } from '../model/topicPageV2'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class TopicsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of topics for a given search term based on their display name. + * @endpoint get /api/topics/v2/autocomplete/selector + * @param query A search term to filter topics by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopicsForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteTopicsForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopicsForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopicsForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a paginated list of topics for a given search term based on their display name. - * @endpoint get /api/topics/v2/autocomplete/selector - * @param query A search term to filter topics by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteTopicsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteTopicsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopicsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopicsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/topics/v2/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/v2/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a paginated list of topics for a given list of topic IDs. + * @endpoint get /api/topics/v2/topics/id + * @param topicIds A list of topic IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByIds( + topicIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicsByIds( + topicIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByIds( + topicIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByIds( + topicIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', ); + }); } - /** - * Returns a paginated list of topics for a given list of topic IDs. - * @endpoint get /api/topics/v2/topics/id - * @param topicIds A list of topic IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByIds(topicIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicsByIds(topicIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByIds(topicIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByIds(topicIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/v2/topics/id`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/v2/topics/id`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/universityRankings.service.ts b/webapp/src/app/api/api/universityRankings.service.ts index 82bcee4c..a7aba880 100644 --- a/webapp/src/app/api/api/universityRankings.service.ts +++ b/webapp/src/app/api/api/universityRankings.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteLocationItem } from '../model/autocompleteLocationItem'; @@ -32,391 +38,748 @@ import { TrendResponse } from '../model/trendResponse'; import { TrendSearchType } from '../model/trendSearchType'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class UniversityRankingsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns country and continent options for autocomplete inputs. + * @endpoint get /api/inse-service/university-rankings/autocomplete-locations + * @param query Query text to search for countries/continents + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.', + ); } - /** - * Returns country and continent options for autocomplete inputs. - * @endpoint get /api/inse-service/university-rankings/autocomplete-locations - * @param query Query text to search for countries/continents - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Returns data for the University Ranking Dashboard. + * @endpoint get /api/inse-service/university-rankings + * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') + * @param metric Metric to rank by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.', + ); + } - let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + metric, + 'metric', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns top institutions filtered by country/region and sorted by topic-level publications count. + * @endpoint get /api/inse-service/university-rankings/top-institutions + * @param topic Research topic + * @param region Region identifier (e.g. EU) + * @param country Country code (e.g. DE) + * @param limit Max suggestions to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + region, + 'region', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + country, + 'country', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns top 10 research topics for a selected entity. + * @endpoint get /api/inse-service/university-rankings/top-topics + * @param entityId Entity ID + * @param entityType Entity type: institution, author, country, region + * @param startYear Start year + * @param endYear End year + * @param searchType Search strategy type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (entityId === null || entityId === undefined) { + throw new Error( + 'Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', + ); + } + if (entityType === null || entityType === undefined) { + throw new Error( + 'Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + entityId, + 'entity_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + entityType, + 'entity_type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + startYear, + 'start_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + endYear, + 'end_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'search_type', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns timeseries publication data for compared institutions, countries, and regions. + * @endpoint get /api/inse-service/university-rankings/trend + * @param topics List of topics to analyze + * @param keywords List of raw keywords corresponding to topics + * @param fuzzy True if using mapped topics, False if using raw keywords + * @param institutions List of OpenAlex Institution IDs + * @param countries List of country codes + * @param regions List of region identifiers + * @param authors List of OpenAlex Author IDs + * @param searchType + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topics === null || topics === undefined) { + throw new Error( + 'Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topics', ); + }); } - - /** - * Returns data for the University Ranking Dashboard. - * @endpoint get /api/inse-service/university-rankings - * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') - * @param metric Metric to rank by - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - topic, 'topic'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - metric, 'metric'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'keywords', ); + }); } - - /** - * Returns top institutions filtered by country/region and sorted by topic-level publications count. - * @endpoint get /api/inse-service/university-rankings/top-institutions - * @param topic Research topic - * @param region Region identifier (e.g. EU) - * @param country Country code (e.g. DE) - * @param limit Max suggestions to return - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - topic, 'topic'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - region, 'region'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - country, 'country'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-institutions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fuzzy, + 'fuzzy', + ); + if (institutions) { + institutions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institutions', ); + }); } - - /** - * Returns top 10 research topics for a selected entity. - * @endpoint get /api/inse-service/university-rankings/top-topics - * @param entityId Entity ID - * @param entityType Entity type: institution, author, country, region - * @param startYear Start year - * @param endYear End year - * @param searchType Search strategy type - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (entityId === null || entityId === undefined) { - throw new Error('Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); - } - if (entityType === null || entityType === undefined) { - throw new Error('Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - entityId, 'entity_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - entityType, 'entity_type'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - startYear, 'start_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - endYear, 'end_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'search_type'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-topics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (countries) { + countries.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'countries', ); + }); } - - /** - * Returns timeseries publication data for compared institutions, countries, and regions. - * @endpoint get /api/inse-service/university-rankings/trend - * @param topics List of topics to analyze - * @param keywords List of raw keywords corresponding to topics - * @param fuzzy True if using mapped topics, False if using raw keywords - * @param institutions List of OpenAlex Institution IDs - * @param countries List of country codes - * @param regions List of region identifiers - * @param authors List of OpenAlex Author IDs - * @param searchType - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topics === null || topics === undefined) { - throw new Error('Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topics'); - }) - } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'keywords'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fuzzy, 'fuzzy'); - if (institutions) { - institutions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institutions'); - }) - } - if (countries) { - countries.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'countries'); - }) - } - if (regions) { - regions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'regions'); - }) - } - if (authors) { - authors.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'authors'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'search_type'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/trend`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (regions) { + regions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'regions', ); + }); + } + if (authors) { + authors.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'authors', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'search_type', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/trend`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 186ae663..4561cb78 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -30,359 +36,674 @@ import { WorkPage } from '../model/workPage'; import { WorksListResponse } from '../model/worksListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class WorksService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns all works for an author. + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllAuthorWorks( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllAuthorWorks( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAllAuthorWorks.', + ); } - /** - * Returns all works for an author. - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/all`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Returns a page of works for an author. + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + * @param institutionId Filter by OpenAlex institution id. Can be repeated. + * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param sort Sort order: by publication year or by citation count. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAuthorWorks.', + ); + } - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_year', ); + }); } - - /** - * Returns a page of works for an author. - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - * @param sort Sort order: by publication year or by citation count. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); - }) - } - if (type) { - type.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'type'); - }) - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); - }) - } - if (institutionId) { - institutionId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_id'); - }) - } - if (topicId) { - topicId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_id'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sort, 'sort'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (type) { + type.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'type', ); + }); } - - /** - * Returns work counts per primary topic for an author. - * @endpoint get /api/works/{author_id}/primary-topic-counts - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-topic-counts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language', ); + }); } - - /** - * Returns topics grouped by publication year for an author. - * @endpoint get /api/works/{author_id}/topics-by-time - * @param authorId The author id, for example A5023888391. - * @param maxTopicsPerYear The maximum number of topics per year. - * @param targetPublications Target number of publications used for the timeline. Complete years are always included. - * @param includeAll If true, all publications are used for the timeline. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - maxTopicsPerYear, 'max_topics_per_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - targetPublications, 'target_publications'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - includeAll, 'include_all'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (institutionId) { + institutionId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_id', ); + }); } - - /** - * Returns one publication by OpenAlex ID or DOI. - * @endpoint get /api/works/detail/{identifier} - * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. - * @param title Do we want to fallback to title search if ID and DOI dont work? - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWork(identifier: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWork(identifier: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWork(identifier: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWork(identifier: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getWork.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/detail/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (topicId) { + topicId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_id', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns work counts per primary topic for an author. + * @endpoint get /api/works/{author_id}/primary-topic-counts + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-topic-counts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param targetPublications Target number of publications used for the timeline. Complete years are always included. + * @param includeAll If true, all publications are used for the timeline. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + maxTopicsPerYear, + 'max_topics_per_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + targetPublications, + 'target_publications', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + includeAll, + 'include_all', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/works/detail/{identifier} + * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. + * @param title Do we want to fallback to title search if ID and DOI dont work? + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWork( + identifier: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWork( + identifier: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + identifier: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + identifier: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getWork.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } } diff --git a/webapp/src/app/api/api/worksV2.service.ts b/webapp/src/app/api/api/worksV2.service.ts index 1eceeb9d..24bb3cd8 100644 --- a/webapp/src/app/api/api/worksV2.service.ts +++ b/webapp/src/app/api/api/worksV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -32,642 +38,1301 @@ import { WorkPageV2 } from '../model/workPageV2'; import { WorkSortBy } from '../model/workSortBy'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class WorksV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of works for a given author based on their ID. + * @endpoint get /api/works/v2/author/{raw_oa_author_id} + * @param rawOaAuthorId The raw OpenAlex author id. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param title A title to filter by (partial matches allowed). + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.', + ); } - /** - * Returns a paginated list of works for a given author based on their ID. - * @endpoint get /api/works/v2/author/{raw_oa_author_id} - * @param rawOaAuthorId The raw OpenAlex author id. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param title A title to filter by (partial matches allowed). - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_years'); - }) - } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_types'); - }) - } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language_codes'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_years', ); + }); } - - /** - * Returns a paginated list of works for a given institution based on their ID. - * @endpoint get /api/works/v2/institution/{raw_oa_institution_id} - * @param rawOaInstitutionId The raw OpenAlex institution id. - * @param page The page number to retrieve. (0-based) - * @param title A title to filter by (partial matches allowed). - * @param size The number of works to retrieve per page. - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param authorIds A list of author IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_years'); - }) - } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_types'); - }) - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language_codes'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_types', ); + }); } - - /** - * Returns the primary category aggregations of works for a given author based on their ID - * @endpoint get /api/works/v2/author/{raw_oa_author_id}/primary-category-aggregations - * @param rawOaAuthorId The raw OpenAlex author id. - * @param yearSize The number of years to retrieve aggregations for. - * @param categorySize The number of categories to retrieve aggregations for. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getPrimaryCategoryAggregationsByAuthorId.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearSize, 'year_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - categorySize, 'category_size'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - - /** - * Returns the primary category aggregations of works for a given institution based on their ID. - * @endpoint get /api/works/v2/institution/{raw_oa_institution_id}/primary-category-aggregations - * @param rawOaInstitutionId The raw OpenAlex institution id. - * @param yearSize The number of years to retrieve aggregations for. - * @param categorySize The number of categories to retrieve aggregations for. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getPrimaryCategoryAggregationsByInstitutionId.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearSize, 'year_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - categorySize, 'category_size'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', ); + }); } - - /** - * Returns the classifications of a work based on its ID. - * @endpoint get /api/works/v2/classification/work/{raw_oa_work_id} - * @param rawOaWorkId The raw OpenAlex work id. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaWorkId === null || rawOaWorkId === undefined) { - throw new Error('Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/classification/work/${this.configuration.encodeParam({name: "rawOaWorkId", value: rawOaWorkId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language_codes', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns the classifications of works based on their IDs. - * @endpoint get /api/works/v2/classification/works/search - * @param workIds A list of OpenAlex work IDs to retrieve classifications for. - * @param rawOaAuthorId The raw OpenAlex author id to filter by. - * @param rawOaInstitutionId The raw OpenAlex institution id to filter by. - * @param page The page number to retrieve. (0-based) - * @param size The number of classifications to retrieve per page. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkClassificationsByWorkIds(workIds?: Array, rawOaAuthorId?: string, rawOaInstitutionId?: string, page?: number, size?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorkClassificationsByWorkIds(workIds?: Array, rawOaAuthorId?: string, rawOaInstitutionId?: string, page?: number, size?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationsByWorkIds(workIds?: Array, rawOaAuthorId?: string, rawOaInstitutionId?: string, page?: number, size?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationsByWorkIds(workIds?: Array, rawOaAuthorId?: string, rawOaInstitutionId?: string, page?: number, size?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (workIds) { - workIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'work_ids'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - rawOaAuthorId, 'raw_oa_author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - rawOaInstitutionId, 'raw_oa_institution_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + let localVarPath = `/api/works/v2/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + /** + * Returns a paginated list of works for a given institution based on their ID. + * @endpoint get /api/works/v2/institution/{raw_oa_institution_id} + * @param rawOaInstitutionId The raw OpenAlex institution id. + * @param page The page number to retrieve. (0-based) + * @param title A title to filter by (partial matches allowed). + * @param size The number of works to retrieve per page. + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param authorIds A list of author IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.', + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/classification/works/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_years', ); + }); } - - /** - * Search works by topics or raw keywords with filters. - * @endpoint get /api/works/v2/keyword/search - * @param topics List of topics to match. - * @param topicIds List of topic IDs to match. - * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. - * @param keywords Raw keywords to search in title/abstract. - * @param fuzzy Use topic resolution if True, otherwise use raw keywords. - * @param publicationYear A list of publication years to filter by. - * @param publicationType A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param authorIds A list of author IDs to filter by. - * @param language A list of language codes to filter by. - * @param title Title to search for in works. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topics'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (filterTopicIds) { - filterTopicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'filter_topic_ids'); - }) - } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'keywords'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fuzzy, 'fuzzy'); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); - }) - } - if (publicationType) { - publicationType.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_type'); - }) - } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/v2/keyword/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 - } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_types', ); + }); + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', + ); + }); + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', + ); + }); + } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language_codes', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the primary category aggregations of works for a given author based on their ID + * @endpoint get /api/works/v2/author/{raw_oa_author_id}/primary-category-aggregations + * @param rawOaAuthorId The raw OpenAlex author id. + * @param yearSize The number of years to retrieve aggregations for. + * @param categorySize The number of categories to retrieve aggregations for. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getPrimaryCategoryAggregationsByAuthorId.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearSize, + 'year_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + categorySize, + 'category_size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-category-aggregations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the primary category aggregations of works for a given institution based on their ID. + * @endpoint get /api/works/v2/institution/{raw_oa_institution_id}/primary-category-aggregations + * @param rawOaInstitutionId The raw OpenAlex institution id. + * @param yearSize The number of years to retrieve aggregations for. + * @param categorySize The number of categories to retrieve aggregations for. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getPrimaryCategoryAggregationsByInstitutionId.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearSize, + 'year_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + categorySize, + 'category_size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-category-aggregations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the classifications of a work based on its ID. + * @endpoint get /api/works/v2/classification/work/{raw_oa_work_id} + * @param rawOaWorkId The raw OpenAlex work id. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaWorkId === null || rawOaWorkId === undefined) { + throw new Error( + 'Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/classification/work/${this.configuration.encodeParam({ name: 'rawOaWorkId', value: rawOaWorkId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the classifications of works based on their IDs. + * @endpoint get /api/works/v2/classification/works/search + * @param workIds A list of OpenAlex work IDs to retrieve classifications for. + * @param rawOaAuthorId The raw OpenAlex author id to filter by. + * @param rawOaInstitutionId The raw OpenAlex institution id to filter by. + * @param page The page number to retrieve. (0-based) + * @param size The number of classifications to retrieve per page. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationsByWorkIds( + workIds?: Array, + rawOaAuthorId?: string, + rawOaInstitutionId?: string, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorkClassificationsByWorkIds( + workIds?: Array, + rawOaAuthorId?: string, + rawOaInstitutionId?: string, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByWorkIds( + workIds?: Array, + rawOaAuthorId?: string, + rawOaInstitutionId?: string, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByWorkIds( + workIds?: Array, + rawOaAuthorId?: string, + rawOaInstitutionId?: string, + page?: number, + size?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (workIds) { + workIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'work_ids', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaAuthorId, + 'raw_oa_author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaInstitutionId, + 'raw_oa_institution_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/classification/works/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Search works by topics or raw keywords with filters. + * @endpoint get /api/works/v2/keyword/search + * @param topics List of topics to match. + * @param topicIds List of topic IDs to match. + * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. + * @param keywords Raw keywords to search in title/abstract. + * @param fuzzy Use topic resolution if True, otherwise use raw keywords. + * @param publicationYear A list of publication years to filter by. + * @param publicationType A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param authorIds A list of author IDs to filter by. + * @param language A list of language codes to filter by. + * @param title Title to search for in works. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topics', + ); + }); + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', + ); + }); + } + if (filterTopicIds) { + filterTopicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'filter_topic_ids', + ); + }); + } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'keywords', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fuzzy, + 'fuzzy', + ); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_year', + ); + }); + } + if (publicationType) { + publicationType.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_type', + ); + }); + } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', + ); + }); + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', + ); + }); + } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/v2/keyword/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/configuration.ts b/webapp/src/app/api/configuration.ts index 2b8c80f7..17a7070e 100644 --- a/webapp/src/app/api/configuration.ts +++ b/webapp/src/app/api/configuration.ts @@ -1,193 +1,219 @@ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, + HttpParameterCodec, +} from '@angular/common/http'; import { Param } from './param'; export interface ConfigurationParameters { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: {[ key: string ]: string}; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Override the default method for encoding path parameters in various - * styles. - *

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

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

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

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

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

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

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

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: { [key: string]: string | (() => string | undefined) }; -constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { - if (apiKeys) { - this.apiKeys = apiKeys; - } - if (username !== undefined) { - this.username = username; - } - if (password !== undefined) { - this.password = password; - } - if (accessToken !== undefined) { - this.accessToken = accessToken; - } - if (basePath !== undefined) { - this.basePath = basePath; - } - if (withCredentials !== undefined) { - this.withCredentials = withCredentials; - } - if (encoder) { - this.encoder = encoder; - } - this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); - this.credentials = credentials ?? {}; + constructor({ + accessToken, + apiKeys, + basePath, + credentials, + encodeParam, + encoder, + password, + username, + withCredentials, + }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = + encodeParam ?? ((param) => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; - // init default HTTPBearer credential - if (!this.credentials['HTTPBearer']) { - this.credentials['HTTPBearer'] = () => { - return typeof this.accessToken === 'function' - ? this.accessToken() - : this.accessToken; - }; - } + // init default HTTPBearer credential + if (!this.credentials['HTTPBearer']) { + this.credentials['HTTPBearer'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType(contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; } - /** - * 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; + } - 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; } - /** - * 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; + 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'); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i', + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } - public lookupCredential(key: string): string | undefined { - const value = this.credentials[key]; - return typeof value === 'function' - ? value() - : value; - } + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' ? value() : value; + } - public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { - const value = this.lookupCredential(credentialKey); - return value - ? headers.set(headerName, (prefix ?? '') + value) - : headers; - } + public addCredentialToHeaders( + credentialKey: string, + headerName: string, + headers: HttpHeaders, + prefix?: string, + ): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value ? headers.set(headerName, (prefix ?? '') + value) : headers; + } - public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { - const value = this.lookupCredential(credentialKey); - return value - ? query.set(paramName, value) - : query; - } + public addCredentialToQuery( + credentialKey: string, + paramName: string, + query: HttpParams, + ): HttpParams { + const value = this.lookupCredential(credentialKey); + return value ? query.set(paramName, value) : query; + } - private defaultEncodeParam(param: Param): string { - // This implementation exists as fallback for missing configuration - // and for backwards compatibility to older typescript-angular generator versions. - // It only works for the 'simple' parameter style. - // Date-handling only works for the 'date-time' format. - // All other styles and Date-formats are probably handled incorrectly. - // - // But: if that's all you need (i.e.: the most common use-case): no need for customization! + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! - const value = param.dataFormat === 'date-time' && param.value instanceof Date - ? (param.value as Date).toISOString() - : param.value; + const value = + param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; - return encodeURIComponent(String(value)); - } + return encodeURIComponent(String(value)); + } } diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts index 138c4d5c..889ef00d 100644 --- a/webapp/src/app/api/encoder.ts +++ b/webapp/src/app/api/encoder.ts @@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http'; * Workaround for https://github.com/angular/angular/issues/18261 */ export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } } diff --git a/webapp/src/app/api/model/accessResponse.ts b/webapp/src/app/api/model/accessResponse.ts index 6a36e872..2a188f73 100644 --- a/webapp/src/app/api/model/accessResponse.ts +++ b/webapp/src/app/api/model/accessResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { AccessToken } from './accessToken'; - -export interface AccessResponse { - /** - * The access token issued upon successful authentication. - */ - access_token: AccessToken; +export interface AccessResponse { + /** + * The access token issued upon successful authentication. + */ + access_token: AccessToken; } - diff --git a/webapp/src/app/api/model/accessToken.ts b/webapp/src/app/api/model/accessToken.ts index 74c4d45a..c2a5ec79 100644 --- a/webapp/src/app/api/model/accessToken.ts +++ b/webapp/src/app/api/model/accessToken.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,51 +10,47 @@ import { TokenType } from './tokenType'; import { UserRole } from './userRole'; - -export interface AccessToken { - /** - * The unique identifier of the real account associated with this token. - */ - real_account_id: string; - /** - * The timestamp indicating when the token will expire. - */ - expires_at: string; - /** - * The epoch value for the token. Used for versioning of tokens. - */ - epoch?: number; - /** - * The type of the token, which is always ACCESS_TOKEN for this class. - */ - token_type?: TokenType; - /** - * A unique fingerprint of the user, used for additional security checks. - */ - user_fingerprint_hash: string; - /** - * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. - */ - effective_account_id: string; - /** - * The specific role this access token grants within its organization. - */ - effective_role?: UserRole; - /** - * The roles this access token grants within its organization. - */ - effective_roles?: Array; - /** - * The unique identifier of the organization associated with this access token. - */ - effective_organization_id: string; - effective_institution_id?: string | null; - /** - * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. - */ - raw_token: string; +export interface AccessToken { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ACCESS_TOKEN for this class. + */ + token_type?: TokenType; + /** + * A unique fingerprint of the user, used for additional security checks. + */ + user_fingerprint_hash: string; + /** + * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. + */ + effective_account_id: string; + /** + * The specific role this access token grants within its organization. + */ + effective_role?: UserRole; + /** + * The roles this access token grants within its organization. + */ + effective_roles?: Array; + /** + * The unique identifier of the organization associated with this access token. + */ + effective_organization_id: string; + effective_institution_id?: string | null; + /** + * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. + */ + raw_token: string; } -export namespace AccessToken { -} - - +export namespace AccessToken {} diff --git a/webapp/src/app/api/model/accountPage.ts b/webapp/src/app/api/model/accountPage.ts index c92c4ba3..64c7f969 100644 --- a/webapp/src/app/api/model/accountPage.ts +++ b/webapp/src/app/api/model/accountPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { AccountProfile } from './accountProfile'; - -export interface AccountPage { - items: Array; - total: number; - page: number; - page_size: number; +export interface AccountPage { + items: Array; + total: number; + page: number; + page_size: number; } - diff --git a/webapp/src/app/api/model/accountProfile.ts b/webapp/src/app/api/model/accountProfile.ts index a7d7afa5..a61b98ae 100644 --- a/webapp/src/app/api/model/accountProfile.ts +++ b/webapp/src/app/api/model/accountProfile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,16 @@ */ import { UserRole } from './userRole'; - -export interface AccountProfile { - id: string; - email: string; - name: string; - roles: Array; - organization_id: string; - organization_name: string; - deleted: boolean; - activated: boolean; - is_current?: boolean; - is_real_account?: boolean; - is_impersonating?: boolean; +export interface AccountProfile { + id: string; + email: string; + name: string; + roles: Array; + organization_id: string; + organization_name: string; + deleted: boolean; + activated: boolean; + is_current?: boolean; + is_real_account?: boolean; + is_impersonating?: boolean; } - diff --git a/webapp/src/app/api/model/allPatentsResponse.ts b/webapp/src/app/api/model/allPatentsResponse.ts index dfe6fb24..f9b5e8ad 100644 --- a/webapp/src/app/api/model/allPatentsResponse.ts +++ b/webapp/src/app/api/model/allPatentsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { PatentEntry } from './patentEntry'; - -export interface AllPatentsResponse { - total: number; - page: number; - size: number; - patents: Array; +export interface AllPatentsResponse { + total: number; + page: number; + size: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index 9ba12273..0a050590 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -15,27 +15,25 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; - /** * A person who creates scholarly works */ -export interface Author { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Author { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/authorAffiliationsInner.ts b/webapp/src/app/api/model/authorAffiliationsInner.ts index 270443ff..d1e8f764 100644 --- a/webapp/src/app/api/model/authorAffiliationsInner.ts +++ b/webapp/src/app/api/model/authorAffiliationsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,10 @@ */ import { DehydratedInstitution } from './dehydratedInstitution'; - /** * AuthorAffiliationsInner */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; +export interface AuthorAffiliationsInner { + institution?: DehydratedInstitution | null; + years?: Array | null; } - diff --git a/webapp/src/app/api/model/authorCountsByYearInner.ts b/webapp/src/app/api/model/authorCountsByYearInner.ts index d16c7c21..1fac5b45 100644 --- a/webapp/src/app/api/model/authorCountsByYearInner.ts +++ b/webapp/src/app/api/model/authorCountsByYearInner.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * AuthorCountsByYearInner */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; +export interface AuthorCountsByYearInner { + year?: number | null; + works_count?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/authorIds.ts b/webapp/src/app/api/model/authorIds.ts index 9235a207..0b079d33 100644 --- a/webapp/src/app/api/model/authorIds.ts +++ b/webapp/src/app/api/model/authorIds.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; +export interface AuthorIds { + openalex?: string | null; + orcid?: string | null; + scopus?: string | null; } - diff --git a/webapp/src/app/api/model/authorMetricsRequest.ts b/webapp/src/app/api/model/authorMetricsRequest.ts index f0a072e3..1f4f15c6 100644 --- a/webapp/src/app/api/model/authorMetricsRequest.ts +++ b/webapp/src/app/api/model/authorMetricsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,14 @@ */ import { CompanyStatusFilter } from './companyStatusFilter'; - -export interface AuthorMetricsRequest { - /** - * OpenAlex IDs of the authors. - */ - author_ids: Array; - /** - * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. - */ - company_status?: CompanyStatusFilter; +export interface AuthorMetricsRequest { + /** + * OpenAlex IDs of the authors. + */ + author_ids: Array; + /** + * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. + */ + company_status?: CompanyStatusFilter; } -export namespace AuthorMetricsRequest { -} - - +export namespace AuthorMetricsRequest {} diff --git a/webapp/src/app/api/model/authorNetworkNode.ts b/webapp/src/app/api/model/authorNetworkNode.ts index aee98d47..f67c7148 100644 --- a/webapp/src/app/api/model/authorNetworkNode.ts +++ b/webapp/src/app/api/model/authorNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface AuthorNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; +export interface AuthorNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace AuthorNetworkNode { -} - - +export namespace AuthorNetworkNode {} diff --git a/webapp/src/app/api/model/authorPage.ts b/webapp/src/app/api/model/authorPage.ts index ce0a58ed..842ce006 100644 --- a/webapp/src/app/api/model/authorPage.ts +++ b/webapp/src/app/api/model/authorPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { Author } from './author'; - /** * A paginated response containing a list of authors. */ -export interface AuthorPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface AuthorPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/authorParsedLongestName.ts b/webapp/src/app/api/model/authorParsedLongestName.ts index f49e04be..f08df27d 100644 --- a/webapp/src/app/api/model/authorParsedLongestName.ts +++ b/webapp/src/app/api/model/authorParsedLongestName.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The longest name parsed into its component parts. */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; +export interface AuthorParsedLongestName { + first?: string | null; + middle?: string | null; + last?: string | null; + suffix?: string | null; + nickname?: string | null; } - diff --git a/webapp/src/app/api/model/authorPositionCount.ts b/webapp/src/app/api/model/authorPositionCount.ts index a02e3749..989d2c18 100644 --- a/webapp/src/app/api/model/authorPositionCount.ts +++ b/webapp/src/app/api/model/authorPositionCount.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface AuthorPositionCount { - first?: number; - middle?: number; - last?: number; - unknown?: number; +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; } - diff --git a/webapp/src/app/api/model/authorStaticStats.ts b/webapp/src/app/api/model/authorStaticStats.ts index ddb24c33..655e18c2 100644 --- a/webapp/src/app/api/model/authorStaticStats.ts +++ b/webapp/src/app/api/model/authorStaticStats.ts @@ -1,37 +1,35 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Section 2: author-level stats independent of any keyword/topic/time filter. */ -export interface AuthorStaticStats { - /** - * The OpenAlex ID of the author. - */ - author_id: string; - /** - * The name of the author. - */ - display_name: string; - /** - * Number of Handelsregister company connections matched by the author\'s name. - */ - companies_count: number; - /** - * Number of news articles that mention the author by exact name. - */ - news_count: number; - /** - * Number of patents matched to the author (from the org_patents index). - */ - patents_count: number; +export interface AuthorStaticStats { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of Handelsregister company connections matched by the author\'s name. + */ + companies_count: number; + /** + * Number of news articles that mention the author by exact name. + */ + news_count: number; + /** + * Number of patents matched to the author (from the org_patents index). + */ + patents_count: number; } - diff --git a/webapp/src/app/api/model/authorSummaryStats.ts b/webapp/src/app/api/model/authorSummaryStats.ts index 1cfc0bdb..63c35c31 100644 --- a/webapp/src/app/api/model/authorSummaryStats.ts +++ b/webapp/src/app/api/model/authorSummaryStats.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; - /** * Citation metrics: */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; +export interface AuthorSummaryStats { + '2yr_mean_citedness'?: Model2YrMeanCitedness | null; + h_index?: number | null; + i10_index?: number | null; } - diff --git a/webapp/src/app/api/model/authorTopicProfile.ts b/webapp/src/app/api/model/authorTopicProfile.ts index 32bbe888..d421dd1a 100644 --- a/webapp/src/app/api/model/authorTopicProfile.ts +++ b/webapp/src/app/api/model/authorTopicProfile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,43 +9,41 @@ */ import { SubfieldShare } from './subfieldShare'; - -export interface AuthorTopicProfile { - /** - * The OpenAlex ID of the author. - */ - author_id: string; - /** - * The name of the author. - */ - display_name: string; - /** - * All works of the author in the timespan, regardless of the topic filter. - */ - works_total: number; - /** - * Works matching the topic filter (same subset as Section 1). - */ - matched_works: number; - /** - * Matched works where one of the searched topics is the work\'s primary topic (only meaningful for filter_type \'topic\'). - */ - primary_topic_matches: number; - /** - * Number of distinct primary topics across all works. - */ - distinct_topics: number; - /** - * Number of distinct primary-topic subfields across all works. - */ - distinct_subfields: number; - /** - * Number of distinct primary-topic fields across all works. - */ - distinct_fields: number; - /** - * Top subfields over all works, by primary topic, largest first. - */ - subfields?: Array; +export interface AuthorTopicProfile { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * All works of the author in the timespan, regardless of the topic filter. + */ + works_total: number; + /** + * Works matching the topic filter (same subset as Section 1). + */ + matched_works: number; + /** + * Matched works where one of the searched topics is the work\'s primary topic (only meaningful for filter_type \'topic\'). + */ + primary_topic_matches: number; + /** + * Number of distinct primary topics across all works. + */ + distinct_topics: number; + /** + * Number of distinct primary-topic subfields across all works. + */ + distinct_subfields: number; + /** + * Number of distinct primary-topic fields across all works. + */ + distinct_fields: number; + /** + * Top subfields over all works, by primary topic, largest first. + */ + subfields?: Array; } - diff --git a/webapp/src/app/api/model/authorTopicStats.ts b/webapp/src/app/api/model/authorTopicStats.ts index 9bf9e187..15fac6d0 100644 --- a/webapp/src/app/api/model/authorTopicStats.ts +++ b/webapp/src/app/api/model/authorTopicStats.ts @@ -1,95 +1,93 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Section 1: combined stats over an author\'s works that match the topic filter. */ -export interface AuthorTopicStats { - /** - * The OpenAlex ID of the author. - */ - author_id: string; - /** - * The name of the author. - */ - display_name: string; - /** - * Number of the author\'s works matching the topic filter. - */ - works_total: number; - /** - * Number of the author\'s topic works where they are the corresponding author. - */ - corresponding_count: number; - /** - * Average field-normalized citation percentile (0-1) over the author\'s topic works. - */ - avg_percentile: number; - /** - * Number of the author\'s topic works in the top 1% most-cited. - */ - top1_count: number; - /** - * Number of the author\'s topic works in the top 10% most-cited. - */ - top10_count: number; - /** - * Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1 (cited more than the field/year/type average). - */ - fwci_above_one_count?: number; - /** - * Total citations across the author\'s topic works. - */ - citations_total?: number; - /** - * Average citations per topic work. - */ - avg_citations?: number; - /** - * Citations of the author\'s most-cited topic work. - */ - max_citations?: number; - /** - * h-index over the author\'s topic works (capped at 100). - */ - h_index?: number; - /** - * Average field-weighted citation impact (FWCI) over the author\'s topic works; works without an FWCI value are excluded. - */ - avg_fwci?: number; - /** - * Number of the author\'s topic works with at least one co-author institution of type \'company\'. - */ - industry_works_count?: number; - first_year?: number | null; - last_year?: number | null; - /** - * Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8. - */ - relevance_above_80_count?: number; - /** - * Average matched-keyword relevance score (0-1) over the author\'s topic works. - */ - avg_relevance?: number; - /** - * Number of the author\'s topic works where they are the first author. - */ - first_author_count?: number; - /** - * Number of the author\'s topic works where they are a middle author. - */ - middle_author_count?: number; - /** - * Number of the author\'s topic works where they are the last author. - */ - last_author_count?: number; +export interface AuthorTopicStats { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of the author\'s works matching the topic filter. + */ + works_total: number; + /** + * Number of the author\'s topic works where they are the corresponding author. + */ + corresponding_count: number; + /** + * Average field-normalized citation percentile (0-1) over the author\'s topic works. + */ + avg_percentile: number; + /** + * Number of the author\'s topic works in the top 1% most-cited. + */ + top1_count: number; + /** + * Number of the author\'s topic works in the top 10% most-cited. + */ + top10_count: number; + /** + * Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1 (cited more than the field/year/type average). + */ + fwci_above_one_count?: number; + /** + * Total citations across the author\'s topic works. + */ + citations_total?: number; + /** + * Average citations per topic work. + */ + avg_citations?: number; + /** + * Citations of the author\'s most-cited topic work. + */ + max_citations?: number; + /** + * h-index over the author\'s topic works (capped at 100). + */ + h_index?: number; + /** + * Average field-weighted citation impact (FWCI) over the author\'s topic works; works without an FWCI value are excluded. + */ + avg_fwci?: number; + /** + * Number of the author\'s topic works with at least one co-author institution of type \'company\'. + */ + industry_works_count?: number; + first_year?: number | null; + last_year?: number | null; + /** + * Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8. + */ + relevance_above_80_count?: number; + /** + * Average matched-keyword relevance score (0-1) over the author\'s topic works. + */ + avg_relevance?: number; + /** + * Number of the author\'s topic works where they are the first author. + */ + first_author_count?: number; + /** + * Number of the author\'s topic works where they are a middle author. + */ + middle_author_count?: number; + /** + * Number of the author\'s topic works where they are the last author. + */ + last_author_count?: number; } - diff --git a/webapp/src/app/api/model/authorsFilterProperties.ts b/webapp/src/app/api/model/authorsFilterProperties.ts index 7312558f..50795f2a 100644 --- a/webapp/src/app/api/model/authorsFilterProperties.ts +++ b/webapp/src/app/api/model/authorsFilterProperties.ts @@ -1,26 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface AuthorsFilterProperties { - /** - * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. - */ - allowed_institutions?: Array; - /** - * The minimum number of collaborations required for an author to be included in the collaboration network. - */ - min_collaborations?: number; - /** - * The maximum number of collaborations allowed for an author to be included in the collaboration network. - */ - max_collaborations?: number; +export interface AuthorsFilterProperties { + /** + * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. + */ + allowed_institutions?: Array; + /** + * The minimum number of collaborations required for an author to be included in the collaboration network. + */ + min_collaborations?: number; + /** + * The maximum number of collaborations allowed for an author to be included in the collaboration network. + */ + max_collaborations?: number; } - diff --git a/webapp/src/app/api/model/authorsListResponse.ts b/webapp/src/app/api/model/authorsListResponse.ts index d309ae43..bb1a602c 100644 --- a/webapp/src/app/api/model/authorsListResponse.ts +++ b/webapp/src/app/api/model/authorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Author } from './author'; import { GroupByResult } from './groupByResult'; - /** * AuthorsListResponse */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface AuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index db3a0bf0..f1b9d48e 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,15 @@ import { DehydratedInstitution } from './dehydratedInstitution'; import { DehydratedAuthor } from './dehydratedAuthor'; - /** * Author and their affiliation for a work */ -export interface Authorship { - author_position?: string | null; - author?: DehydratedAuthor | null; - institutions?: Array | null; - countries?: Array | null; - is_corresponding?: boolean | null; - raw_author_name?: string | null; - raw_affiliation_strings?: Array | null; +export interface Authorship { + author_position?: string | null; + author?: DehydratedAuthor | null; + institutions?: Array | null; + countries?: Array | null; + is_corresponding?: boolean | null; + raw_author_name?: string | null; + raw_affiliation_strings?: Array | null; } - diff --git a/webapp/src/app/api/model/autocompleteLocationItem.ts b/webapp/src/app/api/model/autocompleteLocationItem.ts index 56a10e09..b07e699e 100644 --- a/webapp/src/app/api/model/autocompleteLocationItem.ts +++ b/webapp/src/app/api/model/autocompleteLocationItem.ts @@ -1,26 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface AutocompleteLocationItem { - id: string; - display_name: string; - code: string; - type: AutocompleteLocationItem.TypeEnum; +export interface AutocompleteLocationItem { + id: string; + display_name: string; + code: string; + type: AutocompleteLocationItem.TypeEnum; } export namespace AutocompleteLocationItem { - export const TypeEnum = { - Country: 'country', - Continent: 'continent' - } as const; - export type TypeEnum = typeof TypeEnum[keyof typeof TypeEnum]; + export const TypeEnum = { + Country: 'country', + Continent: 'continent', + } as const; + export type TypeEnum = (typeof TypeEnum)[keyof typeof TypeEnum]; } - - diff --git a/webapp/src/app/api/model/autocompleteResponse.ts b/webapp/src/app/api/model/autocompleteResponse.ts index e220f57b..8b52b300 100644 --- a/webapp/src/app/api/model/autocompleteResponse.ts +++ b/webapp/src/app/api/model/autocompleteResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,12 +10,10 @@ import { AutocompleteResponseMeta } from './autocompleteResponseMeta'; import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner'; - /** * AutocompleteResponse */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; +export interface AutocompleteResponse { + meta?: AutocompleteResponseMeta | null; + results?: Array | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponseMeta.ts b/webapp/src/app/api/model/autocompleteResponseMeta.ts index 2e080d39..5bf94a57 100644 --- a/webapp/src/app/api/model/autocompleteResponseMeta.ts +++ b/webapp/src/app/api/model/autocompleteResponseMeta.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * AutocompleteResponseMeta */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; +export interface AutocompleteResponseMeta { + count?: number | null; + db_response_time_ms?: number | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts index 99ba71fe..0fa956b7 100644 --- a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts +++ b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts @@ -1,24 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * AutocompleteResponseResultsInner */ -export interface AutocompleteResponseResultsInner { - id?: string | null; - display_name?: string | null; - hint?: string | null; - cited_by_count?: number | null; - works_count?: number | null; - entity_type?: string | null; - external_id?: string | null; +export interface AutocompleteResponseResultsInner { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; } - diff --git a/webapp/src/app/api/model/availableImages.ts b/webapp/src/app/api/model/availableImages.ts new file mode 100644 index 00000000..06b9742e --- /dev/null +++ b/webapp/src/app/api/model/availableImages.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface AvailableImages { + images: Array; + detail?: string; +} diff --git a/webapp/src/app/api/model/award.ts b/webapp/src/app/api/model/award.ts index 4e3b5cc9..a461c971 100644 --- a/webapp/src/app/api/model/award.ts +++ b/webapp/src/app/api/model/award.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Award */ -export interface Award { - id?: string | null; - display_name?: string | null; - funder_award_id?: string | null; - funder_id?: string | null; - funder_display_name?: string | null; - doi?: string | null; +export interface Award { + id?: string | null; + display_name?: string | null; + funder_award_id?: string | null; + funder_id?: string | null; + funder_display_name?: string | null; + doi?: string | null; } - diff --git a/webapp/src/app/api/model/backgroundJobTask.ts b/webapp/src/app/api/model/backgroundJobTask.ts new file mode 100644 index 00000000..e3063969 --- /dev/null +++ b/webapp/src/app/api/model/backgroundJobTask.ts @@ -0,0 +1,26 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { JobRun } from './jobRun'; + +export interface BackgroundJobTask { + id: number; + name: string; + description: string; + target_index: string; + image: string | null; + command: string | null; + env: { [key: string]: string }; + schedule: string | null; + enabled: boolean; + next_run_at: string | null; + last_run: JobRun | null; + status: string; +} +export namespace BackgroundJobTask {} diff --git a/webapp/src/app/api/model/bodyChangePassword.ts b/webapp/src/app/api/model/bodyChangePassword.ts index b6454f0e..c76bafc4 100644 --- a/webapp/src/app/api/model/bodyChangePassword.ts +++ b/webapp/src/app/api/model/bodyChangePassword.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyChangePassword { - /** - * Current password - */ - current_password: string; - /** - * New password - */ - new_password: string; +export interface BodyChangePassword { + /** + * Current password + */ + current_password: string; + /** + * New password + */ + new_password: string; } - diff --git a/webapp/src/app/api/model/bodyGetAccessToken.ts b/webapp/src/app/api/model/bodyGetAccessToken.ts index 8e5df2ed..3314146a 100644 --- a/webapp/src/app/api/model/bodyGetAccessToken.ts +++ b/webapp/src/app/api/model/bodyGetAccessToken.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyGetAccessToken { - /** - * User\'s account ID - */ - real_account_id: string; - /** - * Effective account ID for the access token - */ - effective_account_id: string; +export interface BodyGetAccessToken { + /** + * User\'s account ID + */ + real_account_id: string; + /** + * Effective account ID for the access token + */ + effective_account_id: string; } - diff --git a/webapp/src/app/api/model/bodyLogin.ts b/webapp/src/app/api/model/bodyLogin.ts index f4022b0b..e4e8efd6 100644 --- a/webapp/src/app/api/model/bodyLogin.ts +++ b/webapp/src/app/api/model/bodyLogin.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyLogin { - /** - * User\'s account ID - */ - account_id: string; - /** - * One-time code sent to user\'s email - */ - email_code: string; +export interface BodyLogin { + /** + * User\'s account ID + */ + account_id: string; + /** + * One-time code sent to user\'s email + */ + email_code: string; } - diff --git a/webapp/src/app/api/model/bodyRequestOtk.ts b/webapp/src/app/api/model/bodyRequestOtk.ts index ba1a396d..1600a002 100644 --- a/webapp/src/app/api/model/bodyRequestOtk.ts +++ b/webapp/src/app/api/model/bodyRequestOtk.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyRequestOtk { - /** - * User\'s email address - */ - email: string; - /** - * User\'s password - */ - password: string; +export interface BodyRequestOtk { + /** + * User\'s email address + */ + email: string; + /** + * User\'s password + */ + password: string; } - diff --git a/webapp/src/app/api/model/bodyRequestPasswordReset.ts b/webapp/src/app/api/model/bodyRequestPasswordReset.ts index 2c9b4b13..ec3222b5 100644 --- a/webapp/src/app/api/model/bodyRequestPasswordReset.ts +++ b/webapp/src/app/api/model/bodyRequestPasswordReset.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyRequestPasswordReset { - /** - * User\'s email address - */ - email: string; +export interface BodyRequestPasswordReset { + /** + * User\'s email address + */ + email: string; } - diff --git a/webapp/src/app/api/model/bodyResetPassword.ts b/webapp/src/app/api/model/bodyResetPassword.ts index 03e63c44..0e3b74aa 100644 --- a/webapp/src/app/api/model/bodyResetPassword.ts +++ b/webapp/src/app/api/model/bodyResetPassword.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyResetPassword { - /** - * Password reset token from the reset link - */ - reset_token: string; - /** - * New password - */ - new_password: string; +export interface BodyResetPassword { + /** + * Password reset token from the reset link + */ + reset_token: string; + /** + * New password + */ + new_password: string; } - diff --git a/webapp/src/app/api/model/bundProjectDetails.ts b/webapp/src/app/api/model/bundProjectDetails.ts index 2193563c..b61df06b 100644 --- a/webapp/src/app/api/model/bundProjectDetails.ts +++ b/webapp/src/app/api/model/bundProjectDetails.ts @@ -1,57 +1,55 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types. */ -export interface BundProjectDetails { - /** - * The ID of the Bund project - */ - id: string; - funding_reference?: string | null; - title?: string | null; - description?: string | null; - joint_project?: string | null; - funding_type?: string | null; - funding_profile?: string | null; - funding_amount?: number | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - duration?: string | null; - performance_plan_code?: string | null; - performance_plan_fullname?: string | null; - executing_agency?: string | null; - funding_recipient?: string | null; - project_agency?: string | null; - project_agency_fullname?: string | null; - department?: string | null; - department_fullname?: string | null; - division?: string | null; - location?: string | null; - municipality?: string | null; - state?: string | null; - country?: string | null; - municipality_code?: string | null; - publication_date?: string | null; - is_new?: boolean | null; - record_date?: string | null; - unix_timestamp?: number | null; - /** - * All persons associated with the Bund project (from nested Arb object) - */ - associated_persons?: Array; - /** - * All institutions associated with the Bund project - */ - institutions?: Array; +export interface BundProjectDetails { + /** + * The ID of the Bund project + */ + id: string; + funding_reference?: string | null; + title?: string | null; + description?: string | null; + joint_project?: string | null; + funding_type?: string | null; + funding_profile?: string | null; + funding_amount?: number | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + duration?: string | null; + performance_plan_code?: string | null; + performance_plan_fullname?: string | null; + executing_agency?: string | null; + funding_recipient?: string | null; + project_agency?: string | null; + project_agency_fullname?: string | null; + department?: string | null; + department_fullname?: string | null; + division?: string | null; + location?: string | null; + municipality?: string | null; + state?: string | null; + country?: string | null; + municipality_code?: string | null; + publication_date?: string | null; + is_new?: boolean | null; + record_date?: string | null; + unix_timestamp?: number | null; + /** + * All persons associated with the Bund project (from nested Arb object) + */ + associated_persons?: Array; + /** + * All institutions associated with the Bund project + */ + institutions?: Array; } - diff --git a/webapp/src/app/api/model/bundProjectSummary.ts b/webapp/src/app/api/model/bundProjectSummary.ts index e4fa0346..aedcef69 100644 --- a/webapp/src/app/api/model/bundProjectSummary.ts +++ b/webapp/src/app/api/model/bundProjectSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,36 +9,34 @@ */ import { Topic } from './topic'; - -export interface BundProjectSummary { - funding_code?: string | null; - department?: string | null; - department_fullname?: string | null; - referat?: string | null; - project_sponsor?: string | null; - project_sponsor_fullname?: string | null; - work_unit?: string | null; - recipient?: string | null; - municipal_code?: string | null; - municipality?: string | null; - place?: string | null; - state?: string | null; - country?: string | null; - implementing_agency?: string | null; - topic?: string | null; - performance_plan_system?: string | null; - performance_plan_system_text?: string | null; - funding_start?: string | null; - funding_end?: string | null; - grant_amount?: number | null; - funding_profile?: string | null; - joint_project?: string | null; - funding_type?: string | null; - publication_date?: string | null; - unix_timestamp?: number | null; - date?: string | null; - 'new'?: boolean | null; - duration?: string | null; - oa_topics?: Array | null; +export interface BundProjectSummary { + funding_code?: string | null; + department?: string | null; + department_fullname?: string | null; + referat?: string | null; + project_sponsor?: string | null; + project_sponsor_fullname?: string | null; + work_unit?: string | null; + recipient?: string | null; + municipal_code?: string | null; + municipality?: string | null; + place?: string | null; + state?: string | null; + country?: string | null; + implementing_agency?: string | null; + topic?: string | null; + performance_plan_system?: string | null; + performance_plan_system_text?: string | null; + funding_start?: string | null; + funding_end?: string | null; + grant_amount?: number | null; + funding_profile?: string | null; + joint_project?: string | null; + funding_type?: string | null; + publication_date?: string | null; + unix_timestamp?: number | null; + date?: string | null; + new?: boolean | null; + duration?: string | null; + oa_topics?: Array | null; } - diff --git a/webapp/src/app/api/model/careerMetrics.ts b/webapp/src/app/api/model/careerMetrics.ts index abb58689..eb84c19f 100644 --- a/webapp/src/app/api/model/careerMetrics.ts +++ b/webapp/src/app/api/model/careerMetrics.ts @@ -1,34 +1,32 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CareerMetrics { - first_publication_year?: number | null; - last_publication_year?: number | null; - career_age?: number | null; - career_span?: number | null; - career_stage?: string | null; - /** - * Number of distinct years with at least one publication. - */ - active_years?: number; - /** - * Number of publications used for career metrics. - */ - publication_count?: number; - publications_per_active_year?: number | null; - publications_per_career_year?: number | null; - years_since_last_publication?: number | null; - /** - * True if publication years look suspicious. - */ - has_suspicious_publication_years?: boolean; +export interface CareerMetrics { + first_publication_year?: number | null; + last_publication_year?: number | null; + career_age?: number | null; + career_span?: number | null; + career_stage?: string | null; + /** + * Number of distinct years with at least one publication. + */ + active_years?: number; + /** + * Number of publications used for career metrics. + */ + publication_count?: number; + publications_per_active_year?: number | null; + publications_per_career_year?: number | null; + years_since_last_publication?: number | null; + /** + * True if publication years look suspicious. + */ + has_suspicious_publication_years?: boolean; } - diff --git a/webapp/src/app/api/model/careerStage.ts b/webapp/src/app/api/model/careerStage.ts index d2a4e844..16b47837 100644 --- a/webapp/src/app/api/model/careerStage.ts +++ b/webapp/src/app/api/model/careerStage.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const CareerStage = { - Unknown: 'unknown', - Early: 'Early', - Emerging: 'Emerging', - Established: 'Established', - Senior: 'Senior' + Unknown: 'unknown', + Early: 'Early', + Emerging: 'Emerging', + Established: 'Established', + Senior: 'Senior', } as const; -export type CareerStage = typeof CareerStage[keyof typeof CareerStage]; - +export type CareerStage = (typeof CareerStage)[keyof typeof CareerStage]; diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaborationNetwork.ts index e439c061..a2fbdc5b 100644 --- a/webapp/src/app/api/model/collaborationNetwork.ts +++ b/webapp/src/app/api/model/collaborationNetwork.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -13,31 +13,29 @@ import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; import { InstitutionNetworkNode } from './institutionNetworkNode'; import { AuthorNetworkNode } from './authorNetworkNode'; - -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The work nodes in the collaboration network. - */ - work_nodes: Array; - /** - * The author nodes in the collaboration network. - */ - author_nodes: Array; - /** - * The institution nodes in the collaboration network. - */ - institution_nodes: Array; - /** - * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I - */ - collaboration_edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; +export interface CollaborationNetwork { + /** + * The raw person ID of the person whose collaboration network this is. + */ + raw_person_id: string; + /** + * The work nodes in the collaboration network. + */ + work_nodes: Array; + /** + * The author nodes in the collaboration network. + */ + author_nodes: Array; + /** + * The institution nodes in the collaboration network. + */ + institution_nodes: Array; + /** + * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I + */ + collaboration_edges: Array; + /** + * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. + */ + filter_information: FilterInformation; } - diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaborationNetworkEdge.ts index 16fb5fc6..baffb178 100644 --- a/webapp/src/app/api/model/collaborationNetworkEdge.ts +++ b/webapp/src/app/api/model/collaborationNetworkEdge.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; +export interface CollaborationNetworkEdge { + /** + * The raw ID of the source node. + */ + raw_source_id: string; + /** + * The raw ID of the target node. + */ + raw_target_id: string; } - diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts index 752e35b0..3e673f35 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -1,18 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work' + Author: 'author', + Institution: 'institution', + Work: 'work', } as const; -export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; - +export type CollaborationNetworkNodeType = + (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/companyConnection.ts b/webapp/src/app/api/model/companyConnection.ts index 4ce31814..2824c543 100644 --- a/webapp/src/app/api/model/companyConnection.ts +++ b/webapp/src/app/api/model/companyConnection.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { MatchedOfficer } from './matchedOfficer'; - -export interface CompanyConnection { - company_number?: string | null; - company_name?: string | null; - company_status?: string | null; - register_art?: string | null; - register_nummer?: string | null; - native_company_number?: string | null; - registrar?: string | null; - registered_office?: string | null; - registered_address?: string | null; - retrieved_at?: string | null; - matched_officers?: Array; - officers?: Array; +export interface CompanyConnection { + company_number?: string | null; + company_name?: string | null; + company_status?: string | null; + register_art?: string | null; + register_nummer?: string | null; + native_company_number?: string | null; + registrar?: string | null; + registered_office?: string | null; + registered_address?: string | null; + retrieved_at?: string | null; + matched_officers?: Array; + officers?: Array; } - diff --git a/webapp/src/app/api/model/companyConnectionsAvailability.ts b/webapp/src/app/api/model/companyConnectionsAvailability.ts index a2c92ed7..cefa8680 100644 --- a/webapp/src/app/api/model/companyConnectionsAvailability.ts +++ b/webapp/src/app/api/model/companyConnectionsAvailability.ts @@ -1,15 +1,13 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CompanyConnectionsAvailability { - available: boolean; +export interface CompanyConnectionsAvailability { + available: boolean; } - diff --git a/webapp/src/app/api/model/companyConnectionsResponse.ts b/webapp/src/app/api/model/companyConnectionsResponse.ts index b110d640..9b86a710 100644 --- a/webapp/src/app/api/model/companyConnectionsResponse.ts +++ b/webapp/src/app/api/model/companyConnectionsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,14 +9,12 @@ */ import { CompanyConnection } from './companyConnection'; - -export interface CompanyConnectionsResponse { - author_id: string; - display_name?: string | null; - matching_method?: string | null; - company_count: number; - has_more_results: boolean; - common_name_warning: boolean; - connections?: Array; +export interface CompanyConnectionsResponse { + author_id: string; + display_name?: string | null; + matching_method?: string | null; + company_count: number; + has_more_results: boolean; + common_name_warning: boolean; + connections?: Array; } - diff --git a/webapp/src/app/api/model/companyStatusFilter.ts b/webapp/src/app/api/model/companyStatusFilter.ts index 7d4355e7..3bd62237 100644 --- a/webapp/src/app/api/model/companyStatusFilter.ts +++ b/webapp/src/app/api/model/companyStatusFilter.ts @@ -1,18 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const CompanyStatusFilter = { - All: 'all', - Active: 'active', - Deleted: 'deleted' + All: 'all', + Active: 'active', + Deleted: 'deleted', } as const; -export type CompanyStatusFilter = typeof CompanyStatusFilter[keyof typeof CompanyStatusFilter]; - +export type CompanyStatusFilter = + (typeof CompanyStatusFilter)[keyof typeof CompanyStatusFilter]; diff --git a/webapp/src/app/api/model/costUsd.ts b/webapp/src/app/api/model/costUsd.ts index c7bcbee8..494cb094 100644 --- a/webapp/src/app/api/model/costUsd.ts +++ b/webapp/src/app/api/model/costUsd.ts @@ -1,17 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Cost of this request in USD */ -export interface CostUsd { -} - +export interface CostUsd {} diff --git a/webapp/src/app/api/model/createAccountRequest.ts b/webapp/src/app/api/model/createAccountRequest.ts index b2393cc2..c38fce15 100644 --- a/webapp/src/app/api/model/createAccountRequest.ts +++ b/webapp/src/app/api/model/createAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { UserRole } from './userRole'; - -export interface CreateAccountRequest { - email: string; - name: string; - roles?: Array; - organization_id: string; - password: string; - openalex_person_id?: string | null; +export interface CreateAccountRequest { + email: string; + name: string; + roles?: Array; + organization_id: string; + password: string; + openalex_person_id?: string | null; } - diff --git a/webapp/src/app/api/model/createOrganizationRequest.ts b/webapp/src/app/api/model/createOrganizationRequest.ts index fffb5457..94aacb80 100644 --- a/webapp/src/app/api/model/createOrganizationRequest.ts +++ b/webapp/src/app/api/model/createOrganizationRequest.ts @@ -1,16 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CreateOrganizationRequest { - name: string; - other_inst_id?: string | null; +export interface CreateOrganizationRequest { + name: string; + other_inst_id?: string | null; } - diff --git a/webapp/src/app/api/model/createPersonBookmark.ts b/webapp/src/app/api/model/createPersonBookmark.ts index e2e196dd..d9d69bea 100644 --- a/webapp/src/app/api/model/createPersonBookmark.ts +++ b/webapp/src/app/api/model/createPersonBookmark.ts @@ -1,15 +1,13 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CreatePersonBookmark { - person_name?: string | null; +export interface CreatePersonBookmark { + person_name?: string | null; } - diff --git a/webapp/src/app/api/model/customAuthor.ts b/webapp/src/app/api/model/customAuthor.ts index 0cf7eb21..6fd54c51 100644 --- a/webapp/src/app/api/model/customAuthor.ts +++ b/webapp/src/app/api/model/customAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,26 +16,24 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; - -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; - career_metrics?: CareerMetrics | null; +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; + career_metrics?: CareerMetrics | null; } - diff --git a/webapp/src/app/api/model/customAuthorsListResponse.ts b/webapp/src/app/api/model/customAuthorsListResponse.ts index 3c80ddf5..71f691a2 100644 --- a/webapp/src/app/api/model/customAuthorsListResponse.ts +++ b/webapp/src/app/api/model/customAuthorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,9 @@ import { Meta } from './meta'; import { CustomAuthor } from './customAuthor'; import { GroupByResult } from './groupByResult'; - -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; - placeholder?: CustomAuthor | null; +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; + placeholder?: CustomAuthor | null; } - diff --git a/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts index 716a0f11..9764ebe9 100644 --- a/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts +++ b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * DFGProjectFachgebieteInner */ -export interface DFGProjectFachgebieteInner { - fach?: string | null; - fach_code?: string | null; - fachgebiet?: string | null; - fachgebiet_code?: string | null; - fachkollegium?: string | null; - fachkollegium_code?: string | null; - wissenschaftsbereich?: string | null; - wissenschaftsbereich_code?: string | null; +export interface DFGProjectFachgebieteInner { + fach?: string | null; + fach_code?: string | null; + fachgebiet?: string | null; + fachgebiet_code?: string | null; + fachkollegium?: string | null; + fachkollegium_code?: string | null; + wissenschaftsbereich?: string | null; + wissenschaftsbereich_code?: string | null; } - diff --git a/webapp/src/app/api/model/dashboardStatisticValue.ts b/webapp/src/app/api/model/dashboardStatisticValue.ts index 928bdd76..7666aee8 100644 --- a/webapp/src/app/api/model/dashboardStatisticValue.ts +++ b/webapp/src/app/api/model/dashboardStatisticValue.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface DashboardStatisticValue { - institution_id: string; - organization_name: string; - value: number; +export interface DashboardStatisticValue { + institution_id: string; + organization_name: string; + value: number; } - diff --git a/webapp/src/app/api/model/dashboardStatistics.ts b/webapp/src/app/api/model/dashboardStatistics.ts index ba33382d..28d2527c 100644 --- a/webapp/src/app/api/model/dashboardStatistics.ts +++ b/webapp/src/app/api/model/dashboardStatistics.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface DashboardStatistics { - institution_id: string; - organization_name: string; - publications: number; - persons: number; - projects: number; - dfg_projects: number; - eu_projects: number; - bmbf_projects: number; +export interface DashboardStatistics { + institution_id: string; + organization_name: string; + publications: number; + persons: number; + projects: number; + dfg_projects: number; + eu_projects: number; + bmbf_projects: number; } - diff --git a/webapp/src/app/api/model/dehydratedAuthor.ts b/webapp/src/app/api/model/dehydratedAuthor.ts index 4d3817f1..350718ef 100644 --- a/webapp/src/app/api/model/dehydratedAuthor.ts +++ b/webapp/src/app/api/model/dehydratedAuthor.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface DehydratedAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } - diff --git a/webapp/src/app/api/model/dehydratedFunder.ts b/webapp/src/app/api/model/dehydratedFunder.ts index b134bbb1..c4231c13 100644 --- a/webapp/src/app/api/model/dehydratedFunder.ts +++ b/webapp/src/app/api/model/dehydratedFunder.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface DehydratedFunder { + id?: string | null; + display_name?: string | null; + ror?: string | null; } - diff --git a/webapp/src/app/api/model/dehydratedInstitution.ts b/webapp/src/app/api/model/dehydratedInstitution.ts index 7b6c9824..956fc03e 100644 --- a/webapp/src/app/api/model/dehydratedInstitution.ts +++ b/webapp/src/app/api/model/dehydratedInstitution.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; +export interface DehydratedInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; } - diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydratedSource.ts index ae714846..b672b5dd 100644 --- a/webapp/src/app/api/model/dehydratedSource.ts +++ b/webapp/src/app/api/model/dehydratedSource.ts @@ -1,28 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; +export interface DehydratedSource { + id?: string | null; + display_name?: string | null; + issn_l?: string | null; + issn?: Array | null; + is_oa?: boolean | null; + is_in_doaj?: boolean | null; + is_core?: boolean | null; + host_organization?: string | null; + host_organization_name?: string | null; + host_organization_lineage?: Array | null; + type?: string | null; } - diff --git a/webapp/src/app/api/model/dfgInstitutionSummary.ts b/webapp/src/app/api/model/dfgInstitutionSummary.ts index e3da7abf..f2134a2f 100644 --- a/webapp/src/app/api/model/dfgInstitutionSummary.ts +++ b/webapp/src/app/api/model/dfgInstitutionSummary.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * A summary of a DFG institution. */ -export interface DfgInstitutionSummary { - id: number; - institute_name_de?: string | null; - institute_name_en?: string | null; - root_id?: number | null; - root_name_de?: string | null; - root_name_en?: string | null; - address_country_de?: string | null; - address_country_en?: string | null; +export interface DfgInstitutionSummary { + id: number; + institute_name_de?: string | null; + institute_name_en?: string | null; + root_id?: number | null; + root_name_de?: string | null; + root_name_en?: string | null; + address_country_de?: string | null; + address_country_en?: string | null; } - diff --git a/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts index 0bb6e492..f31398c8 100644 --- a/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts +++ b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; - /** * A paginated response containing a list of institutions. */ -export interface DfgInstitutionSummaryPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface DfgInstitutionSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/dfgPersonSummary.ts b/webapp/src/app/api/model/dfgPersonSummary.ts index ebd441ee..5c525ca5 100644 --- a/webapp/src/app/api/model/dfgPersonSummary.ts +++ b/webapp/src/app/api/model/dfgPersonSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,14 +9,12 @@ */ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; - -export interface DfgPersonSummary { - person_id: number; - orcid_id?: string | null; - project_ref_id?: number | null; - full_name?: string | null; - role_label_en?: string | null; - role_label_de?: string | null; - institution?: DfgInstitutionSummary | null; +export interface DfgPersonSummary { + person_id: number; + orcid_id?: string | null; + project_ref_id?: number | null; + full_name?: string | null; + role_label_en?: string | null; + role_label_de?: string | null; + institution?: DfgInstitutionSummary | null; } - diff --git a/webapp/src/app/api/model/dfgPersonSummaryPage.ts b/webapp/src/app/api/model/dfgPersonSummaryPage.ts index c4b7d916..fe367b63 100644 --- a/webapp/src/app/api/model/dfgPersonSummaryPage.ts +++ b/webapp/src/app/api/model/dfgPersonSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { DfgPersonSummary } from './dfgPersonSummary'; - /** * A paginated response containing a list of persons. */ -export interface DfgPersonSummaryPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface DfgPersonSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/dfgProjectDetails.ts b/webapp/src/app/api/model/dfgProjectDetails.ts index 5fe29ff9..58ece5f7 100644 --- a/webapp/src/app/api/model/dfgProjectDetails.ts +++ b/webapp/src/app/api/model/dfgProjectDetails.ts @@ -1,41 +1,39 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Clean summary model for a DFG project, consolidating all person roles and institution references into unified lists. */ -export interface DfgProjectDetails { - /** - * The ID of the DFG project - */ - id: string; - link?: string | null; - title?: string | null; - description?: string | null; - project_identifier?: string | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - dfg_procedure?: string | null; - subject_area?: string | null; - funding_type?: string | null; - international_reference?: string | null; - website?: string | null; - /** - * All persons associated with the DFG project (any role) - */ - associated_persons?: Array; - /** - * All institutions associated with the DFG project - */ - institutions?: Array; - subproject_of?: string | null; +export interface DfgProjectDetails { + /** + * The ID of the DFG project + */ + id: string; + link?: string | null; + title?: string | null; + description?: string | null; + project_identifier?: string | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + dfg_procedure?: string | null; + subject_area?: string | null; + funding_type?: string | null; + international_reference?: string | null; + website?: string | null; + /** + * All persons associated with the DFG project (any role) + */ + associated_persons?: Array; + /** + * All institutions associated with the DFG project + */ + institutions?: Array; + subproject_of?: string | null; } - diff --git a/webapp/src/app/api/model/dfgProjectPage.ts b/webapp/src/app/api/model/dfgProjectPage.ts index 8f67e170..a05d81d2 100644 --- a/webapp/src/app/api/model/dfgProjectPage.ts +++ b/webapp/src/app/api/model/dfgProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { DfgProjectSummary } from './dfgProjectSummary'; - -export interface DfgProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The DFG projects on this page. - */ - elements?: Array; +export interface DfgProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The DFG projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts index c68e8926..cc1d2b59 100644 --- a/webapp/src/app/api/model/dfgProjectSummary.ts +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,30 +12,28 @@ import { DFGProjectFachgebieteInner } from './dFGProjectFachgebieteInner'; import { Topic } from './topic'; import { DfgPersonSummary } from './dfgPersonSummary'; - -export interface DfgProjectSummary { - /** - * The unique identifier of the DFG project. - */ - id: string; - link?: string | null; - title?: string | null; - professional_classification?: string | null; - funding_start?: string | null; - funding_end?: string | null; - /** - * Institutions associated with the project. - */ - institutions?: Array; - /** - * The names of the persons involved in the DFG project. - */ - names?: Array; - /** - * The persons involved in the DFG project. - */ - persons?: Array; - subject_classifications?: Array | null; - topics?: Array | null; +export interface DfgProjectSummary { + /** + * The unique identifier of the DFG project. + */ + id: string; + link?: string | null; + title?: string | null; + professional_classification?: string | null; + funding_start?: string | null; + funding_end?: string | null; + /** + * Institutions associated with the project. + */ + institutions?: Array; + /** + * The names of the persons involved in the DFG project. + */ + names?: Array; + /** + * The persons involved in the DFG project. + */ + persons?: Array; + subject_classifications?: Array | null; + topics?: Array | null; } - diff --git a/webapp/src/app/api/model/dockerHealth.ts b/webapp/src/app/api/model/dockerHealth.ts new file mode 100644 index 00000000..ba28ab8a --- /dev/null +++ b/webapp/src/app/api/model/dockerHealth.ts @@ -0,0 +1,14 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface DockerHealth { + reachable: boolean; + detail: string; +} diff --git a/webapp/src/app/api/model/euCordisEurosciVocSummary.ts b/webapp/src/app/api/model/euCordisEurosciVocSummary.ts index c45f9b09..0cc61d19 100644 --- a/webapp/src/app/api/model/euCordisEurosciVocSummary.ts +++ b/webapp/src/app/api/model/euCordisEurosciVocSummary.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface EuCordisEurosciVocSummary { - id?: string | null; - project_id?: string | null; - code?: string | null; - title?: string | null; - description?: string | null; - path?: string | null; +export interface EuCordisEurosciVocSummary { + id?: string | null; + project_id?: string | null; + code?: string | null; + title?: string | null; + description?: string | null; + path?: string | null; } - diff --git a/webapp/src/app/api/model/euCordisOrganizationSelectorPage.ts b/webapp/src/app/api/model/euCordisOrganizationSelectorPage.ts index 824bf430..262289ec 100644 --- a/webapp/src/app/api/model/euCordisOrganizationSelectorPage.ts +++ b/webapp/src/app/api/model/euCordisOrganizationSelectorPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,18 @@ */ import { EuCordisOrganizationSelectorSummary } from './euCordisOrganizationSelectorSummary'; - -export interface EuCordisOrganizationSelectorPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - elements?: Array; +export interface EuCordisOrganizationSelectorPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + elements?: Array; } - diff --git a/webapp/src/app/api/model/euCordisOrganizationSelectorSummary.ts b/webapp/src/app/api/model/euCordisOrganizationSelectorSummary.ts index 647c7a90..f6755908 100644 --- a/webapp/src/app/api/model/euCordisOrganizationSelectorSummary.ts +++ b/webapp/src/app/api/model/euCordisOrganizationSelectorSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,13 @@ */ import { EuCordisProjectType } from './euCordisProjectType'; - -export interface EuCordisOrganizationSelectorSummary { - id?: string | null; - organisation_id?: string | null; - name?: string | null; - short_name?: string | null; - country?: string | null; - city?: string | null; - project_type?: EuCordisProjectType | null; +export interface EuCordisOrganizationSelectorSummary { + id?: string | null; + organisation_id?: string | null; + name?: string | null; + short_name?: string | null; + country?: string | null; + city?: string | null; + project_type?: EuCordisProjectType | null; } -export namespace EuCordisOrganizationSelectorSummary { -} - - +export namespace EuCordisOrganizationSelectorSummary {} diff --git a/webapp/src/app/api/model/euCordisOrganizationSummary.ts b/webapp/src/app/api/model/euCordisOrganizationSummary.ts index 7fe70356..58669f58 100644 --- a/webapp/src/app/api/model/euCordisOrganizationSummary.ts +++ b/webapp/src/app/api/model/euCordisOrganizationSummary.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface EuCordisOrganizationSummary { - id?: string | null; - organisation_id?: string | null; - name?: string | null; - short_name?: string | null; - country?: string | null; - city?: string | null; - role?: string | null; - activity_type?: string | null; - project_id?: string | null; - ec_contribution?: number | null; - total_cost?: number | null; +export interface EuCordisOrganizationSummary { + id?: string | null; + organisation_id?: string | null; + name?: string | null; + short_name?: string | null; + country?: string | null; + city?: string | null; + role?: string | null; + activity_type?: string | null; + project_id?: string | null; + ec_contribution?: number | null; + total_cost?: number | null; } - diff --git a/webapp/src/app/api/model/euCordisProjectResponse.ts b/webapp/src/app/api/model/euCordisProjectResponse.ts index 63e9084d..f0dc272a 100644 --- a/webapp/src/app/api/model/euCordisProjectResponse.ts +++ b/webapp/src/app/api/model/euCordisProjectResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,15 @@ */ import { EuProjectData } from './euProjectData'; - /** * Response model for EU Cordis project endpoints. */ -export interface EuCordisProjectResponse { - /** - * Indicates if the request was successful - */ - success: boolean; - project_type?: string | null; - eu_project_data?: EuProjectData | null; - error?: string | null; +export interface EuCordisProjectResponse { + /** + * Indicates if the request was successful + */ + success: boolean; + project_type?: string | null; + eu_project_data?: EuProjectData | null; + error?: string | null; } - diff --git a/webapp/src/app/api/model/euCordisProjectSearchPage.ts b/webapp/src/app/api/model/euCordisProjectSearchPage.ts index c78066c6..b71d5c6f 100644 --- a/webapp/src/app/api/model/euCordisProjectSearchPage.ts +++ b/webapp/src/app/api/model/euCordisProjectSearchPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { EuCordisProjectSummary } from './euCordisProjectSummary'; - -export interface EuCordisProjectSearchPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The EU CORDIS project summaries on this page. - */ - elements?: Array; +export interface EuCordisProjectSearchPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The EU CORDIS project summaries on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/euCordisProjectSummary.ts b/webapp/src/app/api/model/euCordisProjectSummary.ts index 41197749..73ac3f54 100644 --- a/webapp/src/app/api/model/euCordisProjectSummary.ts +++ b/webapp/src/app/api/model/euCordisProjectSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,31 +14,27 @@ import { Topic } from './topic'; import { EuCordisOrganizationSummary } from './euCordisOrganizationSummary'; import { EuCordisProjectType } from './euCordisProjectType'; - -export interface EuCordisProjectSummary { - id: string; - project_type: EuCordisProjectType; - title?: string | null; - acronym?: string | null; - objective?: string | null; - keywords?: string | null; - framework_programme?: string | null; - funding_scheme?: string | null; - status?: string | null; - start_date?: string | null; - end_date?: string | null; - ec_max_contribution?: number | null; - total_cost?: number | null; - authors?: AuthorPage | null; - organizations?: Array; - cordis_topics?: Array; - eurosci_voc?: Array; - /** - * Mapped OpenAlex topics. - */ - topics?: Array; +export interface EuCordisProjectSummary { + id: string; + project_type: EuCordisProjectType; + title?: string | null; + acronym?: string | null; + objective?: string | null; + keywords?: string | null; + framework_programme?: string | null; + funding_scheme?: string | null; + status?: string | null; + start_date?: string | null; + end_date?: string | null; + ec_max_contribution?: number | null; + total_cost?: number | null; + authors?: AuthorPage | null; + organizations?: Array; + cordis_topics?: Array; + eurosci_voc?: Array; + /** + * Mapped OpenAlex topics. + */ + topics?: Array; } -export namespace EuCordisProjectSummary { -} - - +export namespace EuCordisProjectSummary {} diff --git a/webapp/src/app/api/model/euCordisProjectType.ts b/webapp/src/app/api/model/euCordisProjectType.ts index 7720922b..c8b81a73 100644 --- a/webapp/src/app/api/model/euCordisProjectType.ts +++ b/webapp/src/app/api/model/euCordisProjectType.ts @@ -1,18 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const EuCordisProjectType = { - Fp7: 'fp7', - H2020: 'h2020', - Heu: 'heu' + Fp7: 'fp7', + H2020: 'h2020', + Heu: 'heu', } as const; -export type EuCordisProjectType = typeof EuCordisProjectType[keyof typeof EuCordisProjectType]; - +export type EuCordisProjectType = + (typeof EuCordisProjectType)[keyof typeof EuCordisProjectType]; diff --git a/webapp/src/app/api/model/euCordisTopicSummary.ts b/webapp/src/app/api/model/euCordisTopicSummary.ts index c13fbb8b..8bacdb40 100644 --- a/webapp/src/app/api/model/euCordisTopicSummary.ts +++ b/webapp/src/app/api/model/euCordisTopicSummary.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface EuCordisTopicSummary { - id?: string | null; - project_id?: string | null; - title?: string | null; - topic?: string | null; +export interface EuCordisTopicSummary { + id?: string | null; + project_id?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/euProjectData.ts b/webapp/src/app/api/model/euProjectData.ts index 6acedaf5..34639d19 100644 --- a/webapp/src/app/api/model/euProjectData.ts +++ b/webapp/src/app/api/model/euProjectData.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -23,49 +23,47 @@ import { Fp7ReportSummary } from './fp7ReportSummary'; import { HEUReportSummary } from './hEUReportSummary'; import { HEUProjectDetails } from './hEUProjectDetails'; - /** * The project data */ -export interface EuProjectData { - acronym?: string; - contentUpdateDate?: string; - ecMaxContribution?: number; - ecSignatureDate?: string; - endDate?: string; - frameworkProgramme?: string; - fundingScheme?: string; - grantDoi?: string; - humanValidated?: boolean; - id?: string; - keywords?: string; - legalBasis?: string; - masterCall?: string; - nature?: string; - objective?: string; - rcn?: string; - startDate?: string; - status?: string; - subCall?: string; - title?: string; - topics?: string; - totalCost?: number; - organizations?: Array; - publications?: Array; - iprs?: Array; - report_summaries?: Array; - topicsList?: Array; - web_links?: Array; - eurosciVoc?: Array; - legalBasisList?: Array; - organizationCount?: number; - publicationCount?: number; - iprCount?: number; - deliverables?: Array; - reportSummaries?: Array; - webLinks?: Array; - ercPrincipalInvestigators?: Array; - deliverableCount?: number; - ercPiCount?: number; +export interface EuProjectData { + acronym?: string; + contentUpdateDate?: string; + ecMaxContribution?: number; + ecSignatureDate?: string; + endDate?: string; + frameworkProgramme?: string; + fundingScheme?: string; + grantDoi?: string; + humanValidated?: boolean; + id?: string; + keywords?: string; + legalBasis?: string; + masterCall?: string; + nature?: string; + objective?: string; + rcn?: string; + startDate?: string; + status?: string; + subCall?: string; + title?: string; + topics?: string; + totalCost?: number; + organizations?: Array; + publications?: Array; + iprs?: Array; + report_summaries?: Array; + topicsList?: Array; + web_links?: Array; + eurosciVoc?: Array; + legalBasisList?: Array; + organizationCount?: number; + publicationCount?: number; + iprCount?: number; + deliverables?: Array; + reportSummaries?: Array; + webLinks?: Array; + ercPrincipalInvestigators?: Array; + deliverableCount?: number; + ercPiCount?: number; } - diff --git a/webapp/src/app/api/model/extractedKeywords.ts b/webapp/src/app/api/model/extractedKeywords.ts index 8e74c6e0..4038c211 100644 --- a/webapp/src/app/api/model/extractedKeywords.ts +++ b/webapp/src/app/api/model/extractedKeywords.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { KeywordEntryWithTopic } from './keywordEntryWithTopic'; - -export interface ExtractedKeywords { - /** - * The extracted broad keywords from text. - */ - broad_keywords: Array; - /** - * The extracted coarse-grained keywords from text. - */ - coarse_grained: Array; - /** - * The extracted fine-grained keywords from text. - */ - fine_grained: Array; +export interface ExtractedKeywords { + /** + * The extracted broad keywords from text. + */ + broad_keywords: Array; + /** + * The extracted coarse-grained keywords from text. + */ + coarse_grained: Array; + /** + * The extracted fine-grained keywords from text. + */ + fine_grained: Array; } - diff --git a/webapp/src/app/api/model/extractedKeywordsLLM.ts b/webapp/src/app/api/model/extractedKeywordsLLM.ts index b12957f6..b49b98d7 100644 --- a/webapp/src/app/api/model/extractedKeywordsLLM.ts +++ b/webapp/src/app/api/model/extractedKeywordsLLM.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { KeywordEntry } from './keywordEntry'; - -export interface ExtractedKeywordsLLM { - /** - * The extracted broad keywords from text. - */ - broad_keywords: Array; - /** - * The extracted coarse-grained keywords from text. - */ - coarse_grained: Array; - /** - * The extracted fine-grained keywords from text. - */ - fine_grained: Array; +export interface ExtractedKeywordsLLM { + /** + * The extracted broad keywords from text. + */ + broad_keywords: Array; + /** + * The extracted coarse-grained keywords from text. + */ + coarse_grained: Array; + /** + * The extracted fine-grained keywords from text. + */ + fine_grained: Array; } - diff --git a/webapp/src/app/api/model/extractedKeywordsResponse.ts b/webapp/src/app/api/model/extractedKeywordsResponse.ts index 43731b7c..8fe10a5f 100644 --- a/webapp/src/app/api/model/extractedKeywordsResponse.ts +++ b/webapp/src/app/api/model/extractedKeywordsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,19 +10,17 @@ import { ExtractedKeywordsLLM } from './extractedKeywordsLLM'; import { ExtractedKeywords } from './extractedKeywords'; - -export interface ExtractedKeywordsResponse { - results_llm?: ExtractedKeywordsLLM | null; - results?: ExtractedKeywords | null; - /** - * The source of the input text, e.g., \'url\', \'text\', or \'keywords\'. - */ - source: string; - source_url?: string | null; - /** - * The actual content from which keywords were extracted. - */ - source_content: string; - duration?: number | null; +export interface ExtractedKeywordsResponse { + results_llm?: ExtractedKeywordsLLM | null; + results?: ExtractedKeywords | null; + /** + * The source of the input text, e.g., \'url\', \'text\', or \'keywords\'. + */ + source: string; + source_url?: string | null; + /** + * The actual content from which keywords were extracted. + */ + source_content: string; + duration?: number | null; } - diff --git a/webapp/src/app/api/model/fileUpload.ts b/webapp/src/app/api/model/fileUpload.ts index 61722b2f..921db4c3 100644 --- a/webapp/src/app/api/model/fileUpload.ts +++ b/webapp/src/app/api/model/fileUpload.ts @@ -1,26 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface FileUpload { - /** - * The name of the uploaded file. - */ - filename: string; - /** - * The base64-encoded content of the uploaded file. - */ - content_base64: string; - /** - * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. - */ - mime_type: string; +export interface FileUpload { + /** + * The name of the uploaded file. + */ + filename: string; + /** + * The base64-encoded content of the uploaded file. + */ + content_base64: string; + /** + * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. + */ + mime_type: string; } - diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts index b2078376..1c4af66d 100644 --- a/webapp/src/app/api/model/filterInformation.ts +++ b/webapp/src/app/api/model/filterInformation.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,23 +10,21 @@ import { InstitutionInformation } from './institutionInformation'; import { WorkTopicInformation } from './workTopicInformation'; - -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; } - diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts index 608acab4..7caac0b6 100644 --- a/webapp/src/app/api/model/filterProperties.ts +++ b/webapp/src/app/api/model/filterProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,13 +10,11 @@ import { WorksFilterProperties } from './worksFilterProperties'; import { AuthorsFilterProperties } from './authorsFilterProperties'; - -export interface FilterProperties { - /** - * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. - */ - filter_by?: string; - works_filter_properties: WorksFilterProperties | null; - authors_filter_properties: AuthorsFilterProperties | null; +export interface FilterProperties { + /** + * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. + */ + filter_by?: string; + works_filter_properties: WorksFilterProperties | null; + authors_filter_properties: AuthorsFilterProperties | null; } - diff --git a/webapp/src/app/api/model/filterType.ts b/webapp/src/app/api/model/filterType.ts index bee9d0d7..c1997c4e 100644 --- a/webapp/src/app/api/model/filterType.ts +++ b/webapp/src/app/api/model/filterType.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const FilterType = { - Keyword: 'keyword', - Topic: 'topic' + Keyword: 'keyword', + Topic: 'topic', } as const; -export type FilterType = typeof FilterType[keyof typeof FilterType]; - +export type FilterType = (typeof FilterType)[keyof typeof FilterType]; diff --git a/webapp/src/app/api/model/fp7EurosciVoc.ts b/webapp/src/app/api/model/fp7EurosciVoc.ts index fb7e8deb..14ae95bc 100644 --- a/webapp/src/app/api/model/fp7EurosciVoc.ts +++ b/webapp/src/app/api/model/fp7EurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7EurosciVoc */ -export interface Fp7EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface Fp7EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/fp7LegalBasis.ts b/webapp/src/app/api/model/fp7LegalBasis.ts index 89a05742..bf5ef53e 100644 --- a/webapp/src/app/api/model/fp7LegalBasis.ts +++ b/webapp/src/app/api/model/fp7LegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7LegalBasis */ -export interface Fp7LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface Fp7LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Organization.ts b/webapp/src/app/api/model/fp7Organization.ts index 2989a873..a46d9d02 100644 --- a/webapp/src/app/api/model/fp7Organization.ts +++ b/webapp/src/app/api/model/fp7Organization.ts @@ -1,43 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7Organization */ -export interface Fp7Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface Fp7Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/fp7ProjectDetails.ts b/webapp/src/app/api/model/fp7ProjectDetails.ts index a7dce634..034a986d 100644 --- a/webapp/src/app/api/model/fp7ProjectDetails.ts +++ b/webapp/src/app/api/model/fp7ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,43 +16,41 @@ import { Fp7ProjectIPR } from './fp7ProjectIPR'; import { Fp7Organization } from './fp7Organization'; import { Fp7LegalBasis } from './fp7LegalBasis'; - /** * Comprehensive FP7 Project model combining all related entities. This model extends the base Fp7Project with all associated data. */ -export interface Fp7ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - iprs?: Array | null; - report_summaries?: Array | null; - topicsList?: Array | null; - web_links?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - iprCount?: number | null; +export interface Fp7ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + iprs?: Array | null; + report_summaries?: Array | null; + topicsList?: Array | null; + web_links?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + iprCount?: number | null; } - diff --git a/webapp/src/app/api/model/fp7ProjectIPR.ts b/webapp/src/app/api/model/fp7ProjectIPR.ts index f35487c4..37040026 100644 --- a/webapp/src/app/api/model/fp7ProjectIPR.ts +++ b/webapp/src/app/api/model/fp7ProjectIPR.ts @@ -1,36 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7ProjectIPR */ -export interface Fp7ProjectIPR { - applicantName?: string | null; - applicationDate?: string | null; - applicationIdentifier?: string | null; - applicationKind?: string | null; - applicationPrefix?: string | null; - awardDate?: string | null; - awardIdentifier?: string | null; - awardKind?: string | null; - awardPrefix?: string | null; - epoAppUrl?: string | null; - epoPubUrl?: string | null; - id?: string | null; - organisationID?: string | null; - patentFamilyIdentifier?: string | null; - patentType?: string | null; - priorityDate?: string | null; - projectID?: string | null; - title?: string | null; - type?: string | null; +export interface Fp7ProjectIPR { + applicantName?: string | null; + applicationDate?: string | null; + applicationIdentifier?: string | null; + applicationKind?: string | null; + applicationPrefix?: string | null; + awardDate?: string | null; + awardIdentifier?: string | null; + awardKind?: string | null; + awardPrefix?: string | null; + epoAppUrl?: string | null; + epoPubUrl?: string | null; + id?: string | null; + organisationID?: string | null; + patentFamilyIdentifier?: string | null; + patentType?: string | null; + priorityDate?: string | null; + projectID?: string | null; + title?: string | null; + type?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Publication.ts b/webapp/src/app/api/model/fp7Publication.ts index fd0e2491..34fba260 100644 --- a/webapp/src/app/api/model/fp7Publication.ts +++ b/webapp/src/app/api/model/fp7Publication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7Publication */ -export interface Fp7Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface Fp7Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/fp7ReportSummary.ts b/webapp/src/app/api/model/fp7ReportSummary.ts index f0413439..084d2ba8 100644 --- a/webapp/src/app/api/model/fp7ReportSummary.ts +++ b/webapp/src/app/api/model/fp7ReportSummary.ts @@ -1,24 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7ReportSummary */ -export interface Fp7ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface Fp7ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Topic.ts b/webapp/src/app/api/model/fp7Topic.ts index f39a021e..4202cdb0 100644 --- a/webapp/src/app/api/model/fp7Topic.ts +++ b/webapp/src/app/api/model/fp7Topic.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7Topic */ -export interface Fp7Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface Fp7Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/fp7WebLink.ts b/webapp/src/app/api/model/fp7WebLink.ts index eeaff7ab..67071bb8 100644 --- a/webapp/src/app/api/model/fp7WebLink.ts +++ b/webapp/src/app/api/model/fp7WebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7WebLink */ -export interface Fp7WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface Fp7WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts index 247e5629..c62110e7 100644 --- a/webapp/src/app/api/model/funderByAuthor.ts +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,15 +11,13 @@ import { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition import { AuthorPositionCount } from './authorPositionCount'; import { PublicationDetailByFunder } from './publicationDetailByFunder'; - -export interface FunderByAuthor { - funder_id?: string | null; - funder_name?: string | null; - publication_count: number; - author_position_count: AuthorPositionCount; - publication_ids: PublicationIdsByAuthorPosition; - publication_urls?: { [key: string]: string; }; - publication_titles?: { [key: string]: string; }; - publication_details?: { [key: string]: PublicationDetailByFunder; }; +export interface FunderByAuthor { + funder_id?: string | null; + funder_name?: string | null; + publication_count: number; + author_position_count: AuthorPositionCount; + publication_ids: PublicationIdsByAuthorPosition; + publication_urls?: { [key: string]: string }; + publication_titles?: { [key: string]: string }; + publication_details?: { [key: string]: PublicationDetailByFunder }; } - diff --git a/webapp/src/app/api/model/fundersByAuthorResponse.ts b/webapp/src/app/api/model/fundersByAuthorResponse.ts index 1286429e..d6e0e02f 100644 --- a/webapp/src/app/api/model/fundersByAuthorResponse.ts +++ b/webapp/src/app/api/model/fundersByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { FunderByAuthor } from './funderByAuthor'; - -export interface FundersByAuthorResponse { - author_id: string; - author_name?: string | null; - funder_count: number; - funders: Array; +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; } - diff --git a/webapp/src/app/api/model/fundingProject.ts b/webapp/src/app/api/model/fundingProject.ts index a53c64f1..fb8204e3 100644 --- a/webapp/src/app/api/model/fundingProject.ts +++ b/webapp/src/app/api/model/fundingProject.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,19 @@ */ import { ProjectType } from './projectType'; - -export interface FundingProject { - /** - * The type of the project. - */ - type: ProjectType; - /** - * The unique identifier of the project. - */ - id: string; - title?: string | null; - acronym?: string | null; - start_date?: string | null; - end_date?: string | null; - funding_amount?: number | null; +export interface FundingProject { + /** + * The type of the project. + */ + type: ProjectType; + /** + * The unique identifier of the project. + */ + id: string; + title?: string | null; + acronym?: string | null; + start_date?: string | null; + end_date?: string | null; + funding_amount?: number | null; } -export namespace FundingProject { -} - - +export namespace FundingProject {} diff --git a/webapp/src/app/api/model/fundingProjectPage.ts b/webapp/src/app/api/model/fundingProjectPage.ts index db43c9c4..e0996525 100644 --- a/webapp/src/app/api/model/fundingProjectPage.ts +++ b/webapp/src/app/api/model/fundingProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { FundingProject } from './fundingProject'; - -export interface FundingProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The funding projects on this page. - */ - elements?: Array; +export interface FundingProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The funding projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/fwci.ts b/webapp/src/app/api/model/fwci.ts index 0c0cf8de..bd7eea69 100644 --- a/webapp/src/app/api/model/fwci.ts +++ b/webapp/src/app/api/model/fwci.ts @@ -1,17 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Field-weighted Citation Impact, calculated as citations received / citations expected. */ -export interface Fwci { -} - +export interface Fwci {} diff --git a/webapp/src/app/api/model/groupByResult.ts b/webapp/src/app/api/model/groupByResult.ts index 68c51855..98580663 100644 --- a/webapp/src/app/api/model/groupByResult.ts +++ b/webapp/src/app/api/model/groupByResult.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * GroupByResult */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; +export interface GroupByResult { + key?: string | null; + key_display_name?: string | null; + count?: number | null; } - diff --git a/webapp/src/app/api/model/h2020Deliverable.ts b/webapp/src/app/api/model/h2020Deliverable.ts index 390d2c7a..ccb837a1 100644 --- a/webapp/src/app/api/model/h2020Deliverable.ts +++ b/webapp/src/app/api/model/h2020Deliverable.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Deliverable */ -export interface H2020Deliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface H2020Deliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ErcPI.ts b/webapp/src/app/api/model/h2020ErcPI.ts index 48ae3ff0..d6e2324e 100644 --- a/webapp/src/app/api/model/h2020ErcPI.ts +++ b/webapp/src/app/api/model/h2020ErcPI.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020ErcPI */ -export interface H2020ErcPI { - firstName?: string | null; - fundingScheme?: string | null; - id?: string | null; - lastName?: string | null; - organisationID?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020ErcPI { + firstName?: string | null; + fundingScheme?: string | null; + id?: string | null; + lastName?: string | null; + organisationID?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020EurosciVoc.ts b/webapp/src/app/api/model/h2020EurosciVoc.ts index 7d1ea931..b275e94e 100644 --- a/webapp/src/app/api/model/h2020EurosciVoc.ts +++ b/webapp/src/app/api/model/h2020EurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020EurosciVoc */ -export interface H2020EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020LegalBasis.ts b/webapp/src/app/api/model/h2020LegalBasis.ts index d247488d..e5846466 100644 --- a/webapp/src/app/api/model/h2020LegalBasis.ts +++ b/webapp/src/app/api/model/h2020LegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020LegalBasis */ -export interface H2020LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface H2020LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/h2020Organization.ts b/webapp/src/app/api/model/h2020Organization.ts index 003a00ed..26a5acb9 100644 --- a/webapp/src/app/api/model/h2020Organization.ts +++ b/webapp/src/app/api/model/h2020Organization.ts @@ -1,43 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Organization */ -export interface H2020Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface H2020Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ProjectDetails.ts b/webapp/src/app/api/model/h2020ProjectDetails.ts index 7d08134e..f06b2fe5 100644 --- a/webapp/src/app/api/model/h2020ProjectDetails.ts +++ b/webapp/src/app/api/model/h2020ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -17,45 +17,43 @@ import { H2020Topic } from './h2020Topic'; import { H2020EurosciVoc } from './h2020EurosciVoc'; import { H2020Organization } from './h2020Organization'; - /** * Comprehensive Horizon 2020 Project model combining all related entities. This model extends the base H2020Project with all associated data. */ -export interface H2020ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - ercPrincipalInvestigators?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; - ercPiCount?: number | null; +export interface H2020ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + ercPrincipalInvestigators?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; + ercPiCount?: number | null; } - diff --git a/webapp/src/app/api/model/h2020Publication.ts b/webapp/src/app/api/model/h2020Publication.ts index 945e22d2..bb84dd6e 100644 --- a/webapp/src/app/api/model/h2020Publication.ts +++ b/webapp/src/app/api/model/h2020Publication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Publication */ -export interface H2020Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface H2020Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ReportSummary.ts b/webapp/src/app/api/model/h2020ReportSummary.ts index a5975ffb..2a9989c8 100644 --- a/webapp/src/app/api/model/h2020ReportSummary.ts +++ b/webapp/src/app/api/model/h2020ReportSummary.ts @@ -1,24 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020ReportSummary */ -export interface H2020ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface H2020ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020Topic.ts b/webapp/src/app/api/model/h2020Topic.ts index 8ddb1991..8573a661 100644 --- a/webapp/src/app/api/model/h2020Topic.ts +++ b/webapp/src/app/api/model/h2020Topic.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Topic */ -export interface H2020Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface H2020Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/h2020WebLink.ts b/webapp/src/app/api/model/h2020WebLink.ts index 26d54599..ce8e8f93 100644 --- a/webapp/src/app/api/model/h2020WebLink.ts +++ b/webapp/src/app/api/model/h2020WebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020WebLink */ -export interface H2020WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface H2020WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hEUDeliverable.ts b/webapp/src/app/api/model/hEUDeliverable.ts index 05d8c5ba..4645913d 100644 --- a/webapp/src/app/api/model/hEUDeliverable.ts +++ b/webapp/src/app/api/model/hEUDeliverable.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUDeliverable */ -export interface HEUDeliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface HEUDeliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hEUEurosciVoc.ts b/webapp/src/app/api/model/hEUEurosciVoc.ts index 93921ab7..38fe125e 100644 --- a/webapp/src/app/api/model/hEUEurosciVoc.ts +++ b/webapp/src/app/api/model/hEUEurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUEurosciVoc */ -export interface HEUEurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface HEUEurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/hEULegalBasis.ts b/webapp/src/app/api/model/hEULegalBasis.ts index e3cb66ca..a02eebd0 100644 --- a/webapp/src/app/api/model/hEULegalBasis.ts +++ b/webapp/src/app/api/model/hEULegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEULegalBasis */ -export interface HEULegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface HEULegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/hEUOrganization.ts b/webapp/src/app/api/model/hEUOrganization.ts index 6bb193ef..1dcd1615 100644 --- a/webapp/src/app/api/model/hEUOrganization.ts +++ b/webapp/src/app/api/model/hEUOrganization.ts @@ -1,43 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUOrganization */ -export interface HEUOrganization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface HEUOrganization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/hEUProjectDetails.ts b/webapp/src/app/api/model/hEUProjectDetails.ts index 8a897435..f7a46271 100644 --- a/webapp/src/app/api/model/hEUProjectDetails.ts +++ b/webapp/src/app/api/model/hEUProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,43 +16,41 @@ import { HEUReportSummary } from './hEUReportSummary'; import { HEUDeliverable } from './hEUDeliverable'; import { HEUEurosciVoc } from './hEUEurosciVoc'; - /** * Comprehensive Horizon Europe Project model combining all related entities. This model extends the base HEUProject with all associated data. */ -export interface HEUProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; +export interface HEUProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; } - diff --git a/webapp/src/app/api/model/hEUPublication.ts b/webapp/src/app/api/model/hEUPublication.ts index 4d067177..86d59473 100644 --- a/webapp/src/app/api/model/hEUPublication.ts +++ b/webapp/src/app/api/model/hEUPublication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUPublication */ -export interface HEUPublication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface HEUPublication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/hEUReportSummary.ts b/webapp/src/app/api/model/hEUReportSummary.ts index b9e1a299..94f58b4c 100644 --- a/webapp/src/app/api/model/hEUReportSummary.ts +++ b/webapp/src/app/api/model/hEUReportSummary.ts @@ -1,24 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUReportSummary */ -export interface HEUReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface HEUReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/hEUTopic.ts b/webapp/src/app/api/model/hEUTopic.ts index a0a5e764..ccd60c27 100644 --- a/webapp/src/app/api/model/hEUTopic.ts +++ b/webapp/src/app/api/model/hEUTopic.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUTopic */ -export interface HEUTopic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface HEUTopic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/hEUWebLink.ts b/webapp/src/app/api/model/hEUWebLink.ts index 81c5d60f..1159d2a6 100644 --- a/webapp/src/app/api/model/hEUWebLink.ts +++ b/webapp/src/app/api/model/hEUWebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUWebLink */ -export interface HEUWebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface HEUWebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/hTTPValidationError.ts index f624be37..c8e65c3e 100644 --- a/webapp/src/app/api/model/hTTPValidationError.ts +++ b/webapp/src/app/api/model/hTTPValidationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,6 @@ */ import { ValidationError } from './validationError'; - -export interface HTTPValidationError { - detail?: Array; +export interface HTTPValidationError { + detail?: Array; } - diff --git a/webapp/src/app/api/model/idTokenMetadata.ts b/webapp/src/app/api/model/idTokenMetadata.ts index 5398083d..ab99fb1c 100644 --- a/webapp/src/app/api/model/idTokenMetadata.ts +++ b/webapp/src/app/api/model/idTokenMetadata.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,22 @@ */ import { TokenType } from './tokenType'; - -export interface IdTokenMetadata { - /** - * The unique identifier of the real account associated with this token. - */ - real_account_id: string; - /** - * The timestamp indicating when the token will expire. - */ - expires_at: string; - /** - * The epoch value for the token. Used for versioning of tokens. - */ - epoch?: number; - /** - * The type of the token, which is always ID_TOKEN for this class. - */ - token_type?: TokenType; +export interface IdTokenMetadata { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ID_TOKEN for this class. + */ + token_type?: TokenType; } -export namespace IdTokenMetadata { -} - - +export namespace IdTokenMetadata {} diff --git a/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts b/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts index c67acc71..47235351 100644 --- a/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts +++ b/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface InseAccountManagementModelOrganizationProfile { - id: string; - name: string; - openalex_institution_id?: string | null; +export interface InseAccountManagementModelOrganizationProfile { + id: string; + name: string; + openalex_institution_id?: string | null; } - diff --git a/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts b/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts index 404df0f9..8f9f0e6b 100644 --- a/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts +++ b/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface InseOrganizationManagementModelOrganizationProfile { - id: string; - name: string; - other_inst_id?: string | null; - deleted: boolean; - member_count: number; +export interface InseOrganizationManagementModelOrganizationProfile { + id: string; + name: string; + other_inst_id?: string | null; + deleted: boolean; + member_count: number; } - diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts index 6b1a5778..c099fc57 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,30 +12,28 @@ import { AuthorCountsByYearInner } from './authorCountsByYearInner'; import { AuthorSummaryStats } from './authorSummaryStats'; import { InstitutionGeo } from './institutionGeo'; - /** * A university, research organization, or other affiliation */ -export interface Institution { - id?: string | null; - ror?: string | null; - display_name?: string | null; - country_code?: string | null; - type?: string | null; - homepage_url?: string | null; - image_url?: string | null; - image_thumbnail_url?: string | null; - display_name_acronyms?: Array | null; - display_name_alternatives?: Array | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - geo?: InstitutionGeo | null; - lineage?: Array | null; - ids?: InstitutionIds | null; - counts_by_year?: Array | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/institutionFunderSummary.ts b/webapp/src/app/api/model/institutionFunderSummary.ts index 48d147b2..cf15754a 100644 --- a/webapp/src/app/api/model/institutionFunderSummary.ts +++ b/webapp/src/app/api/model/institutionFunderSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { ProjectType } from './projectType'; - -export interface InstitutionFunderSummary { - /** - * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). - */ - type: ProjectType; - /** - * A dictionary mapping years to total funding amounts for that year. - */ - funding_per_year?: object; - /** - * The average annual funding over the continuous period covered by the data. - */ - annual_average_over_period?: number; +export interface InstitutionFunderSummary { + /** + * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). + */ + type: ProjectType; + /** + * A dictionary mapping years to total funding amounts for that year. + */ + funding_per_year?: object; + /** + * The average annual funding over the continuous period covered by the data. + */ + annual_average_over_period?: number; } -export namespace InstitutionFunderSummary { -} - - +export namespace InstitutionFunderSummary {} diff --git a/webapp/src/app/api/model/institutionGeo.ts b/webapp/src/app/api/model/institutionGeo.ts index 949b73f4..b438d37c 100644 --- a/webapp/src/app/api/model/institutionGeo.ts +++ b/webapp/src/app/api/model/institutionGeo.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,15 @@ import { Latitude } from './latitude'; import { Longitude } from './longitude'; - /** * Location information: */ -export interface InstitutionGeo { - city?: string | null; - geonames_city_id?: string | null; - region?: string | null; - country_code?: string | null; - country?: string | null; - latitude?: Latitude | null; - longitude?: Longitude | null; +export interface InstitutionGeo { + city?: string | null; + geonames_city_id?: string | null; + region?: string | null; + country_code?: string | null; + country?: string | null; + latitude?: Latitude | null; + longitude?: Longitude | null; } - diff --git a/webapp/src/app/api/model/institutionIds.ts b/webapp/src/app/api/model/institutionIds.ts index 93d801e1..fd952098 100644 --- a/webapp/src/app/api/model/institutionIds.ts +++ b/webapp/src/app/api/model/institutionIds.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: */ -export interface InstitutionIds { - openalex?: string | null; - ror?: string | null; - mag?: number | null; - grid?: string | null; - wikipedia?: string | null; - wikidata?: string | null; +export interface InstitutionIds { + openalex?: string | null; + ror?: string | null; + mag?: number | null; + grid?: string | null; + wikipedia?: string | null; + wikidata?: string | null; } - diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts index e287b0fa..9e12986d 100644 --- a/webapp/src/app/api/model/institutionInformation.ts +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; } - diff --git a/webapp/src/app/api/model/institutionNetworkNode.ts b/webapp/src/app/api/model/institutionNetworkNode.ts index a558a8cf..791645b7 100644 --- a/webapp/src/app/api/model/institutionNetworkNode.ts +++ b/webapp/src/app/api/model/institutionNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface InstitutionNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; +export interface InstitutionNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace InstitutionNetworkNode { -} - - +export namespace InstitutionNetworkNode {} diff --git a/webapp/src/app/api/model/institutionPage.ts b/webapp/src/app/api/model/institutionPage.ts index 01267ee3..b7640651 100644 --- a/webapp/src/app/api/model/institutionPage.ts +++ b/webapp/src/app/api/model/institutionPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Institution } from './institution'; - -export interface InstitutionPage { - /** - * List of institutions in the current page. - */ - elements?: Array; - /** - * Current page number. (0-indexed) - */ - page?: number; - /** - * Number of institutions per page. - */ - size?: number; - /** - * Total number of institutions matching the search criteria. - */ - total?: number; +export interface InstitutionPage { + /** + * List of institutions in the current page. + */ + elements?: Array; + /** + * Current page number. (0-indexed) + */ + page?: number; + /** + * Number of institutions per page. + */ + size?: number; + /** + * Total number of institutions matching the search criteria. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/institutionPageV2.ts b/webapp/src/app/api/model/institutionPageV2.ts index 15f481f6..67017198 100644 --- a/webapp/src/app/api/model/institutionPageV2.ts +++ b/webapp/src/app/api/model/institutionPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { Institution } from './institution'; - /** * A paginated response containing a list of institutions. */ -export interface InstitutionPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface InstitutionPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/institutionsListResponse.ts b/webapp/src/app/api/model/institutionsListResponse.ts index 908d72fe..0ac2c185 100644 --- a/webapp/src/app/api/model/institutionsListResponse.ts +++ b/webapp/src/app/api/model/institutionsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Institution } from './institution'; import { GroupByResult } from './groupByResult'; - /** * InstitutionsListResponse */ -export interface InstitutionsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface InstitutionsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/ipcClassification.ts b/webapp/src/app/api/model/ipcClassification.ts index 74805329..b7e65c0d 100644 --- a/webapp/src/app/api/model/ipcClassification.ts +++ b/webapp/src/app/api/model/ipcClassification.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface IpcClassification { - symbol: string; - section?: string | null; - 'class'?: string | null; - subclass?: string | null; - main_group?: string | null; - subgroup?: string | null; +export interface IpcClassification { + symbol: string; + section?: string | null; + class?: string | null; + subclass?: string | null; + main_group?: string | null; + subgroup?: string | null; } - diff --git a/webapp/src/app/api/model/jobDefinitionCreateRequest.ts b/webapp/src/app/api/model/jobDefinitionCreateRequest.ts new file mode 100644 index 00000000..b171e1d8 --- /dev/null +++ b/webapp/src/app/api/model/jobDefinitionCreateRequest.ts @@ -0,0 +1,19 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export interface JobDefinitionCreateRequest { + name: string; + image?: string | null; + command?: string | null; + env?: { [key: string]: string }; + description?: string; + target_index?: string; + schedule?: string | null; + enabled?: boolean; +} diff --git a/webapp/src/app/api/model/jobDefinitionUpdateRequest.ts b/webapp/src/app/api/model/jobDefinitionUpdateRequest.ts new file mode 100644 index 00000000..efd8d096 --- /dev/null +++ b/webapp/src/app/api/model/jobDefinitionUpdateRequest.ts @@ -0,0 +1,19 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +export interface JobDefinitionUpdateRequest { + name?: string | null; + image?: string | null; + command?: string | null; + env?: { [key: string]: string } | null; + description?: string | null; + target_index?: string | null; + schedule?: string | null; + enabled?: boolean | null; +} diff --git a/webapp/src/app/api/model/jobRun.ts b/webapp/src/app/api/model/jobRun.ts new file mode 100644 index 00000000..20346ae6 --- /dev/null +++ b/webapp/src/app/api/model/jobRun.ts @@ -0,0 +1,27 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { JobRunStatus } from './jobRunStatus'; +import { JobTriggeredBy } from './jobTriggeredBy'; + +export interface JobRun { + id?: number | null; + definition_id: number; + container_id?: string | null; + status?: JobRunStatus; + /** + * Whether the scheduler or a superadmin started this run. + */ + triggered_by: JobTriggeredBy; + started_at?: string; + finished_at?: string | null; + exit_code?: number | null; + logs?: string | null; +} +export namespace JobRun {} diff --git a/webapp/src/app/api/model/jobRunLogs.ts b/webapp/src/app/api/model/jobRunLogs.ts new file mode 100644 index 00000000..423a6f1a --- /dev/null +++ b/webapp/src/app/api/model/jobRunLogs.ts @@ -0,0 +1,17 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { JobRunStatus } from './jobRunStatus'; + +export interface JobRunLogs { + run_id: number; + status: JobRunStatus; + logs: string; +} +export namespace JobRunLogs {} diff --git a/webapp/src/app/api/model/jobRunStatus.ts b/webapp/src/app/api/model/jobRunStatus.ts new file mode 100644 index 00000000..d50886b4 --- /dev/null +++ b/webapp/src/app/api/model/jobRunStatus.ts @@ -0,0 +1,17 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export const JobRunStatus = { + Running: 'running', + Succeeded: 'succeeded', + Failed: 'failed', + Stopped: 'stopped', +} as const; +export type JobRunStatus = (typeof JobRunStatus)[keyof typeof JobRunStatus]; diff --git a/webapp/src/app/api/model/jobTriggeredBy.ts b/webapp/src/app/api/model/jobTriggeredBy.ts new file mode 100644 index 00000000..4ace1836 --- /dev/null +++ b/webapp/src/app/api/model/jobTriggeredBy.ts @@ -0,0 +1,16 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export const JobTriggeredBy = { + Schedule: 'schedule', + Manual: 'manual', +} as const; +export type JobTriggeredBy = + (typeof JobTriggeredBy)[keyof typeof JobTriggeredBy]; diff --git a/webapp/src/app/api/model/keywordEntry.ts b/webapp/src/app/api/model/keywordEntry.ts index e8e9cc5c..94dd6e18 100644 --- a/webapp/src/app/api/model/keywordEntry.ts +++ b/webapp/src/app/api/model/keywordEntry.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface KeywordEntry { - /** - * The extracted keyword. - */ - keyword: string; - /** - * The relevance score of the keyword. - */ - relevance_score: number; +export interface KeywordEntry { + /** + * The extracted keyword. + */ + keyword: string; + /** + * The relevance score of the keyword. + */ + relevance_score: number; } - diff --git a/webapp/src/app/api/model/keywordEntryWithTopic.ts b/webapp/src/app/api/model/keywordEntryWithTopic.ts index 6680e773..4670f554 100644 --- a/webapp/src/app/api/model/keywordEntryWithTopic.ts +++ b/webapp/src/app/api/model/keywordEntryWithTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,12 +10,10 @@ import { KeywordEntry } from './keywordEntry'; import { KeywordTopicMatch } from './keywordTopicMatch'; - -export interface KeywordEntryWithTopic { - /** - * The keyword extracted by the LLM. - */ - llm_keyword: KeywordEntry; - topic_mapping?: KeywordTopicMatch | null; +export interface KeywordEntryWithTopic { + /** + * The keyword extracted by the LLM. + */ + llm_keyword: KeywordEntry; + topic_mapping?: KeywordTopicMatch | null; } - diff --git a/webapp/src/app/api/model/keywordEvidence.ts b/webapp/src/app/api/model/keywordEvidence.ts index a8a78209..9b131bc1 100644 --- a/webapp/src/app/api/model/keywordEvidence.ts +++ b/webapp/src/app/api/model/keywordEvidence.ts @@ -1,28 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Traceable title/abstract evidence for keyword text retrieval. */ -export interface KeywordEvidence { - phrase_in_title?: boolean; - phrase_in_abstract?: boolean; - full_token_match?: boolean; - partial_token_match?: boolean; - word_match_score?: number; - matched_phrases?: Array; - matched_words?: Array; - /** - * phrase_title | phrase_abstract | full_token | partial_token | none - */ - text_match_kind?: string; +export interface KeywordEvidence { + phrase_in_title?: boolean; + phrase_in_abstract?: boolean; + full_token_match?: boolean; + partial_token_match?: boolean; + word_match_score?: number; + matched_phrases?: Array; + matched_words?: Array; + /** + * phrase_title | phrase_abstract | full_token | partial_token | none + */ + text_match_kind?: string; } - diff --git a/webapp/src/app/api/model/keywordOperator.ts b/webapp/src/app/api/model/keywordOperator.ts index d4d4bf1f..1ef773d3 100644 --- a/webapp/src/app/api/model/keywordOperator.ts +++ b/webapp/src/app/api/model/keywordOperator.ts @@ -1,17 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const KeywordOperator = { - And: 'and', - Or: 'or' + And: 'and', + Or: 'or', } as const; -export type KeywordOperator = typeof KeywordOperator[keyof typeof KeywordOperator]; - +export type KeywordOperator = + (typeof KeywordOperator)[keyof typeof KeywordOperator]; diff --git a/webapp/src/app/api/model/keywordPatentLevel.ts b/webapp/src/app/api/model/keywordPatentLevel.ts index 3522ae9e..97689af9 100644 --- a/webapp/src/app/api/model/keywordPatentLevel.ts +++ b/webapp/src/app/api/model/keywordPatentLevel.ts @@ -1,19 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const KeywordPatentLevel = { - Broad: 'broad', - Coarse: 'coarse', - Fine: 'fine', - Custom: 'custom' + Broad: 'broad', + Coarse: 'coarse', + Fine: 'fine', + Custom: 'custom', } as const; -export type KeywordPatentLevel = typeof KeywordPatentLevel[keyof typeof KeywordPatentLevel]; - +export type KeywordPatentLevel = + (typeof KeywordPatentLevel)[keyof typeof KeywordPatentLevel]; diff --git a/webapp/src/app/api/model/keywordPatentMappingStatus.ts b/webapp/src/app/api/model/keywordPatentMappingStatus.ts index a820fed5..23b2c4d1 100644 --- a/webapp/src/app/api/model/keywordPatentMappingStatus.ts +++ b/webapp/src/app/api/model/keywordPatentMappingStatus.ts @@ -1,20 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const KeywordPatentMappingStatus = { - Mapped: 'mapped', - Uncertain: 'uncertain', - NoMapping: 'no_mapping', - NoPatentsFound: 'no_patents_found', - SearchError: 'search_error' + Mapped: 'mapped', + Uncertain: 'uncertain', + NoMapping: 'no_mapping', + NoPatentsFound: 'no_patents_found', + SearchError: 'search_error', } as const; -export type KeywordPatentMappingStatus = typeof KeywordPatentMappingStatus[keyof typeof KeywordPatentMappingStatus]; - +export type KeywordPatentMappingStatus = + (typeof KeywordPatentMappingStatus)[keyof typeof KeywordPatentMappingStatus]; diff --git a/webapp/src/app/api/model/keywordPatentMatch.ts b/webapp/src/app/api/model/keywordPatentMatch.ts index 5b7c4068..3e412bdf 100644 --- a/webapp/src/app/api/model/keywordPatentMatch.ts +++ b/webapp/src/app/api/model/keywordPatentMatch.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,32 +10,30 @@ import { KeywordEvidence } from './keywordEvidence'; import { PatentEntry } from './patentEntry'; - -export interface KeywordPatentMatch { - patent: PatentEntry; - /** - * Combined match quality score. - */ - match_score: number; - /** - * IPC/CPC classification match score. - */ - ipc_score: number; - /** - * Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none. - */ - topic_score: number; - /** - * Title/abstract keyword overlap score. - */ - text_score: number; - matched_keywords?: Array; - matched_ipc_symbols?: Array; - /** - * True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits. - */ - text_retrieval?: boolean; - keyword_evidence?: KeywordEvidence | null; - topic_match_kind?: string | null; +export interface KeywordPatentMatch { + patent: PatentEntry; + /** + * Combined match quality score. + */ + match_score: number; + /** + * IPC/CPC classification match score. + */ + ipc_score: number; + /** + * Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none. + */ + topic_score: number; + /** + * Title/abstract keyword overlap score. + */ + text_score: number; + matched_keywords?: Array; + matched_ipc_symbols?: Array; + /** + * True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits. + */ + text_retrieval?: boolean; + keyword_evidence?: KeywordEvidence | null; + topic_match_kind?: string | null; } - diff --git a/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts index 753ef4dd..1c9b28b1 100644 --- a/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts +++ b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts @@ -1,32 +1,30 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Pipeline counters for evaluation (no effect on ranking thresholds). */ -export interface KeywordPatentSearchDiagnostics { - /** - * ipc | text | none - */ - search_path: string; - es_query_size_per_index?: number; - raw_patents_after_dedupe?: number; - filtered_by_ipc?: number; - filtered_by_relevance_gate?: number; - filtered_by_min_score?: number; - passed_relevance_gate?: number; - scored_before_cap?: number; - returned?: number; - max_patents_cap?: number; - hit_return_cap?: boolean; - ipc_cluster_selections?: Array; +export interface KeywordPatentSearchDiagnostics { + /** + * ipc | text | none + */ + search_path: string; + es_query_size_per_index?: number; + raw_patents_after_dedupe?: number; + filtered_by_ipc?: number; + filtered_by_relevance_gate?: number; + filtered_by_min_score?: number; + passed_relevance_gate?: number; + scored_before_cap?: number; + returned?: number; + max_patents_cap?: number; + hit_return_cap?: boolean; + ipc_cluster_selections?: Array; } - diff --git a/webapp/src/app/api/model/keywordPatentSearchItem.ts b/webapp/src/app/api/model/keywordPatentSearchItem.ts index c7521f63..cbcd04d4 100644 --- a/webapp/src/app/api/model/keywordPatentSearchItem.ts +++ b/webapp/src/app/api/model/keywordPatentSearchItem.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,19 @@ */ import { KeywordPatentLevel } from './keywordPatentLevel'; - -export interface KeywordPatentSearchItem { - /** - * Extracted keyword text. - */ - keyword: string; - keyword_level?: KeywordPatentLevel | null; - topic_id?: string | null; - topic_display_name?: string | null; - subfield_name?: string | null; - field_name?: string | null; - /** - * LLM relevance score for the keyword. - */ - relevance_score?: number; +export interface KeywordPatentSearchItem { + /** + * Extracted keyword text. + */ + keyword: string; + keyword_level?: KeywordPatentLevel | null; + topic_id?: string | null; + topic_display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + /** + * LLM relevance score for the keyword. + */ + relevance_score?: number; } -export namespace KeywordPatentSearchItem { -} - - +export namespace KeywordPatentSearchItem {} diff --git a/webapp/src/app/api/model/keywordToAuthorRequest.ts b/webapp/src/app/api/model/keywordToAuthorRequest.ts index 2d7e5e0d..9821531e 100644 --- a/webapp/src/app/api/model/keywordToAuthorRequest.ts +++ b/webapp/src/app/api/model/keywordToAuthorRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -15,39 +15,35 @@ import { PublicationType } from './publicationType'; import { CompanyStatusFilter } from './companyStatusFilter'; import { RankingWeights } from './rankingWeights'; - -export interface KeywordToAuthorRequest { - /** - * One or more keywords to rank the author by. - */ - keywords: Array; - /** - * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. - */ - operator?: KeywordOperator; - /** - * What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic display names). Defaults to \'keyword\'. - */ - filter_type?: FilterType; - /** - * Weights for the ranking metrics. Required. - */ - weights: RankingWeights; - /** - * Optional filter: only keep authors in one of these career stages. Empty = no filter. - */ - career_stages?: Array; - /** - * Optional filter: only count works of these publication types. Empty = no filter. - */ - publication_types?: Array; - timespan?: Timespan | null; - /** - * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. - */ - company_status?: CompanyStatusFilter; +export interface KeywordToAuthorRequest { + /** + * One or more keywords to rank the author by. + */ + keywords: Array; + /** + * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. + */ + operator?: KeywordOperator; + /** + * What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic display names). Defaults to \'keyword\'. + */ + filter_type?: FilterType; + /** + * Weights for the ranking metrics. Required. + */ + weights: RankingWeights; + /** + * Optional filter: only keep authors in one of these career stages. Empty = no filter. + */ + career_stages?: Array; + /** + * Optional filter: only count works of these publication types. Empty = no filter. + */ + publication_types?: Array; + timespan?: Timespan | null; + /** + * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. + */ + company_status?: CompanyStatusFilter; } -export namespace KeywordToAuthorRequest { -} - - +export namespace KeywordToAuthorRequest {} diff --git a/webapp/src/app/api/model/keywordTopicMatch.ts b/webapp/src/app/api/model/keywordTopicMatch.ts index f9c2ab49..ee4c8326 100644 --- a/webapp/src/app/api/model/keywordTopicMatch.ts +++ b/webapp/src/app/api/model/keywordTopicMatch.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,7 @@ */ import { Topic } from './topic'; - -export interface KeywordTopicMatch { - keyword: string; - topic?: Topic | null; +export interface KeywordTopicMatch { + keyword: string; + topic?: Topic | null; } - diff --git a/webapp/src/app/api/model/keywordsRequest.ts b/webapp/src/app/api/model/keywordsRequest.ts index 8acb7082..094ed97b 100644 --- a/webapp/src/app/api/model/keywordsRequest.ts +++ b/webapp/src/app/api/model/keywordsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,18 @@ */ import { FileUpload } from './fileUpload'; - -export interface KeywordsRequest { - /** - * The input text from which to extract keywords. - */ - query: string; - files?: Array | null; - /** - * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. - */ - mode: string; - /** - * The maximum number of keywords to extract. - */ - limit?: number; +export interface KeywordsRequest { + /** + * The input text from which to extract keywords. + */ + query: string; + files?: Array | null; + /** + * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. + */ + mode: string; + /** + * The maximum number of keywords to extract. + */ + limit?: number; } - diff --git a/webapp/src/app/api/model/keywordsTopicsRequest.ts b/webapp/src/app/api/model/keywordsTopicsRequest.ts index 8810bf5f..883ed079 100644 --- a/webapp/src/app/api/model/keywordsTopicsRequest.ts +++ b/webapp/src/app/api/model/keywordsTopicsRequest.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface KeywordsTopicsRequest { - /** - * List of keywords/sentences to query by similarity. - */ - keywords: Array; +export interface KeywordsTopicsRequest { + /** + * List of keywords/sentences to query by similarity. + */ + keywords: Array; } - diff --git a/webapp/src/app/api/model/keywordsTopicsResponse.ts b/webapp/src/app/api/model/keywordsTopicsResponse.ts index 4aee622f..78a2f9d2 100644 --- a/webapp/src/app/api/model/keywordsTopicsResponse.ts +++ b/webapp/src/app/api/model/keywordsTopicsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { KeywordTopicMatch } from './keywordTopicMatch'; - -export interface KeywordsTopicsResponse { - /** - * Top matching topics for each keyword in the requested list. - */ - results: Array; +export interface KeywordsTopicsResponse { + /** + * Top matching topics for each keyword in the requested list. + */ + results: Array; } - diff --git a/webapp/src/app/api/model/latitude.ts b/webapp/src/app/api/model/latitude.ts index fe6b49aa..8fb58a9b 100644 --- a/webapp/src/app/api/model/latitude.ts +++ b/webapp/src/app/api/model/latitude.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Latitude { -} - +export interface Latitude {} diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index f207d751..f92e2ffb 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { DehydratedSource } from './dehydratedSource'; - /** * Where a work is hosted */ -export interface Location { - is_oa?: boolean | null; - landing_page_url?: string | null; - pdf_url?: string | null; - source?: DehydratedSource | null; - license?: string | null; - license_id?: string | null; - version?: string | null; - is_accepted?: boolean | null; - is_published?: boolean | null; +export interface Location { + is_oa?: boolean | null; + landing_page_url?: string | null; + pdf_url?: string | null; + source?: DehydratedSource | null; + license?: string | null; + license_id?: string | null; + version?: string | null; + is_accepted?: boolean | null; + is_published?: boolean | null; } - diff --git a/webapp/src/app/api/model/loginResponse.ts b/webapp/src/app/api/model/loginResponse.ts index c91eb493..b0ccb902 100644 --- a/webapp/src/app/api/model/loginResponse.ts +++ b/webapp/src/app/api/model/loginResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { IdTokenMetadata } from './idTokenMetadata'; - -export interface LoginResponse { - /** - * The ID token issued upon successful login. - */ - id_token: IdTokenMetadata; +export interface LoginResponse { + /** + * The ID token issued upon successful login. + */ + id_token: IdTokenMetadata; } - diff --git a/webapp/src/app/api/model/longitude.ts b/webapp/src/app/api/model/longitude.ts index b0d39fce..d222a6ff 100644 --- a/webapp/src/app/api/model/longitude.ts +++ b/webapp/src/app/api/model/longitude.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Longitude { -} - +export interface Longitude {} diff --git a/webapp/src/app/api/model/matchedAuthor.ts b/webapp/src/app/api/model/matchedAuthor.ts index 6194df94..311e2184 100644 --- a/webapp/src/app/api/model/matchedAuthor.ts +++ b/webapp/src/app/api/model/matchedAuthor.ts @@ -1,16 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MatchedAuthor { - openalex_author_id: string; - author_name: string; +export interface MatchedAuthor { + openalex_author_id: string; + author_name: string; } - diff --git a/webapp/src/app/api/model/matchedOfficer.ts b/webapp/src/app/api/model/matchedOfficer.ts index 4ad5c354..a9f00939 100644 --- a/webapp/src/app/api/model/matchedOfficer.ts +++ b/webapp/src/app/api/model/matchedOfficer.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MatchedOfficer { - name?: string | null; - firstname?: string | null; - lastname?: string | null; - city?: string | null; - position?: string | null; - start_date?: string | null; - type?: string | null; - flag?: string | null; - is_matched_person?: boolean; +export interface MatchedOfficer { + name?: string | null; + firstname?: string | null; + lastname?: string | null; + city?: string | null; + position?: string | null; + start_date?: string | null; + type?: string | null; + flag?: string | null; + is_matched_person?: boolean; } - diff --git a/webapp/src/app/api/model/matchedTopic.ts b/webapp/src/app/api/model/matchedTopic.ts index 64e54ab3..52de9018 100644 --- a/webapp/src/app/api/model/matchedTopic.ts +++ b/webapp/src/app/api/model/matchedTopic.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MatchedTopic { - id?: string | null; - display_name?: string | null; - subfield_name?: string | null; - field_name?: string | null; - domain_name?: string | null; - source_keyword?: string | null; +export interface MatchedTopic { + id?: string | null; + display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + domain_name?: string | null; + source_keyword?: string | null; } - diff --git a/webapp/src/app/api/model/mentionedPerson.ts b/webapp/src/app/api/model/mentionedPerson.ts index 6141b12a..dad21357 100644 --- a/webapp/src/app/api/model/mentionedPerson.ts +++ b/webapp/src/app/api/model/mentionedPerson.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MentionedPerson { - name: string; - is_ude?: boolean; - person_id?: string | null; +export interface MentionedPerson { + name: string; + is_ude?: boolean; + person_id?: string | null; } - diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index 8481062a..f9f56443 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,15 @@ */ import { CostUsd } from './costUsd'; - /** * Metadata about the query results */ -export interface Meta { - count?: number | null; - db_response_time_ms?: number | null; - page?: number | null; - per_page?: number | null; - next_cursor?: string | null; - groups_count?: number | null; - cost_usd?: CostUsd | null; +export interface Meta { + count?: number | null; + db_response_time_ms?: number | null; + page?: number | null; + per_page?: number | null; + next_cursor?: string | null; + groups_count?: number | null; + cost_usd?: CostUsd | null; } - diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2YrMeanCitedness.ts index 67ec623c..d9c3d9df 100644 --- a/webapp/src/app/api/model/model2YrMeanCitedness.ts +++ b/webapp/src/app/api/model/model2YrMeanCitedness.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Model2YrMeanCitedness { -} - +export interface Model2YrMeanCitedness {} diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 6fcb5ceb..36c88dfa 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -14,6 +14,8 @@ export * from './authorParsedLongestName'; export * from './authorPositionCount'; export * from './authorStaticStats'; export * from './authorSummaryStats'; +export * from './availableImages'; +export * from './backgroundJobTask'; export * from './authorTopicProfile'; export * from './authorTopicStats'; export * from './authorsFilterProperties'; @@ -52,6 +54,7 @@ export * from './dFGProjectFachgebieteInner'; export * from './dashboardStatisticValue'; export * from './dashboardStatistics'; export * from './dehydratedAuthor'; +export * from './dockerHealth'; export * from './dehydratedFunder'; export * from './dehydratedInstitution'; export * from './dehydratedSource'; @@ -127,6 +130,12 @@ export * from './institutionPage'; export * from './institutionPageV2'; export * from './institutionsListResponse'; export * from './ipcClassification'; +export * from './jobDefinitionCreateRequest'; +export * from './jobDefinitionUpdateRequest'; +export * from './jobRun'; +export * from './jobRunLogs'; +export * from './jobRunStatus'; +export * from './jobTriggeredBy'; export * from './keywordEntry'; export * from './keywordEntryWithTopic'; export * from './keywordEvidence'; @@ -180,6 +189,7 @@ export * from './rankedAuthor'; export * from './rankingResponse'; export * from './rankingWeights'; export * from './rebuildResponse'; +export * from './registryHealth'; export * from './score'; export * from './selectedAuthorsRequest'; export * from './sortDirection'; diff --git a/webapp/src/app/api/model/newsArticle.ts b/webapp/src/app/api/model/newsArticle.ts index ab48810d..e04f0029 100644 --- a/webapp/src/app/api/model/newsArticle.ts +++ b/webapp/src/app/api/model/newsArticle.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface NewsArticle { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; +export interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; } - diff --git a/webapp/src/app/api/model/newsArticleDetail.ts b/webapp/src/app/api/model/newsArticleDetail.ts index 171a14ff..09962000 100644 --- a/webapp/src/app/api/model/newsArticleDetail.ts +++ b/webapp/src/app/api/model/newsArticleDetail.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,19 +10,17 @@ import { MatchedTopic } from './matchedTopic'; import { MentionedPerson } from './mentionedPerson'; - -export interface NewsArticleDetail { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; - full_content?: string | null; - authors?: Array; - keywords?: Array; - topics?: Array; +export interface NewsArticleDetail { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; + full_content?: string | null; + authors?: Array; + keywords?: Array; + topics?: Array; } - diff --git a/webapp/src/app/api/model/newsPage.ts b/webapp/src/app/api/model/newsPage.ts index da7f26ab..bbb74122 100644 --- a/webapp/src/app/api/model/newsPage.ts +++ b/webapp/src/app/api/model/newsPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { NewsArticle } from './newsArticle'; - -export interface NewsPage { - total: number; - page: number; - page_size: number; - results: Array; +export interface NewsPage { + total: number; + page: number; + page_size: number; + results: Array; } - diff --git a/webapp/src/app/api/model/openAccess.ts b/webapp/src/app/api/model/openAccess.ts index 32a4ddd9..40d7b1d0 100644 --- a/webapp/src/app/api/model/openAccess.ts +++ b/webapp/src/app/api/model/openAccess.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Open access information */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; +export interface OpenAccess { + is_oa?: boolean | null; + oa_status?: string | null; + oa_url?: string | null; + any_repository_has_fulltext?: boolean | null; } - diff --git a/webapp/src/app/api/model/openAlexTopicTag.ts b/webapp/src/app/api/model/openAlexTopicTag.ts index dece79c5..0e6f538a 100644 --- a/webapp/src/app/api/model/openAlexTopicTag.ts +++ b/webapp/src/app/api/model/openAlexTopicTag.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface OpenAlexTopicTag { - topic_id?: string | null; - topic_display_name: string; - field_name?: string | null; - domain_name?: string | null; +export interface OpenAlexTopicTag { + topic_id?: string | null; + topic_display_name: string; + field_name?: string | null; + domain_name?: string | null; } - diff --git a/webapp/src/app/api/model/orgPatentEntry.ts b/webapp/src/app/api/model/orgPatentEntry.ts index 762e1968..e26782e4 100644 --- a/webapp/src/app/api/model/orgPatentEntry.ts +++ b/webapp/src/app/api/model/orgPatentEntry.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,40 +11,38 @@ import { MatchedAuthor } from './matchedAuthor'; import { OpenAlexTopicTag } from './openAlexTopicTag'; import { IpcClassification } from './ipcClassification'; - -export interface OrgPatentEntry { - patent_id: string; - source: string; - title?: string | null; - 'abstract'?: string | null; - publication_date?: string | null; - publication_year?: string | null; - application_number?: string | null; - application_date?: string | null; - kind?: string | null; - application_type?: string | null; - number_of_claims?: number | null; - status?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - ipc_descriptions?: Array; - cpc?: Array; - cpc_descriptions?: Array; - country?: string | null; - openalex_topics?: Array; - institution_id: string; - institution_name?: string | null; - match_type: OrgPatentEntry.MatchTypeEnum; - matched_authors?: Array; +export interface OrgPatentEntry { + patent_id: string; + source: string; + title?: string | null; + abstract?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; + openalex_topics?: Array; + institution_id: string; + institution_name?: string | null; + match_type: OrgPatentEntry.MatchTypeEnum; + matched_authors?: Array; } export namespace OrgPatentEntry { - export const MatchTypeEnum = { - Institution: 'institution', - Name: 'name', - Both: 'both' - } as const; - export type MatchTypeEnum = typeof MatchTypeEnum[keyof typeof MatchTypeEnum]; + export const MatchTypeEnum = { + Institution: 'institution', + Name: 'name', + Both: 'both', + } as const; + export type MatchTypeEnum = + (typeof MatchTypeEnum)[keyof typeof MatchTypeEnum]; } - - diff --git a/webapp/src/app/api/model/orgPatentsResponse.ts b/webapp/src/app/api/model/orgPatentsResponse.ts index 96697088..68b2be7a 100644 --- a/webapp/src/app/api/model/orgPatentsResponse.ts +++ b/webapp/src/app/api/model/orgPatentsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { OrgPatentEntry } from './orgPatentEntry'; - -export interface OrgPatentsResponse { - institution_id: string; - institution_name?: string | null; - patent_count: number; - page?: number; - size?: number; - patents: Array; +export interface OrgPatentsResponse { + institution_id: string; + institution_name?: string | null; + patent_count: number; + page?: number; + size?: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/organizationPage.ts b/webapp/src/app/api/model/organizationPage.ts index 5b8294b1..fccb1081 100644 --- a/webapp/src/app/api/model/organizationPage.ts +++ b/webapp/src/app/api/model/organizationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { InseOrganizationManagementModelOrganizationProfile } from './inseOrganizationManagementModelOrganizationProfile'; - -export interface OrganizationPage { - items: Array; - total: number; - page: number; - page_size: number; +export interface OrganizationPage { + items: Array; + total: number; + page: number; + page_size: number; } - diff --git a/webapp/src/app/api/model/otkResponse.ts b/webapp/src/app/api/model/otkResponse.ts index 7d956289..3b69c11d 100644 --- a/webapp/src/app/api/model/otkResponse.ts +++ b/webapp/src/app/api/model/otkResponse.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface OtkResponse { - /** - * The status of the one-time code (OTC) request. - */ - status: string; - /** - * The unique identifier of the account for which the OTC was requested. - */ - account_id: string; +export interface OtkResponse { + /** + * The status of the one-time code (OTC) request. + */ + status: string; + /** + * The unique identifier of the account for which the OTC was requested. + */ + account_id: string; } - diff --git a/webapp/src/app/api/model/patentEntry.ts b/webapp/src/app/api/model/patentEntry.ts index 7f6d7809..809c558b 100644 --- a/webapp/src/app/api/model/patentEntry.ts +++ b/webapp/src/app/api/model/patentEntry.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,27 +10,25 @@ import { OpenAlexTopicTag } from './openAlexTopicTag'; import { IpcClassification } from './ipcClassification'; - -export interface PatentEntry { - patent_id: string; - source: string; - title?: string | null; - 'abstract'?: string | null; - publication_date?: string | null; - publication_year?: string | null; - application_number?: string | null; - application_date?: string | null; - kind?: string | null; - application_type?: string | null; - number_of_claims?: number | null; - status?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - ipc_descriptions?: Array; - cpc?: Array; - cpc_descriptions?: Array; - country?: string | null; - openalex_topics?: Array; +export interface PatentEntry { + patent_id: string; + source: string; + title?: string | null; + abstract?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; + openalex_topics?: Array; } - diff --git a/webapp/src/app/api/model/patentsByAuthorResponse.ts b/webapp/src/app/api/model/patentsByAuthorResponse.ts index eca819ed..ed970c7a 100644 --- a/webapp/src/app/api/model/patentsByAuthorResponse.ts +++ b/webapp/src/app/api/model/patentsByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { PatentEntry } from './patentEntry'; - -export interface PatentsByAuthorResponse { - author_id: string; - author_name?: string | null; - patent_count: number; - patents: Array; +export interface PatentsByAuthorResponse { + author_id: string; + author_name?: string | null; + patent_count: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/patentsByInstitutionResponse.ts b/webapp/src/app/api/model/patentsByInstitutionResponse.ts index b167c48b..d80972d0 100644 --- a/webapp/src/app/api/model/patentsByInstitutionResponse.ts +++ b/webapp/src/app/api/model/patentsByInstitutionResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { PatentEntry } from './patentEntry'; - -export interface PatentsByInstitutionResponse { - institution_id: string; - institution_name?: string | null; - patent_count: number; - patents: Array; +export interface PatentsByInstitutionResponse { + institution_id: string; + institution_name?: string | null; + patent_count: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/patentsByKeywordsRequest.ts b/webapp/src/app/api/model/patentsByKeywordsRequest.ts index 1e9d3021..fcafaee0 100644 --- a/webapp/src/app/api/model/patentsByKeywordsRequest.ts +++ b/webapp/src/app/api/model/patentsByKeywordsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { KeywordPatentSearchItem } from './keywordPatentSearchItem'; - -export interface PatentsByKeywordsRequest { - /** - * Keywords to match against patents_openalex_keywords. - */ - keywords: Array; +export interface PatentsByKeywordsRequest { + /** + * Keywords to match against patents_openalex_keywords. + */ + keywords: Array; } - diff --git a/webapp/src/app/api/model/patentsByKeywordsResponse.ts b/webapp/src/app/api/model/patentsByKeywordsResponse.ts index d9f28a8e..f801c6d5 100644 --- a/webapp/src/app/api/model/patentsByKeywordsResponse.ts +++ b/webapp/src/app/api/model/patentsByKeywordsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,17 +11,13 @@ import { KeywordPatentMappingStatus } from './keywordPatentMappingStatus'; import { KeywordPatentSearchDiagnostics } from './keywordPatentSearchDiagnostics'; import { KeywordPatentMatch } from './keywordPatentMatch'; - -export interface PatentsByKeywordsResponse { - patent_count: number; - patents: Array; - /** - * IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend). - */ - mapping_status: KeywordPatentMappingStatus; - diagnostics?: KeywordPatentSearchDiagnostics | null; +export interface PatentsByKeywordsResponse { + patent_count: number; + patents: Array; + /** + * IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend). + */ + mapping_status: KeywordPatentMappingStatus; + diagnostics?: KeywordPatentSearchDiagnostics | null; } -export namespace PatentsByKeywordsResponse { -} - - +export namespace PatentsByKeywordsResponse {} diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/personBio.ts index f7291e6f..b060c9a9 100644 --- a/webapp/src/app/api/model/personBio.ts +++ b/webapp/src/app/api/model/personBio.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PersonBio { - /** - * The generated biography. - */ - bio: string; +export interface PersonBio { + /** + * The generated biography. + */ + bio: string; } - diff --git a/webapp/src/app/api/model/personBookmarkResponse.ts b/webapp/src/app/api/model/personBookmarkResponse.ts index 5227060a..b40bdc71 100644 --- a/webapp/src/app/api/model/personBookmarkResponse.ts +++ b/webapp/src/app/api/model/personBookmarkResponse.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PersonBookmarkResponse { - person_id: string; - person_name: string | null; - created_at: string; +export interface PersonBookmarkResponse { + person_id: string; + person_name: string | null; + created_at: string; } - diff --git a/webapp/src/app/api/model/primaryCategoryYearAggregation.ts b/webapp/src/app/api/model/primaryCategoryYearAggregation.ts index bc146f8d..02abd7b7 100644 --- a/webapp/src/app/api/model/primaryCategoryYearAggregation.ts +++ b/webapp/src/app/api/model/primaryCategoryYearAggregation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PrimaryCategoryYearAggregation { - /** - * The publication year. - */ - publication_year: number; - /** - * A mapping of primary categories to their counts for the given year. - */ - categories?: { [key: string]: number; }; +export interface PrimaryCategoryYearAggregation { + /** + * The publication year. + */ + publication_year: number; + /** + * A mapping of primary categories to their counts for the given year. + */ + categories?: { [key: string]: number }; } - diff --git a/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts b/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts index e191b225..c448c0f2 100644 --- a/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts +++ b/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { PrimaryCategoryYearAggregation } from './primaryCategoryYearAggregation'; - -export interface PrimaryCategoryYearAggregationPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface PrimaryCategoryYearAggregationPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/projectType.ts b/webapp/src/app/api/model/projectType.ts index a01a743c..08df30c4 100644 --- a/webapp/src/app/api/model/projectType.ts +++ b/webapp/src/app/api/model/projectType.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const ProjectType = { - Bund: 'bund', - Eu: 'eu', - Dfg: 'dfg' + Bund: 'bund', + Eu: 'eu', + Dfg: 'dfg', } as const; -export type ProjectType = typeof ProjectType[keyof typeof ProjectType]; - +export type ProjectType = (typeof ProjectType)[keyof typeof ProjectType]; diff --git a/webapp/src/app/api/model/projectsFilteringProperties.ts b/webapp/src/app/api/model/projectsFilteringProperties.ts index 7ce7cfc2..c0cebe63 100644 --- a/webapp/src/app/api/model/projectsFilteringProperties.ts +++ b/webapp/src/app/api/model/projectsFilteringProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,32 +11,28 @@ import { SortDirection } from './sortDirection'; import { ProjectsSortBy } from './projectsSortBy'; import { ProjectType } from './projectType'; - -export interface ProjectsFilteringProperties { - /** - * The type of projects to filter by. - */ - project_type: ProjectType; - /** - * The page number for pagination. - */ - page: number; - /** - * The page size for pagination. - */ - size: number; - raw_oa_institution_id?: string | null; - query?: string | null; - /** - * The field to sort by. - */ - sort_by?: ProjectsSortBy; - /** - * The sort direction (asc or desc). - */ - sort_direction?: SortDirection; +export interface ProjectsFilteringProperties { + /** + * The type of projects to filter by. + */ + project_type: ProjectType; + /** + * The page number for pagination. + */ + page: number; + /** + * The page size for pagination. + */ + size: number; + raw_oa_institution_id?: string | null; + query?: string | null; + /** + * The field to sort by. + */ + sort_by?: ProjectsSortBy; + /** + * The sort direction (asc or desc). + */ + sort_direction?: SortDirection; } -export namespace ProjectsFilteringProperties { -} - - +export namespace ProjectsFilteringProperties {} diff --git a/webapp/src/app/api/model/projectsSortBy.ts b/webapp/src/app/api/model/projectsSortBy.ts index 79824096..26400b22 100644 --- a/webapp/src/app/api/model/projectsSortBy.ts +++ b/webapp/src/app/api/model/projectsSortBy.ts @@ -1,19 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const ProjectsSortBy = { - Title: 'title', - FundingStart: 'funding_start', - FundingEnd: 'funding_end', - FundingAmount: 'funding_amount' + Title: 'title', + FundingStart: 'funding_start', + FundingEnd: 'funding_end', + FundingAmount: 'funding_amount', } as const; -export type ProjectsSortBy = typeof ProjectsSortBy[keyof typeof ProjectsSortBy]; - +export type ProjectsSortBy = + (typeof ProjectsSortBy)[keyof typeof ProjectsSortBy]; diff --git a/webapp/src/app/api/model/publicationDetailByFunder.ts b/webapp/src/app/api/model/publicationDetailByFunder.ts index 123ded7e..0fd6b7c5 100644 --- a/webapp/src/app/api/model/publicationDetailByFunder.ts +++ b/webapp/src/app/api/model/publicationDetailByFunder.ts @@ -1,45 +1,43 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PublicationDetailByFunder { - id: string; - title: string; - 'abstract'?: string | null; - doi?: string | null; - publication_year?: number | null; - publication_date?: string | null; - publication_type?: string | null; - language?: string | null; - publication_url?: string | null; - pdf_url?: string | null; - source_name?: string | null; - source_type?: string | null; - is_open_access?: boolean | null; - open_access_status?: string | null; - has_fulltext?: boolean | null; - license?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - primary_topic?: string | null; - topic_field?: string | null; - topic_subfield?: string | null; - topic_domain?: string | null; - author_position?: string | null; - authors?: Array; - funder_names?: Array; - institutions?: Array; - countries?: Array; - topics?: Array; - keywords?: Array; - grant_labels?: Array; - counts_by_year?: Array; +export interface PublicationDetailByFunder { + id: string; + title: string; + abstract?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: string | null; + authors?: Array; + funder_names?: Array; + institutions?: Array; + countries?: Array; + topics?: Array; + keywords?: Array; + grant_labels?: Array; + counts_by_year?: Array; } - diff --git a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts index c35050ef..d549f8ed 100644 --- a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts +++ b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PublicationIdsByAuthorPosition { - first?: Array; - middle?: Array; - last?: Array; - unknown?: Array; +export interface PublicationIdsByAuthorPosition { + first?: Array; + middle?: Array; + last?: Array; + unknown?: Array; } - diff --git a/webapp/src/app/api/model/publicationType.ts b/webapp/src/app/api/model/publicationType.ts index 753c47e8..39086fad 100644 --- a/webapp/src/app/api/model/publicationType.ts +++ b/webapp/src/app/api/model/publicationType.ts @@ -1,39 +1,38 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const PublicationType = { - Article: 'article', - Other: 'other', - Dataset: 'dataset', - BookChapter: 'book-chapter', - Book: 'book', - Dissertation: 'dissertation', - Preprint: 'preprint', - Paratext: 'paratext', - Libguides: 'libguides', - Review: 'review', - Letter: 'letter', - ReferenceEntry: 'reference-entry', - Editorial: 'editorial', - PeerReview: 'peer-review', - Report: 'report', - Standard: 'standard', - Erratum: 'erratum', - Retraction: 'retraction', - SupplementaryMaterials: 'supplementary-materials', - BookSection: 'book-section', - Database: 'database', - Software: 'software', - ReportComponent: 'report-component', - Grant: 'grant' + Article: 'article', + Other: 'other', + Dataset: 'dataset', + BookChapter: 'book-chapter', + Book: 'book', + Dissertation: 'dissertation', + Preprint: 'preprint', + Paratext: 'paratext', + Libguides: 'libguides', + Review: 'review', + Letter: 'letter', + ReferenceEntry: 'reference-entry', + Editorial: 'editorial', + PeerReview: 'peer-review', + Report: 'report', + Standard: 'standard', + Erratum: 'erratum', + Retraction: 'retraction', + SupplementaryMaterials: 'supplementary-materials', + BookSection: 'book-section', + Database: 'database', + Software: 'software', + ReportComponent: 'report-component', + Grant: 'grant', } as const; -export type PublicationType = typeof PublicationType[keyof typeof PublicationType]; - +export type PublicationType = + (typeof PublicationType)[keyof typeof PublicationType]; diff --git a/webapp/src/app/api/model/publicationsByAuthorResponse.ts b/webapp/src/app/api/model/publicationsByAuthorResponse.ts index 5176fe39..35333880 100644 --- a/webapp/src/app/api/model/publicationsByAuthorResponse.ts +++ b/webapp/src/app/api/model/publicationsByAuthorResponse.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PublicationsByAuthorResponse { - author_id: string; - page: number; - page_size: number; - total_works: number; - total: number; - results_count: number; - results: Array; +export interface PublicationsByAuthorResponse { + author_id: string; + page: number; + page_size: number; + total_works: number; + total: number; + results_count: number; + results: Array; } - diff --git a/webapp/src/app/api/model/rankedAuthor.ts b/webapp/src/app/api/model/rankedAuthor.ts index 6f82a6d3..cee57a50 100644 --- a/webapp/src/app/api/model/rankedAuthor.ts +++ b/webapp/src/app/api/model/rankedAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,46 +9,42 @@ */ import { CareerStage } from './careerStage'; - -export interface RankedAuthor { - /** - * The OpenAlex ID of the author. - */ - author_id: string; - /** - * The name of the author. - */ - display_name: string; - /** - * Number of matching works by this author. - */ - works_count: number; - /** - * Total citations across this author\'s matching works. - */ - citations_count: number; - /** - * Number of Handelsregister company connections matched by the author\'s name (proxy for company foundations). - */ - companies_count?: number; - /** - * Number of news articles that mention the author by exact name (proxy for media visibility). - */ - news_count?: number; - /** - * Number of patents matched to the author (from the precomputed org_patents index). - */ - patents_count?: number; - /** - * Normalized weighted score used for ranking. - */ - score?: number; - /** - * Career stage derived from the author\'s active publication years. - */ - career_stage?: CareerStage; +export interface RankedAuthor { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of matching works by this author. + */ + works_count: number; + /** + * Total citations across this author\'s matching works. + */ + citations_count: number; + /** + * Number of Handelsregister company connections matched by the author\'s name (proxy for company foundations). + */ + companies_count?: number; + /** + * Number of news articles that mention the author by exact name (proxy for media visibility). + */ + news_count?: number; + /** + * Number of patents matched to the author (from the precomputed org_patents index). + */ + patents_count?: number; + /** + * Normalized weighted score used for ranking. + */ + score?: number; + /** + * Career stage derived from the author\'s active publication years. + */ + career_stage?: CareerStage; } -export namespace RankedAuthor { -} - - +export namespace RankedAuthor {} diff --git a/webapp/src/app/api/model/rankingResponse.ts b/webapp/src/app/api/model/rankingResponse.ts index 099ec660..5be090a2 100644 --- a/webapp/src/app/api/model/rankingResponse.ts +++ b/webapp/src/app/api/model/rankingResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,9 +10,7 @@ import { UniversityRanking } from './universityRanking'; import { UniversityTopicData } from './universityTopicData'; - -export interface RankingResponse { - timeseries: Array; - rankings: Array; +export interface RankingResponse { + timeseries: Array; + rankings: Array; } - diff --git a/webapp/src/app/api/model/rankingWeights.ts b/webapp/src/app/api/model/rankingWeights.ts index 4ef2c4a1..5f1d2df4 100644 --- a/webapp/src/app/api/model/rankingWeights.ts +++ b/webapp/src/app/api/model/rankingWeights.ts @@ -1,34 +1,32 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface RankingWeights { - /** - * Weight for the citation metric (0.0 - 1.0). - */ - citation: number; - /** - * Weight for the works metric (0.0 - 1.0). - */ - works: number; - /** - * Weight for the company-foundations metric (0.0 - 1.0). - */ - companies?: number; - /** - * Weight for the news/media-visibility metric (0.0 - 1.0). - */ - news?: number; - /** - * Weight for the patents metric (0.0 - 1.0). - */ - patents?: number; +export interface RankingWeights { + /** + * Weight for the citation metric (0.0 - 1.0). + */ + citation: number; + /** + * Weight for the works metric (0.0 - 1.0). + */ + works: number; + /** + * Weight for the company-foundations metric (0.0 - 1.0). + */ + companies?: number; + /** + * Weight for the news/media-visibility metric (0.0 - 1.0). + */ + news?: number; + /** + * Weight for the patents metric (0.0 - 1.0). + */ + patents?: number; } - diff --git a/webapp/src/app/api/model/rebuildResponse.ts b/webapp/src/app/api/model/rebuildResponse.ts index 13e6c910..d2f002fb 100644 --- a/webapp/src/app/api/model/rebuildResponse.ts +++ b/webapp/src/app/api/model/rebuildResponse.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface RebuildResponse { - status: string; - institution_id: string; - message: string; +export interface RebuildResponse { + status: string; + institution_id: string; + message: string; } - diff --git a/webapp/src/app/api/model/registryHealth.ts b/webapp/src/app/api/model/registryHealth.ts new file mode 100644 index 00000000..dc9411bd --- /dev/null +++ b/webapp/src/app/api/model/registryHealth.ts @@ -0,0 +1,15 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface RegistryHealth { + reachable: boolean; + detail: string; + host: string; +} diff --git a/webapp/src/app/api/model/score.ts b/webapp/src/app/api/model/score.ts index fac39735..5b0b5935 100644 --- a/webapp/src/app/api/model/score.ts +++ b/webapp/src/app/api/model/score.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Score { -} - +export interface Score {} diff --git a/webapp/src/app/api/model/selectedAuthorsRequest.ts b/webapp/src/app/api/model/selectedAuthorsRequest.ts index 79f008fe..9bfeffcb 100644 --- a/webapp/src/app/api/model/selectedAuthorsRequest.ts +++ b/webapp/src/app/api/model/selectedAuthorsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,31 +12,27 @@ import { FilterType } from './filterType'; import { KeywordOperator } from './keywordOperator'; import { PublicationType } from './publicationType'; - -export interface SelectedAuthorsRequest { - /** - * OpenAlex IDs of the authors to rank. - */ - author_ids: Array; - /** - * One or more keywords defining the topic. - */ - keywords: Array; - /** - * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. - */ - operator?: KeywordOperator; - /** - * What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic ids). Defaults to \'keyword\'. - */ - filter_type?: FilterType; - /** - * Optional filter: only count works of these publication types. Empty = no filter. - */ - publication_types?: Array; - timespan?: Timespan | null; +export interface SelectedAuthorsRequest { + /** + * OpenAlex IDs of the authors to rank. + */ + author_ids: Array; + /** + * One or more keywords defining the topic. + */ + keywords: Array; + /** + * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. + */ + operator?: KeywordOperator; + /** + * What the \'keywords\' values match against: \'keyword\' (OpenAlex keyword display names) or \'topic\' (OpenAlex topic ids). Defaults to \'keyword\'. + */ + filter_type?: FilterType; + /** + * Optional filter: only count works of these publication types. Empty = no filter. + */ + publication_types?: Array; + timespan?: Timespan | null; } -export namespace SelectedAuthorsRequest { -} - - +export namespace SelectedAuthorsRequest {} diff --git a/webapp/src/app/api/model/sortDirection.ts b/webapp/src/app/api/model/sortDirection.ts index 4f9362f2..49933995 100644 --- a/webapp/src/app/api/model/sortDirection.ts +++ b/webapp/src/app/api/model/sortDirection.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const SortDirection = { - Asc: 'asc', - Desc: 'desc' + Asc: 'asc', + Desc: 'desc', } as const; -export type SortDirection = typeof SortDirection[keyof typeof SortDirection]; - +export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection]; diff --git a/webapp/src/app/api/model/subfieldShare.ts b/webapp/src/app/api/model/subfieldShare.ts index 83185941..2c3b768e 100644 --- a/webapp/src/app/api/model/subfieldShare.ts +++ b/webapp/src/app/api/model/subfieldShare.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface SubfieldShare { - /** - * The subfield display name. - */ - name: string; - /** - * Number of works whose primary topic belongs to this subfield. - */ - count: number; +export interface SubfieldShare { + /** + * The subfield display name. + */ + name: string; + /** + * Number of works whose primary topic belongs to this subfield. + */ + count: number; } - diff --git a/webapp/src/app/api/model/timespan.ts b/webapp/src/app/api/model/timespan.ts index c44eee8a..170cba6b 100644 --- a/webapp/src/app/api/model/timespan.ts +++ b/webapp/src/app/api/model/timespan.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Timespan { - /** - * Start year (inclusive). - */ - from: number; - /** - * End year (inclusive). - */ - to: number; +export interface Timespan { + /** + * Start year (inclusive). + */ + from: number; + /** + * End year (inclusive). + */ + to: number; } - diff --git a/webapp/src/app/api/model/tokenType.ts b/webapp/src/app/api/model/tokenType.ts index a0efdc46..88512eb6 100644 --- a/webapp/src/app/api/model/tokenType.ts +++ b/webapp/src/app/api/model/tokenType.ts @@ -1,18 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const TokenType = { - IdToken: 'ID_TOKEN', - RefreshToken: 'REFRESH_TOKEN', - AccessToken: 'ACCESS_TOKEN' + IdToken: 'ID_TOKEN', + RefreshToken: 'REFRESH_TOKEN', + AccessToken: 'ACCESS_TOKEN', } as const; -export type TokenType = typeof TokenType[keyof typeof TokenType]; - +export type TokenType = (typeof TokenType)[keyof typeof TokenType]; diff --git a/webapp/src/app/api/model/topAuthor.ts b/webapp/src/app/api/model/topAuthor.ts index 6a74fa91..bc431723 100644 --- a/webapp/src/app/api/model/topAuthor.ts +++ b/webapp/src/app/api/model/topAuthor.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopAuthor { - id?: string | null; - name: string; - count: number; +export interface TopAuthor { + id?: string | null; + name: string; + count: number; } - diff --git a/webapp/src/app/api/model/topAuthorStatistics.ts b/webapp/src/app/api/model/topAuthorStatistics.ts index 745d0b24..3d06243b 100644 --- a/webapp/src/app/api/model/topAuthorStatistics.ts +++ b/webapp/src/app/api/model/topAuthorStatistics.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,10 @@ */ import { TopAuthor } from './topAuthor'; - -export interface TopAuthorStatistics { - institution_id: string; - works: Array; - eu_projects: Array; - patents: Array; - news: Array; +export interface TopAuthorStatistics { + institution_id: string; + works: Array; + eu_projects: Array; + patents: Array; + news: Array; } - diff --git a/webapp/src/app/api/model/topInstitutionItem.ts b/webapp/src/app/api/model/topInstitutionItem.ts index a9367bae..a98f52b8 100644 --- a/webapp/src/app/api/model/topInstitutionItem.ts +++ b/webapp/src/app/api/model/topInstitutionItem.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopInstitutionItem { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; - works_count?: number | null; - exact_topic_count?: number | null; +export interface TopInstitutionItem { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; + works_count?: number | null; + exact_topic_count?: number | null; } - diff --git a/webapp/src/app/api/model/topTopicItem.ts b/webapp/src/app/api/model/topTopicItem.ts index 2ae026c1..e6a151d4 100644 --- a/webapp/src/app/api/model/topTopicItem.ts +++ b/webapp/src/app/api/model/topTopicItem.ts @@ -1,16 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopTopicItem { - name: string; - count: number; +export interface TopTopicItem { + name: string; + count: number; } - diff --git a/webapp/src/app/api/model/topTopicsResponse.ts b/webapp/src/app/api/model/topTopicsResponse.ts index 7f109033..4bac3de8 100644 --- a/webapp/src/app/api/model/topTopicsResponse.ts +++ b/webapp/src/app/api/model/topTopicsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,6 @@ */ import { TopTopicItem } from './topTopicItem'; - -export interface TopTopicsResponse { - items: Array; +export interface TopTopicsResponse { + items: Array; } - diff --git a/webapp/src/app/api/model/topic.ts b/webapp/src/app/api/model/topic.ts index 9fc0ee63..eaac16f6 100644 --- a/webapp/src/app/api/model/topic.ts +++ b/webapp/src/app/api/model/topic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,23 +12,21 @@ import { TopicIds } from './topicIds'; import { TopicSubfield } from './topicSubfield'; import { TopicField } from './topicField'; - /** * A research topic automatically assigned to works */ -export interface Topic { - id?: string | null; - display_name?: string | null; - description?: string | null; - keywords?: Array | null; - subfield?: TopicSubfield | null; - field?: TopicField | null; - domain?: TopicDomain | null; - works_count?: number | null; - cited_by_count?: number | null; - ids?: TopicIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Topic { + id?: string | null; + display_name?: string | null; + description?: string | null; + keywords?: Array | null; + subfield?: TopicSubfield | null; + field?: TopicField | null; + domain?: TopicDomain | null; + works_count?: number | null; + cited_by_count?: number | null; + ids?: TopicIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts index b929a51d..1d2abe90 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topicCount.ts @@ -1,33 +1,31 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; - subfield_id?: string | null; - subfield_name?: string | null; - subfield_description?: string | null; - field_id?: string | null; - field_name?: string | null; - field_description?: string | null; - domain_id?: string | null; - domain_name?: string | null; - domain_description?: string | null; +export interface TopicCount { + id?: string | null; + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; + description?: string | null; + subfield_id?: string | null; + subfield_name?: string | null; + subfield_description?: string | null; + field_id?: string | null; + field_name?: string | null; + field_description?: string | null; + domain_id?: string | null; + domain_name?: string | null; + domain_description?: string | null; } - diff --git a/webapp/src/app/api/model/topicDomain.ts b/webapp/src/app/api/model/topicDomain.ts index 652b1bca..573bef0d 100644 --- a/webapp/src/app/api/model/topicDomain.ts +++ b/webapp/src/app/api/model/topicDomain.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The domain (highest level) containing this topic: */ -export interface TopicDomain { - id?: string | null; - display_name?: string | null; +export interface TopicDomain { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topicField.ts b/webapp/src/app/api/model/topicField.ts index c7351675..cd7d08c8 100644 --- a/webapp/src/app/api/model/topicField.ts +++ b/webapp/src/app/api/model/topicField.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The field (second level) containing this topic: */ -export interface TopicField { - id?: string | null; - display_name?: string | null; +export interface TopicField { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topicHeatmap.ts b/webapp/src/app/api/model/topicHeatmap.ts index be36dc40..64e915a5 100644 --- a/webapp/src/app/api/model/topicHeatmap.ts +++ b/webapp/src/app/api/model/topicHeatmap.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { TopicHeatmapField } from './topicHeatmapField'; - -export interface TopicHeatmap { - institution_id: string; - organization_name: string; - years: Array; - fields: Array; +export interface TopicHeatmap { + institution_id: string; + organization_name: string; + years: Array; + fields: Array; } - diff --git a/webapp/src/app/api/model/topicHeatmapField.ts b/webapp/src/app/api/model/topicHeatmapField.ts index 1687c6d9..4c35a17e 100644 --- a/webapp/src/app/api/model/topicHeatmapField.ts +++ b/webapp/src/app/api/model/topicHeatmapField.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { TopicHeatmapValue } from './topicHeatmapValue'; - -export interface TopicHeatmapField { - id: string; - name: string; - total: number; - values: Array; +export interface TopicHeatmapField { + id: string; + name: string; + total: number; + values: Array; } - diff --git a/webapp/src/app/api/model/topicHeatmapValue.ts b/webapp/src/app/api/model/topicHeatmapValue.ts index f840b938..2f5a01d9 100644 --- a/webapp/src/app/api/model/topicHeatmapValue.ts +++ b/webapp/src/app/api/model/topicHeatmapValue.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopicHeatmapValue { - year: number; - count: number; - share: number; +export interface TopicHeatmapValue { + year: number; + count: number; + share: number; } - diff --git a/webapp/src/app/api/model/topicIds.ts b/webapp/src/app/api/model/topicIds.ts index 4aa6738f..22ca3343 100644 --- a/webapp/src/app/api/model/topicIds.ts +++ b/webapp/src/app/api/model/topicIds.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; +export interface TopicIds { + openalex?: string | null; + wikipedia?: string | null; } - diff --git a/webapp/src/app/api/model/topicPageV2.ts b/webapp/src/app/api/model/topicPageV2.ts index 67f1272b..5df5a490 100644 --- a/webapp/src/app/api/model/topicPageV2.ts +++ b/webapp/src/app/api/model/topicPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Topic } from './topic'; - -export interface TopicPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface TopicPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/topicSubfield.ts b/webapp/src/app/api/model/topicSubfield.ts index 53d37842..79f3c9c7 100644 --- a/webapp/src/app/api/model/topicSubfield.ts +++ b/webapp/src/app/api/model/topicSubfield.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The subfield (third level) containing this topic: */ -export interface TopicSubfield { - id?: string | null; - display_name?: string | null; +export interface TopicSubfield { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topicYearlyData.ts b/webapp/src/app/api/model/topicYearlyData.ts index 7dc05940..a1fdbdc2 100644 --- a/webapp/src/app/api/model/topicYearlyData.ts +++ b/webapp/src/app/api/model/topicYearlyData.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopicYearlyData { - year: number; - raw: number; - normalized: number; - cumulative: number; - institutions_count: number; +export interface TopicYearlyData { + year: number; + raw: number; + normalized: number; + cumulative: number; + institutions_count: number; } - diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 8af7c9bb..007dc43d 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,27 +9,25 @@ */ import { TopicsByYear } from './topicsByYear'; - -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; - /** - * True if the timeline contains only a limited subset of the author\'s publications. - */ - is_limited?: boolean; - /** - * The number of publications used to build the timeline. - */ - used_publications?: number; - /** - * The total number of publications found for this author. - */ - total_publications?: number; +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; + /** + * True if the timeline contains only a limited subset of the author\'s publications. + */ + is_limited?: boolean; + /** + * The number of publications used to build the timeline. + */ + used_publications?: number; + /** + * The total number of publications found for this author. + */ + total_publications?: number; } - diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts index fded8da0..bb2f1820 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { TopicCount } from './topicCount'; - -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; } - diff --git a/webapp/src/app/api/model/topicsListResponse.ts b/webapp/src/app/api/model/topicsListResponse.ts index 43f21226..058b45fd 100644 --- a/webapp/src/app/api/model/topicsListResponse.ts +++ b/webapp/src/app/api/model/topicsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { GroupByResult } from './groupByResult'; import { Topic } from './topic'; - /** * TopicsListResponse */ -export interface TopicsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface TopicsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/trendResponse.ts b/webapp/src/app/api/model/trendResponse.ts index c7819dd7..e6b291c9 100644 --- a/webapp/src/app/api/model/trendResponse.ts +++ b/webapp/src/app/api/model/trendResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,8 @@ */ import { TrendSeries } from './trendSeries'; - -export interface TrendResponse { - series: Array; - years: Array; - location_mappings?: { [key: string]: Array; } | null; +export interface TrendResponse { + series: Array; + years: Array; + location_mappings?: { [key: string]: Array } | null; } - diff --git a/webapp/src/app/api/model/trendSearchType.ts b/webapp/src/app/api/model/trendSearchType.ts index 5495800e..bde11a52 100644 --- a/webapp/src/app/api/model/trendSearchType.ts +++ b/webapp/src/app/api/model/trendSearchType.ts @@ -1,21 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const TrendSearchType = { - Publications: 'publications', - Authors: 'authors', - Patents: 'patents', - Projects: 'projects', - News: 'news', - All: 'all' + Publications: 'publications', + Authors: 'authors', + Patents: 'patents', + Projects: 'projects', + News: 'news', + All: 'all', } as const; -export type TrendSearchType = typeof TrendSearchType[keyof typeof TrendSearchType]; - +export type TrendSearchType = + (typeof TrendSearchType)[keyof typeof TrendSearchType]; diff --git a/webapp/src/app/api/model/trendSeries.ts b/webapp/src/app/api/model/trendSeries.ts index 312dee1c..b8ce939f 100644 --- a/webapp/src/app/api/model/trendSeries.ts +++ b/webapp/src/app/api/model/trendSeries.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,20 @@ */ import { TopicYearlyData } from './topicYearlyData'; - -export interface TrendSeries { - entity_id: string; - entity_name: string; - entity_type: TrendSeries.EntityTypeEnum; - country_code?: string | null; - topic_data: { [key: string]: Array; }; +export interface TrendSeries { + entity_id: string; + entity_name: string; + entity_type: TrendSeries.EntityTypeEnum; + country_code?: string | null; + topic_data: { [key: string]: Array }; } export namespace TrendSeries { - export const EntityTypeEnum = { - Institution: 'institution', - Country: 'country', - Region: 'region', - Author: 'author' - } as const; - export type EntityTypeEnum = typeof EntityTypeEnum[keyof typeof EntityTypeEnum]; + export const EntityTypeEnum = { + Institution: 'institution', + Country: 'country', + Region: 'region', + Author: 'author', + } as const; + export type EntityTypeEnum = + (typeof EntityTypeEnum)[keyof typeof EntityTypeEnum]; } - - diff --git a/webapp/src/app/api/model/universityRanking.ts b/webapp/src/app/api/model/universityRanking.ts index 3099e73e..5c9d0d05 100644 --- a/webapp/src/app/api/model/universityRanking.ts +++ b/webapp/src/app/api/model/universityRanking.ts @@ -1,30 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface UniversityRanking { - rank: number; - university: string; - publications: number; - citations: number; - growth_rate: number; - trend: UniversityRanking.TrendEnum; - is_top_mover: boolean; +export interface UniversityRanking { + rank: number; + university: string; + publications: number; + citations: number; + growth_rate: number; + trend: UniversityRanking.TrendEnum; + is_top_mover: boolean; } export namespace UniversityRanking { - export const TrendEnum = { - Up: 'up', - Down: 'down', - Stable: 'stable' - } as const; - export type TrendEnum = typeof TrendEnum[keyof typeof TrendEnum]; + export const TrendEnum = { + Up: 'up', + Down: 'down', + Stable: 'stable', + } as const; + export type TrendEnum = (typeof TrendEnum)[keyof typeof TrendEnum]; } - - diff --git a/webapp/src/app/api/model/universityTopicData.ts b/webapp/src/app/api/model/universityTopicData.ts index ea31291d..3bf43088 100644 --- a/webapp/src/app/api/model/universityTopicData.ts +++ b/webapp/src/app/api/model/universityTopicData.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,10 +10,8 @@ import { YearlyData } from './yearlyData'; import { Topic } from './topic'; - -export interface UniversityTopicData { - university: string; - topic: Topic; - yearly_data: Array; +export interface UniversityTopicData { + university: string; + topic: Topic; + yearly_data: Array; } - diff --git a/webapp/src/app/api/model/updateAccountRequest.ts b/webapp/src/app/api/model/updateAccountRequest.ts index 574f5d0d..db502fd9 100644 --- a/webapp/src/app/api/model/updateAccountRequest.ts +++ b/webapp/src/app/api/model/updateAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,13 @@ */ import { UserRole } from './userRole'; - -export interface UpdateAccountRequest { - email?: string | null; - name?: string | null; - roles?: Array | null; - organization_id?: string | null; - password?: string | null; - openalex_person_id?: string | null; - deleted?: boolean | null; - activated?: boolean | null; +export interface UpdateAccountRequest { + email?: string | null; + name?: string | null; + roles?: Array | null; + organization_id?: string | null; + password?: string | null; + openalex_person_id?: string | null; + deleted?: boolean | null; + activated?: boolean | null; } - diff --git a/webapp/src/app/api/model/updateOrganizationRequest.ts b/webapp/src/app/api/model/updateOrganizationRequest.ts index e12063b6..a56b51e7 100644 --- a/webapp/src/app/api/model/updateOrganizationRequest.ts +++ b/webapp/src/app/api/model/updateOrganizationRequest.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface UpdateOrganizationRequest { - name?: string | null; - other_inst_id?: string | null; - deleted?: boolean | null; +export interface UpdateOrganizationRequest { + name?: string | null; + other_inst_id?: string | null; + deleted?: boolean | null; } - diff --git a/webapp/src/app/api/model/userRole.ts b/webapp/src/app/api/model/userRole.ts index 83b5c595..f6d08b53 100644 --- a/webapp/src/app/api/model/userRole.ts +++ b/webapp/src/app/api/model/userRole.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const UserRole = { - SuperAdmin: 'SUPER_ADMIN', - Admin: 'ADMIN', - Manager: 'MANAGER', - User: 'USER' + SuperAdmin: 'SUPER_ADMIN', + Admin: 'ADMIN', + Manager: 'MANAGER', + User: 'USER', } as const; -export type UserRole = typeof UserRole[keyof typeof UserRole]; - +export type UserRole = (typeof UserRole)[keyof typeof UserRole]; diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validationError.ts index bdbd57ad..18cd1b61 100644 --- a/webapp/src/app/api/model/validationError.ts +++ b/webapp/src/app/api/model/validationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,8 @@ */ import { ValidationErrorLocInner } from './validationErrorLocInner'; - -export interface ValidationError { - loc: Array; - msg: string; - type: string; +export interface ValidationError { + loc: Array; + msg: string; + type: string; } - diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validationErrorLocInner.ts index d248a9b7..3c1ffa29 100644 --- a/webapp/src/app/api/model/validationErrorLocInner.ts +++ b/webapp/src/app/api/model/validationErrorLocInner.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface ValidationErrorLocInner { -} - +export interface ValidationErrorLocInner {} diff --git a/webapp/src/app/api/model/value.ts b/webapp/src/app/api/model/value.ts index a9fc79ba..016b21cb 100644 --- a/webapp/src/app/api/model/value.ts +++ b/webapp/src/app/api/model/value.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Value { -} - +export interface Value {} diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index 07d94a1c..6c6ae99b 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -24,48 +24,46 @@ import { WorkHasContent } from './workHasContent'; import { Location } from './location'; import { WorkBiblio } from './workBiblio'; - /** * A scholarly document (article, book, dataset, thesis, etc.) */ -export interface Work { - id?: string | null; - doi?: string | null; - title?: string | null; - display_name?: string | null; - publication_year?: number | null; - publication_date?: string | null; - type?: string | null; - language?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - is_paratext?: boolean | null; - primary_location?: Location | null; - locations?: Array | null; - best_oa_location?: Location | null; - open_access?: OpenAccess | null; - authorships?: Array | null; - ids?: WorkIds | null; - biblio?: WorkBiblio | null; - abstract_inverted_index?: object | null; - referenced_works?: Array | null; - referenced_works_count?: number | null; - related_works?: Array | null; - topics?: Array | null; - primary_topic?: WorkTopic | null; - keywords?: Array | null; - funders?: Array | null; - awards?: Array | null; - fwci?: Fwci | null; - citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; - cited_by_percentile_year?: WorkCitedByPercentileYear | null; - counts_by_year?: Array | null; - sustainable_development_goals?: Array | null; - mesh?: Array | null; - indexed_in?: Array | null; - has_content?: WorkHasContent | null; - content_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Work { + id?: string | null; + doi?: string | null; + title?: string | null; + display_name?: string | null; + publication_year?: number | null; + publication_date?: string | null; + type?: string | null; + language?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + is_paratext?: boolean | null; + primary_location?: Location | null; + locations?: Array | null; + best_oa_location?: Location | null; + open_access?: OpenAccess | null; + authorships?: Array | null; + ids?: WorkIds | null; + biblio?: WorkBiblio | null; + abstract_inverted_index?: object | null; + referenced_works?: Array | null; + referenced_works_count?: number | null; + related_works?: Array | null; + topics?: Array | null; + primary_topic?: WorkTopic | null; + keywords?: Array | null; + funders?: Array | null; + awards?: Array | null; + fwci?: Fwci | null; + citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; + cited_by_percentile_year?: WorkCitedByPercentileYear | null; + counts_by_year?: Array | null; + sustainable_development_goals?: Array | null; + mesh?: Array | null; + indexed_in?: Array | null; + has_content?: WorkHasContent | null; + content_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/workBiblio.ts b/webapp/src/app/api/model/workBiblio.ts index f6d7079b..65c0a34b 100644 --- a/webapp/src/app/api/model/workBiblio.ts +++ b/webapp/src/app/api/model/workBiblio.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; +export interface WorkBiblio { + volume?: string | null; + issue?: string | null; + first_page?: string | null; + last_page?: string | null; } - diff --git a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts index a587ddf6..4a2bc6d4 100644 --- a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts +++ b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Value } from './value'; - /** * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; +export interface WorkCitationNormalizedPercentile { + value?: Value | null; + is_in_top_1_percent?: boolean | null; + is_in_top_10_percent?: boolean | null; } - diff --git a/webapp/src/app/api/model/workCitedByPercentileYear.ts b/webapp/src/app/api/model/workCitedByPercentileYear.ts index 5257eb3b..7bcd3c85 100644 --- a/webapp/src/app/api/model/workCitedByPercentileYear.ts +++ b/webapp/src/app/api/model/workCitedByPercentileYear.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Percentile rank compared to other works published in the same year. Contains `min` and `max`. */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; +export interface WorkCitedByPercentileYear { + min?: number | null; + max?: number | null; } - diff --git a/webapp/src/app/api/model/workClassification.ts b/webapp/src/app/api/model/workClassification.ts index 25951d4a..e732ec26 100644 --- a/webapp/src/app/api/model/workClassification.ts +++ b/webapp/src/app/api/model/workClassification.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,33 +14,31 @@ import { WorkClassificationMeta } from './workClassificationMeta'; import { WorkClassificationValidation } from './workClassificationValidation'; import { WorkClassificationAuthor } from './workClassificationAuthor'; - /** * Represents a full work-classification document. */ -export interface WorkClassification { - /** - * The full OpenAlex work id/URL. - */ - work_id: string; - doi?: string | null; - title?: string | null; - publication_year?: number | null; - publication_type?: string | null; - /** - * The authors of the work. - */ - authors?: Array; - /** - * The institutions associated with the work. - */ - institutions?: Array; - /** - * The topics associated with the work. - */ - topics?: Array; - classification?: WorkClassificationDetails | null; - classification_meta?: WorkClassificationMeta | null; - validation?: WorkClassificationValidation | null; +export interface WorkClassification { + /** + * The full OpenAlex work id/URL. + */ + work_id: string; + doi?: string | null; + title?: string | null; + publication_year?: number | null; + publication_type?: string | null; + /** + * The authors of the work. + */ + authors?: Array; + /** + * The institutions associated with the work. + */ + institutions?: Array; + /** + * The topics associated with the work. + */ + topics?: Array; + classification?: WorkClassificationDetails | null; + classification_meta?: WorkClassificationMeta | null; + validation?: WorkClassificationValidation | null; } - diff --git a/webapp/src/app/api/model/workClassificationAuthor.ts b/webapp/src/app/api/model/workClassificationAuthor.ts index a28e37de..aef36e2b 100644 --- a/webapp/src/app/api/model/workClassificationAuthor.ts +++ b/webapp/src/app/api/model/workClassificationAuthor.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * An author entry within a work classification document. */ -export interface WorkClassificationAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface WorkClassificationAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationDetails.ts b/webapp/src/app/api/model/workClassificationDetails.ts index e096423b..20593e72 100644 --- a/webapp/src/app/api/model/workClassificationDetails.ts +++ b/webapp/src/app/api/model/workClassificationDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,16 @@ */ import { WorkPrimaryCategory } from './workPrimaryCategory'; - /** * The core classification result for a work. */ -export interface WorkClassificationDetails { - primary_category?: WorkPrimaryCategory | null; - confidence?: string | null; - pasteur_quadrant?: string | null; - applied_orientation_score?: number | null; - insufficient_context?: boolean | null; - signals_used?: Array | null; - classification_reason?: string | null; +export interface WorkClassificationDetails { + primary_category?: WorkPrimaryCategory | null; + confidence?: string | null; + pasteur_quadrant?: string | null; + applied_orientation_score?: number | null; + insufficient_context?: boolean | null; + signals_used?: Array | null; + classification_reason?: string | null; } -export namespace WorkClassificationDetails { -} - - +export namespace WorkClassificationDetails {} diff --git a/webapp/src/app/api/model/workClassificationInstitution.ts b/webapp/src/app/api/model/workClassificationInstitution.ts index db2eae24..754b1eb8 100644 --- a/webapp/src/app/api/model/workClassificationInstitution.ts +++ b/webapp/src/app/api/model/workClassificationInstitution.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * An institution entry within a work classification document. */ -export interface WorkClassificationInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface WorkClassificationInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationMeta.ts b/webapp/src/app/api/model/workClassificationMeta.ts index eb67e185..9e6619d5 100644 --- a/webapp/src/app/api/model/workClassificationMeta.ts +++ b/webapp/src/app/api/model/workClassificationMeta.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Metadata about how and when a classification was produced. */ -export interface WorkClassificationMeta { - model?: string | null; - prompt_version?: string | null; - classified_at?: string | null; +export interface WorkClassificationMeta { + model?: string | null; + prompt_version?: string | null; + classified_at?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationPage.ts b/webapp/src/app/api/model/workClassificationPage.ts index 22b71991..db7e3e0d 100644 --- a/webapp/src/app/api/model/workClassificationPage.ts +++ b/webapp/src/app/api/model/workClassificationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { WorkClassification } from './workClassification'; - -export interface WorkClassificationPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface WorkClassificationPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/workClassificationTopic.ts b/webapp/src/app/api/model/workClassificationTopic.ts index 5ea5b9f9..34f8c96a 100644 --- a/webapp/src/app/api/model/workClassificationTopic.ts +++ b/webapp/src/app/api/model/workClassificationTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,16 +9,14 @@ */ import { WorkClassificationTopicGroup } from './workClassificationTopicGroup'; - /** * A topic entry within a work classification document. */ -export interface WorkClassificationTopic { - id?: string | null; - display_name?: string | null; - score?: number | null; - domain?: WorkClassificationTopicGroup | null; - field?: WorkClassificationTopicGroup | null; - subfield?: WorkClassificationTopicGroup | null; +export interface WorkClassificationTopic { + id?: string | null; + display_name?: string | null; + score?: number | null; + domain?: WorkClassificationTopicGroup | null; + field?: WorkClassificationTopicGroup | null; + subfield?: WorkClassificationTopicGroup | null; } - diff --git a/webapp/src/app/api/model/workClassificationTopicGroup.ts b/webapp/src/app/api/model/workClassificationTopicGroup.ts index 58ce3fe6..8e574397 100644 --- a/webapp/src/app/api/model/workClassificationTopicGroup.ts +++ b/webapp/src/app/api/model/workClassificationTopicGroup.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * A domain/field/subfield group referenced within a classification topic. */ -export interface WorkClassificationTopicGroup { - id?: string | null; - display_name?: string | null; +export interface WorkClassificationTopicGroup { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationValidation.ts b/webapp/src/app/api/model/workClassificationValidation.ts index da1db647..46c91824 100644 --- a/webapp/src/app/api/model/workClassificationValidation.ts +++ b/webapp/src/app/api/model/workClassificationValidation.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Validation results for a classification. */ -export interface WorkClassificationValidation { - valid?: boolean | null; - errors?: Array | null; - corrections?: Array | null; +export interface WorkClassificationValidation { + valid?: boolean | null; + errors?: Array | null; + corrections?: Array | null; } - diff --git a/webapp/src/app/api/model/workCountsByYearInner.ts b/webapp/src/app/api/model/workCountsByYearInner.ts index 76d97d77..496a11db 100644 --- a/webapp/src/app/api/model/workCountsByYearInner.ts +++ b/webapp/src/app/api/model/workCountsByYearInner.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * WorkCountsByYearInner */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; +export interface WorkCountsByYearInner { + year?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/workHasContent.ts b/webapp/src/app/api/model/workHasContent.ts index 44fbe446..76871238 100644 --- a/webapp/src/app/api/model/workHasContent.ts +++ b/webapp/src/app/api/model/workHasContent.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Information about downloadable full-text content: */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; +export interface WorkHasContent { + pdf?: boolean | null; + grobid_xml?: boolean | null; } - diff --git a/webapp/src/app/api/model/workIds.ts b/webapp/src/app/api/model/workIds.ts index e8315250..fe562e40 100644 --- a/webapp/src/app/api/model/workIds.ts +++ b/webapp/src/app/api/model/workIds.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; +export interface WorkIds { + openalex?: string | null; + doi?: string | null; + mag?: number | null; + pmid?: string | null; + pmcid?: string | null; } - diff --git a/webapp/src/app/api/model/workKeyword.ts b/webapp/src/app/api/model/workKeyword.ts index c9c99afb..7270db25 100644 --- a/webapp/src/app/api/model/workKeyword.ts +++ b/webapp/src/app/api/model/workKeyword.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkKeyword */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkKeyword { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/workMeshInner.ts b/webapp/src/app/api/model/workMeshInner.ts index 40633524..36a0c569 100644 --- a/webapp/src/app/api/model/workMeshInner.ts +++ b/webapp/src/app/api/model/workMeshInner.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * WorkMeshInner */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; +export interface WorkMeshInner { + descriptor_ui?: string | null; + descriptor_name?: string | null; + qualifier_ui?: string | null; + qualifier_name?: string | null; + is_major_topic?: boolean | null; } - diff --git a/webapp/src/app/api/model/workNetworkNode.ts b/webapp/src/app/api/model/workNetworkNode.ts index abc04a69..445cd8ad 100644 --- a/webapp/src/app/api/model/workNetworkNode.ts +++ b/webapp/src/app/api/model/workNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,24 +10,20 @@ import { WorkTopicInformation } from './workTopicInformation'; import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface WorkNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; - publication_year: number | null; - work_topics_information: Set | null; +export interface WorkNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; + publication_year: number | null; + work_topics_information: Set | null; } -export namespace WorkNetworkNode { -} - - +export namespace WorkNetworkNode {} diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts index 8490c3ab..285d2065 100644 --- a/webapp/src/app/api/model/workPage.ts +++ b/webapp/src/app/api/model/workPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,27 +9,25 @@ */ import { Work } from './work'; - -export interface WorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; +export interface WorkPage { + /** + * Total number of works matching the query + */ + total: number; + /** + * List of works on the current page + */ + elements: Array; + /** + * Offset of the current page + */ + offset: number; + /** + * Size of the current page + */ + size: number; + /** + * Indicates if the current page is the last page + */ + last_page: boolean; } - diff --git a/webapp/src/app/api/model/workPageV2.ts b/webapp/src/app/api/model/workPageV2.ts index a22b6855..bc93d6ce 100644 --- a/webapp/src/app/api/model/workPageV2.ts +++ b/webapp/src/app/api/model/workPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Work } from './work'; - -export interface WorkPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface WorkPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/workPrimaryCategory.ts b/webapp/src/app/api/model/workPrimaryCategory.ts index ddbbde75..563359d3 100644 --- a/webapp/src/app/api/model/workPrimaryCategory.ts +++ b/webapp/src/app/api/model/workPrimaryCategory.ts @@ -1,23 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Represents the primary category of a work. */ export const WorkPrimaryCategory = { - BasicResearch: 'basic_research', - AppliedResearch: 'applied_research', - NonResearch: 'non_research', - ExperimentalDevelopment: 'experimental_development', - NotClassified: 'not_classified' + BasicResearch: 'basic_research', + AppliedResearch: 'applied_research', + NonResearch: 'non_research', + ExperimentalDevelopment: 'experimental_development', + NotClassified: 'not_classified', } as const; -export type WorkPrimaryCategory = typeof WorkPrimaryCategory[keyof typeof WorkPrimaryCategory]; - +export type WorkPrimaryCategory = + (typeof WorkPrimaryCategory)[keyof typeof WorkPrimaryCategory]; diff --git a/webapp/src/app/api/model/workSortBy.ts b/webapp/src/app/api/model/workSortBy.ts index 7580ac82..56f89162 100644 --- a/webapp/src/app/api/model/workSortBy.ts +++ b/webapp/src/app/api/model/workSortBy.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const WorkSortBy = { - Title: 'title', - Type: 'type', - PublicationYear: 'publication_year', - Language: 'language', - CitedByCount: 'cited_by_count' + Title: 'title', + Type: 'type', + PublicationYear: 'publication_year', + Language: 'language', + CitedByCount: 'cited_by_count', } as const; -export type WorkSortBy = typeof WorkSortBy[keyof typeof WorkSortBy]; - +export type WorkSortBy = (typeof WorkSortBy)[keyof typeof WorkSortBy]; diff --git a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts index c9ecd00f..8bc67292 100644 --- a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts +++ b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkSustainableDevelopmentGoalsInner */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkSustainableDevelopmentGoalsInner { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts index f938cb25..4b365f33 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/workTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,17 +12,15 @@ import { WorkTopicDomain } from './workTopicDomain'; import { WorkTopicSubfield } from './workTopicSubfield'; import { WorkTopicField } from './workTopicField'; - /** * WorkTopic */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - description?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; +export interface WorkTopic { + id?: string | null; + display_name?: string | null; + description?: string | null; + score?: Score | null; + subfield?: WorkTopicSubfield | null; + field?: WorkTopicField | null; + domain?: WorkTopicDomain | null; } - diff --git a/webapp/src/app/api/model/workTopicDomain.ts b/webapp/src/app/api/model/workTopicDomain.ts index 1a9879d4..13b227df 100644 --- a/webapp/src/app/api/model/workTopicDomain.ts +++ b/webapp/src/app/api/model/workTopicDomain.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [domain](/api-reference/domains) */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; +export interface WorkTopicDomain { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workTopicField.ts b/webapp/src/app/api/model/workTopicField.ts index 1807cfc1..432b993e 100644 --- a/webapp/src/app/api/model/workTopicField.ts +++ b/webapp/src/app/api/model/workTopicField.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [field](/api-reference/fields) */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; +export interface WorkTopicField { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts index ca3b9454..5dbbfc78 100644 --- a/webapp/src/app/api/model/workTopicInformation.ts +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; } - diff --git a/webapp/src/app/api/model/workTopicSubfield.ts b/webapp/src/app/api/model/workTopicSubfield.ts index b6e7278a..49c1155b 100644 --- a/webapp/src/app/api/model/workTopicSubfield.ts +++ b/webapp/src/app/api/model/workTopicSubfield.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [subfield](/api-reference/subfields) */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; +export interface WorkTopicSubfield { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/worksFilterProperties.ts b/webapp/src/app/api/model/worksFilterProperties.ts index bd6cc9a4..fd25fd26 100644 --- a/webapp/src/app/api/model/worksFilterProperties.ts +++ b/webapp/src/app/api/model/worksFilterProperties.ts @@ -1,34 +1,32 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface WorksFilterProperties { - /** - * The start publication year for the works to include in the collaboration network. - */ - start_year?: number; - /** - * The end publication year for the works to include in the collaboration network. - */ - end_year?: number; - /** - * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. - */ - allowed_topics?: Array; - /** - * The minimum number of contributors required for a work to be included in the collaboration network. - */ - min_contributors?: number; - /** - * The maximum number of contributors allowed for a work to be included in the collaboration network. - */ - max_contributors?: number; +export interface WorksFilterProperties { + /** + * The start publication year for the works to include in the collaboration network. + */ + start_year?: number; + /** + * The end publication year for the works to include in the collaboration network. + */ + end_year?: number; + /** + * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. + */ + allowed_topics?: Array; + /** + * The minimum number of contributors required for a work to be included in the collaboration network. + */ + min_contributors?: number; + /** + * The maximum number of contributors allowed for a work to be included in the collaboration network. + */ + max_contributors?: number; } - diff --git a/webapp/src/app/api/model/worksListResponse.ts b/webapp/src/app/api/model/worksListResponse.ts index a65d3849..bc21a41b 100644 --- a/webapp/src/app/api/model/worksListResponse.ts +++ b/webapp/src/app/api/model/worksListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Work } from './work'; import { GroupByResult } from './groupByResult'; - /** * WorksListResponse */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface WorksListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/yearlyData.ts b/webapp/src/app/api/model/yearlyData.ts index 3272805e..d473f13e 100644 --- a/webapp/src/app/api/model/yearlyData.ts +++ b/webapp/src/app/api/model/yearlyData.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface YearlyData { - year: number; - publications: number; - citations: number; +export interface YearlyData { + year: number; + publications: number; + citations: number; } - diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts index 78a2d20a..c6553e91 100644 --- a/webapp/src/app/api/param.ts +++ b/webapp/src/app/api/param.ts @@ -8,8 +8,7 @@ export type StandardParamStyle = | 'simple' | 'spaceDelimited' | 'pipeDelimited' - | 'deepObject' - ; + | 'deepObject'; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -25,13 +24,7 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | "integer" - | "number" - | "boolean" - | "string" - | "object" - | "array" - ; + 'integer' | 'number' | 'boolean' | 'string' | 'object' | 'array'; /** * Standard {@link DataType}s plus your own types/classes. @@ -42,16 +35,15 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | "int32" - | "int64" - | "float" - | "double" - | "byte" - | "binary" - | "date" - | "date-time" - | "password" - ; + | 'int32' + | 'int64' + | 'float' + | 'double' + | 'byte' + | 'binary' + | 'date' + | 'date-time' + | 'password'; export type DataFormat = StandardDataFormat | string; @@ -62,7 +54,7 @@ export interface Param { name: string; value: unknown; in: ParamLocation; - style: ParamStyle, + style: ParamStyle; explode: boolean; dataType: DataType; dataFormat: DataFormat | undefined; diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts index 19c762ac..960132f8 100644 --- a/webapp/src/app/api/provide-api.ts +++ b/webapp/src/app/api/provide-api.ts @@ -1,15 +1,17 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; import { Configuration, ConfigurationParameters } from './configuration'; import { BASE_PATH } from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === "string" - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} \ No newline at end of file +export function provideApi( + configOrBasePath: string | ConfigurationParameters, +): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === 'string' + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts index 6fe58549..2277a9cc 100644 --- a/webapp/src/app/api/variables.ts +++ b/webapp/src/app/api/variables.ts @@ -2,8 +2,8 @@ import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} + csv: ',', + tsv: ' ', + ssv: ' ', + pipes: '|', +}; diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index a2d46b53..e408e561 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -25,6 +25,8 @@ import { accountResolver } from './resolvers/account.resolver'; import { accountsPageResolver } from './resolvers/accounts-page.resolver'; import { accountsOrganizationResolver } from './resolvers/accounts-organizations.resolver'; import { organizationsOrganizationsResolver } from './resolvers/organizations-organizations.resolver'; +import { backgroundJobTasksResolver } from './resolvers/background-job-tasks.resolver'; +import { backgroundJobsDockerHealthResolver } from './resolvers/background-jobs-docker-health.resolver'; import { KeywordsToPersonsResultsComponent } from './modules/keywords-search/search-results/persons-results/persons-results.component'; import { KeywordsToProjectsResultsComponent } from './modules/keywords-search/search-results/projects-results/projects-results.component'; import { KeywordsToPatentsResultsComponent } from './modules/keywords-search/search-results/patents-results/patents-results.component'; @@ -332,6 +334,17 @@ export const routes: Routes = [ }, runGuardsAndResolvers: 'always', }, + { + path: 'jobs', + canActivate: [roleGuard([UserRole.SuperAdmin])], + loadComponent: () => + import('./modules/jobs/jobs.component').then((mod) => mod.JobsComponent), + resolve: { + tasks: backgroundJobTasksResolver, + dockerHealth: backgroundJobsDockerHealthResolver, + }, + runGuardsAndResolvers: 'always', + }, { path: 'news/:id', diff --git a/webapp/src/app/modules/dashboard/dashboard.component.html b/webapp/src/app/modules/dashboard/dashboard.component.html index 75f82e3e..36b1069d 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.html +++ b/webapp/src/app/modules/dashboard/dashboard.component.html @@ -141,7 +141,8 @@

Projektstatus nach Fördergeber

- Laufende, kommende und abgeschlossene EU- und Bund-Projekte Ihrer Organisation. + Laufende, kommende und abgeschlossene EU- und Bund-Projekte Ihrer + Organisation.

@if (euProjectStatuses && bmbfProjectStatuses) { @@ -234,7 +235,8 @@

DFG-Projekt-Topics

- Verteilung der gematchten Topics aus den DFG-Projekten Ihrer Organisation. + Verteilung der gematchten Topics aus den DFG-Projekten Ihrer + Organisation.

@if (dfgProjectTopics) { diff --git a/webapp/src/app/modules/dashboard/dashboard.component.ts b/webapp/src/app/modules/dashboard/dashboard.component.ts index 586d8f09..9a16019f 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.ts +++ b/webapp/src/app/modules/dashboard/dashboard.component.ts @@ -8,9 +8,7 @@ import { DfgTopicDonutComponent } from './dfg-topic-donut/dfg-topic-donut.compon import { EuProjectStatusChartComponent } from './eu-project-status-chart/eu-project-status-chart.component'; import { YearRangeSliderComponent } from '../../shared/ui/year-range-slider/year-range-slider.component'; import { LoadingComponent } from '../../shared/ui/loading/loading.component'; -import { - TopicTreemapComponent, -} from '../../shared/ui/topic-treemap/topic-treemap.component'; +import { TopicTreemapComponent } from '../../shared/ui/topic-treemap/topic-treemap.component'; import { TopicTreemapData, TopicTreemapTopicSelect, diff --git a/webapp/src/app/modules/dashboard/dfg-topic-donut/dfg-topic-donut.component.ts b/webapp/src/app/modules/dashboard/dfg-topic-donut/dfg-topic-donut.component.ts index 09e88311..2eb67e4a 100644 --- a/webapp/src/app/modules/dashboard/dfg-topic-donut/dfg-topic-donut.component.ts +++ b/webapp/src/app/modules/dashboard/dfg-topic-donut/dfg-topic-donut.component.ts @@ -92,9 +92,7 @@ export class DfgTopicDonutComponent implements OnChanges { } private truncate(value: string, maximum: number): string { - return value.length > maximum - ? `${value.slice(0, maximum - 1)}…` - : value; + return value.length > maximum ? `${value.slice(0, maximum - 1)}…` : value; } private escapeHtml(value: string): string { diff --git a/webapp/src/app/modules/dashboard/eu-project-status-chart/eu-project-status-chart.component.ts b/webapp/src/app/modules/dashboard/eu-project-status-chart/eu-project-status-chart.component.ts index 8211ea67..7725cf65 100644 --- a/webapp/src/app/modules/dashboard/eu-project-status-chart/eu-project-status-chart.component.ts +++ b/webapp/src/app/modules/dashboard/eu-project-status-chart/eu-project-status-chart.component.ts @@ -23,18 +23,12 @@ export class EuProjectStatusChartComponent implements OnChanges { const values = [ { name: 'Laufend', - data: [ - this.statuses?.ongoing ?? 0, - this.bmbfStatuses?.ongoing ?? 0, - ], + data: [this.statuses?.ongoing ?? 0, this.bmbfStatuses?.ongoing ?? 0], color: '#2563eb', }, { name: 'Kommend', - data: [ - this.statuses?.upcoming ?? 0, - this.bmbfStatuses?.upcoming ?? 0, - ], + data: [this.statuses?.upcoming ?? 0, this.bmbfStatuses?.upcoming ?? 0], color: '#f59e0b', }, { diff --git a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.html b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.html index 8351d069..cc7613ee 100644 --- a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.html +++ b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.html @@ -19,27 +19,41 @@
-
- +
-
- +
-
} @else if (loadFailed) {
- + Wordcloud nicht verfügbar Die Keywords konnten nicht geladen werden.
@@ -89,9 +105,14 @@
} @else {
- + Keine Keywords gefunden - Für dieses Topic sind im gewählten Zeitraum keine Daten vorhanden. + Für dieses Topic sind im gewählten Zeitraum keine Daten + vorhanden.
} diff --git a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.scss b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.scss index 1b66b75b..5c110e84 100644 --- a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.scss +++ b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.scss @@ -197,8 +197,16 @@ mat-dialog-content { gap: 14px 20px; padding: 30px 34px; background: - radial-gradient(circle at 15% 20%, rgba(114, 85, 217, 0.06), transparent 28%), - radial-gradient(circle at 85% 75%, rgba(11, 99, 206, 0.05), transparent 30%), + radial-gradient( + circle at 15% 20%, + rgba(114, 85, 217, 0.06), + transparent 28% + ), + radial-gradient( + circle at 85% 75%, + rgba(11, 99, 206, 0.05), + transparent 30% + ), #ffffff; } diff --git a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.ts b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.ts index 0ce09141..9cbf52d2 100644 --- a/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.ts +++ b/webapp/src/app/modules/dashboard/topic-wordcloud-dialog/topic-wordcloud-dialog.component.ts @@ -1,10 +1,7 @@ import { CommonModule } from '@angular/common'; import { Component, DestroyRef, inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { - MAT_DIALOG_DATA, - MatDialogModule, -} from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatButtonModule } from '@angular/material/button'; diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html new file mode 100644 index 00000000..13917cdf --- /dev/null +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.html @@ -0,0 +1,97 @@ +

Logs · {{ data.task.name }}

+ + + @if (runsLoading() && runs().length === 0) { +
+ + Läufe werden geladen … +
+ } @else if (runsError()) { +

{{ runsError() }}

+ } @else if (runs().length === 0) { +

Für diesen Job liegt noch kein Lauf vor.

+ } @else { + + Lauf auswählen + + @for (run of runs(); track run.id) { + + #{{ run.id }} · {{ statusMeta(run.status!).label }} · + {{ formatUtcDateAsLocal(run.started_at) }} + @if (run.exit_code != null) { + · Exit {{ run.exit_code }} + } + @if (formatRunDuration(run); as dur) { + · {{ dur }} + } + + } + + + +
+
+ Lauf #{{ selectedRunId() }} + @if (runStatus()) { + + {{ statusMeta(runStatus()!).icon }} + {{ statusMeta(runStatus()!).label }} + + } + @if (selectedRun(); as run) { + @if (runStatus() === 'running' || runStatus() === 'stopping') { + @if (formatRunElapsed(run, nowMs()); as elapsed) { + läuft seit {{ elapsed }} + } + } @else if (formatRunDuration(run); as dur) { + Dauer: {{ dur }} + } + } + zeigt letzte 200 Zeilen +
+
+ + +
+
+ +
+ @if (loading() && !logs()) { +
+ + Logs werden geladen … +
+ } @else { +
{{ logs() }}
+ } +
+ } +
+ + + + diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss new file mode 100644 index 00000000..b65b114c --- /dev/null +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.scss @@ -0,0 +1,155 @@ +.no-logs { + color: #64748b; + margin: 0; +} + +.runs-loading { + display: flex; + align-items: center; + gap: 10px; + min-height: 120px; + color: #64748b; +} + +.logs-error { + margin: 0; + padding: 16px; + border-radius: 6px; + background: #fef2f2; + color: #991b1b; +} + +.logs-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + margin-bottom: 12px; +} + +.run-meta { + display: flex; + align-items: center; + gap: 12px; + font-size: 13px; + color: #64748b; +} + +.logs-actions { + display: flex; + gap: 8px; + flex-shrink: 0; +} + +.task-status { + display: inline-flex; + align-items: center; + gap: 4px; + font-weight: 600; + + mat-icon { + font-size: 18px; + height: 18px; + width: 18px; + } + + &--success { + color: #166534; + } + + &--failed { + color: #991b1b; + } + + &--running { + color: #92400e; + } + + &--stopped { + color: #64748b; + } + + &--idle { + color: #64748b; + } +} + +.logs-panel { + background: #0f172a; + border-radius: 6px; + padding: 12px 14px; + min-width: 520px; + max-width: 80vw; + min-height: 120px; + max-height: 55vh; + overflow: auto; + scrollbar-width: thin; + scrollbar-color: #64748b #1e293b; + + &::-webkit-scrollbar { + width: 12px; + height: 12px; + } + + &::-webkit-scrollbar-track { + background: #1e293b; + border-radius: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #64748b; + border-radius: 6px; + border: 3px solid #0f172a; + } + + &::-webkit-scrollbar-thumb:hover { + background: #94a3b8; + } + + pre { + margin: 0; + color: #e2e8f0; + font-family: 'Roboto Mono', ui-monospace, monospace; + font-size: 12px; + white-space: pre-wrap; + word-break: break-word; + } + + .logs-loading { + color: #cbd5e1; + } +} + +.logs-loading { + display: flex; + align-items: center; + gap: 10px; + color: #64748b; + font-size: 13px; +} + +.run-select { + width: 100%; + margin-top: 8px; +} + +.logs-hint { + color: #94a3b8; + font-size: 12px; +} + +.run-duration { + font-size: 13px; + color: #475569; +} + +@media (max-width: 640px) { + .logs-header { + flex-direction: column; + align-items: stretch; + } + + .logs-panel { + min-width: 0; + } +} diff --git a/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts new file mode 100644 index 00000000..3828598b --- /dev/null +++ b/webapp/src/app/modules/jobs/job-logs-dialog/job-logs-dialog.component.ts @@ -0,0 +1,196 @@ +import { CommonModule } from '@angular/common'; +import { + Component, + DestroyRef, + ElementRef, + OnInit, + computed, + inject, + signal, + viewChild, +} from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { finalize, timer } from 'rxjs'; +import { BackgroundJobsService, BackgroundJobTask, JobRun } from '../../../api'; +import { + formatRunDuration, + formatRunElapsed, + formatUtcDateAsLocal, + statusMeta, +} from '../jobs.utils'; + +export interface JobLogsDialogData { + task: BackgroundJobTask; +} + +@Component({ + selector: 'app-job-logs-dialog', + imports: [ + CommonModule, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatProgressSpinnerModule, + MatSelectModule, + MatTooltipModule, + ], + templateUrl: './job-logs-dialog.component.html', + styleUrl: './job-logs-dialog.component.scss', + standalone: true, +}) +export class JobLogsDialogComponent implements OnInit { + private readonly dialogRef = inject(MatDialogRef); + private readonly backgroundJobsService = inject(BackgroundJobsService); + private readonly destroyRef = inject(DestroyRef); + protected readonly data = inject(MAT_DIALOG_DATA); + + protected readonly statusMeta = statusMeta; + protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal; + protected readonly formatRunDuration = formatRunDuration; + protected readonly formatRunElapsed = formatRunElapsed; + + protected readonly runs = signal([]); + protected readonly runsLoading = signal(false); + protected readonly runsError = signal(null); + protected readonly selectedRunId = signal(null); + protected readonly loading = signal(false); + protected readonly logs = signal(''); + protected readonly runStatus = signal(null); + protected readonly nowMs = signal(Date.now()); + + protected readonly selectedRun = computed( + () => this.runs().find((run) => run.id === this.selectedRunId()) ?? null, + ); + + private readonly logsPanel = viewChild>('logsPanel'); + + private followTail = true; + private readonly followThresholdPx = 24; + + ngOnInit(): void { + this.loadRuns(true); + timer(5000, 5000) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => this.loadRuns()); + timer(1000, 1000) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => this.nowMs.set(Date.now())); + } + + protected loadRuns(selectLatest = false): void { + if (this.runsLoading() || this.loading()) return; + this.runsLoading.set(true); + this.runsError.set(null); + this.backgroundJobsService + .getBackgroundJobTaskRuns( + this.data.task.id, + 50, + undefined, + 'body', + false, + { transferCache: false }, + ) + .pipe(finalize(() => this.runsLoading.set(false))) + .subscribe({ + next: (runs) => { + this.runs.set(runs); + const selected = selectLatest + ? runs[0] + : (runs.find((run) => run.id === this.selectedRunId()) ?? runs[0]); + if (selected) { + this.selectRun(selected); + } + }, + error: () => { + this.runsError.set('Läufe konnten nicht geladen werden.'); + }, + }); + } + + protected selectRun(run: JobRun): void { + if (run.id == null) return; + this.selectedRunId.set(run.id); + this.runStatus.set(run.status ?? null); + this.loadLogs(); + } + + protected onRunSelected(runId: number): void { + const run = this.runs().find((item) => item.id === runId); + if (run) { + this.followTail = true; + this.selectRun(run); + } + } + + protected onLogsScroll(): void { + const panel = this.logsPanel()?.nativeElement; + if (!panel) return; + const distanceFromBottom = + panel.scrollHeight - panel.scrollTop - panel.clientHeight; + this.followTail = distanceFromBottom <= this.followThresholdPx; + } + + private scrollToBottom(): void { + setTimeout(() => { + const panel = this.logsPanel()?.nativeElement; + if (panel) panel.scrollTop = panel.scrollHeight; + }); + } + + protected loadLogs(): void { + const runId = this.selectedRunId(); + if (runId == null) return; + + this.loading.set(true); + this.backgroundJobsService + .getBackgroundJobRunLogs(runId, undefined, 'body', false, { + transferCache: false, + }) + .pipe(finalize(() => this.loading.set(false))) + .subscribe({ + next: (result) => { + if (!result) { + this.logs.set('Die Log-Anfrage hat keine Daten zurückgegeben.'); + return; + } + this.logs.set(result.logs || 'Keine Logs vorhanden.'); + this.runStatus.set(result.status); + if (this.followTail) this.scrollToBottom(); + }, + error: () => { + this.logs.set('Logs konnten nicht geladen werden.'); + }, + }); + } + + protected downloadLogs(): void { + const runId = this.selectedRunId(); + if (runId == null) return; + + const run = this.runs().find((item) => item.id === runId); + const text = run?.logs ?? this.logs(); + const blob = new Blob([text], { type: 'text/plain;charset=utf-8' }); + const url = URL.createObjectURL(blob); + const anchor = document.createElement('a'); + anchor.href = url; + anchor.download = `${this.data.task.command ?? 'job'}-run-${runId}.log`; + anchor.click(); + URL.revokeObjectURL(url); + } + + protected close(): void { + this.dialogRef.close(); + } +} diff --git a/webapp/src/app/modules/jobs/jobs.component.html b/webapp/src/app/modules/jobs/jobs.component.html new file mode 100644 index 00000000..40e432be --- /dev/null +++ b/webapp/src/app/modules/jobs/jobs.component.html @@ -0,0 +1,262 @@ +
+ + +
+ + +
+ + +
+ Docker-Daemon +
+ {{ + dockerHealth()?.reachable ? 'Erreichbar' : 'Nicht erreichbar' + }} + @if (dockerHealth()?.detail) { + · {{ dockerHealth()?.detail }} + } +
+
+
+ +
+
+ + + +
+ + +
+
+ Nexus-Registry + @if (registryHealth()?.host) { + {{ registryHealth()?.host }} + } +
+
+ @if (registryHealthLoading() && !registryHealth()) { + Wird geprüft … + } @else { + {{ + registryHealth()?.reachable + ? 'Erreichbar' + : 'Nicht erreichbar' + }} + @if (registryHealth()?.detail) { + · {{ registryHealth()?.detail }} + } + } +
+
+
+ +
+
+
+ + + + + + +
+ + +
+ +
+ {{ row.name }} + {{ row.description }} + {{ row.target_index }} +
+
+
+ + +
+ @if (row.schedule) { + {{ row.schedule }} + } @else { + Nur manuell + } + @if (row.next_run_at) { + + Nächster Lauf: {{ formatUtcDateAsLocal(row.next_run_at) }} + + } + @if (row.schedule) { + + {{ row.enabled ? 'Aktiv' : 'Inaktiv' }} + + } +
+
+ + + + @if (row.status === 'running' || row.status === 'stopping') { + + } @else { + {{ statusMeta(row.status).icon }} + } + {{ statusMeta(row.status).label }} + + + + + @if (row.last_run) { +
+ {{ formatUtcDateAsLocal(row.last_run.started_at) }} + @if (row.status === 'running' || row.status === 'stopping') { + @if (formatRunElapsed(row.last_run, nowMs()); as elapsed) { + läuft seit {{ elapsed }} + } + } @else if (formatRunDuration(row.last_run); as duration) { + Dauer: {{ duration }} + } + @if (row.last_run.exit_code != null) { + Exit-Code {{ row.last_run.exit_code }} + } +
+ } @else { + Noch nicht ausgeführt + } +
+ + +
+ Aktionen + +
+
+ + +
+ + + + + +
+
diff --git a/webapp/src/app/modules/jobs/jobs.component.scss b/webapp/src/app/modules/jobs/jobs.component.scss new file mode 100644 index 00000000..1777b492 --- /dev/null +++ b/webapp/src/app/modules/jobs/jobs.component.scss @@ -0,0 +1,316 @@ +.jobs-page { + display: flex; + flex-direction: column; + gap: 20px; + padding: 24px; +} + +.page-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; +} + +.new-job-button { + flex-shrink: 0; + white-space: nowrap; +} + +h1, +p { + margin: 0; +} + +.page-header h1 { + font-size: 26px; + font-weight: 700; +} + +.page-header p { + color: #64748b; + margin-top: 6px; +} + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} + +.health-cards { + display: flex; + gap: 12px; +} + +.health-card { + flex: 1 1 0; + min-width: 0; +} + +.health-content { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.health-info { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; +} + +.health-text { + min-width: 0; +} + +.state-dot { + width: 12px; + height: 12px; + border-radius: 50%; + background: #94a3b8; + flex-shrink: 0; + + &--ok { + background: #16a34a; + } + + &--error { + background: #dc2626; + } +} + +.health-detail { + font-size: 12px; + color: #64748b; +} + +.health-title { + display: flex; + align-items: baseline; + gap: 8px; + flex-wrap: wrap; +} + +.health-host { + font-size: 11px; + color: #64748b; + word-break: break-all; +} + +:host ::ng-deep .mat-mdc-row { + height: 96px; +} + +:host ::ng-deep .mat-mdc-row .mat-mdc-cell { + padding-top: 12px; + padding-bottom: 12px; + vertical-align: middle; +} + +:host ::ng-deep .mat-mdc-header-cell { + text-align: center; +} + +:host ::ng-deep .mat-mdc-cell:not(:last-child), +:host ::ng-deep .mat-mdc-header-cell:not(:last-child) { + border-right: 1px solid var(--sg-border); +} + +:host ::ng-deep .mat-mdc-cell.mat-column-lastRun { + text-align: center; +} + +:host ::ng-deep .mat-mdc-cell.mat-column-schedule { + text-align: center; +} + +.task-name-cell { + display: flex; + flex-direction: row; + align-items: center; + gap: 6px; + min-width: 220px; +} + +.task-name-text { + display: flex; + flex-direction: column; + gap: 2px; +} + +.edit-name-action { + flex: 0 0 auto; + display: inline-flex; + align-items: center; + justify-content: center; + width: 22px; + height: 22px; + padding: 0; + border: none; + background: none; + cursor: pointer; + color: #64748b; + opacity: 0; + transition: opacity 0.15s ease; + + .mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + line-height: 18px; + } +} + +.task-name-cell:hover .edit-name-action, +.edit-name-action:focus-visible { + opacity: 1; +} + +.edit-name-action[disabled] { + cursor: not-allowed; + color: #cbd5e1; +} + +.task-description { + font-size: 12px; + color: #64748b; +} + +.task-index { + width: fit-content; + font-size: 11px; + color: #475569; + background: #f1f5f9; + border-radius: 4px; + padding: 1px 6px; +} + +.task-schedule-cell { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 4px; +} + +.schedule-cron { + white-space: nowrap; + font-family: + ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace; + font-size: 13px; + color: #334155; +} + +.next-run { + font-size: 12px; + color: #64748b; +} + +.enabled-badge { + width: fit-content; + font-size: 11px; + font-weight: 700; + padding: 1px 8px; + border-radius: 999px; + background: #e2e8f0; + color: #64748b; + + &--on { + background: #dcfce7; + color: #166534; + } +} + +.task-status { + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 13px; + font-weight: 600; + + mat-icon { + font-size: 18px; + height: 18px; + width: 18px; + } + + &--success { + color: #166534; + } + + &--failed { + color: #991b1b; + } + + &--running { + color: #92400e; + } + + &--stopped { + color: #64748b; + } + + &--idle { + color: #64748b; + } +} + +.last-run-cell { + display: flex; + flex-direction: column; + align-items: center; + gap: 2px; + font-size: 13px; + white-space: nowrap; +} + +.last-run-message { + font-size: 12px; + color: #64748b; +} + +.last-run-empty { + font-size: 13px; + color: #64748b; +} + +.row-actions { + display: flex; + gap: 4px; +} + +.delete-action:not(:disabled) { + color: #b91c1c; +} + +.actions-header { + display: grid; + grid-template-columns: 40px 1fr 40px; + align-items: center; + width: 100%; + + span { + grid-column: 2; + } + + button { + grid-column: 3; + } +} + +@media (max-width: 640px) { + .jobs-page { + padding: 16px; + } + + .page-header { + align-items: flex-start; + flex-direction: column; + } + + .health-cards { + flex-direction: column; + } +} diff --git a/webapp/src/app/modules/jobs/jobs.component.ts b/webapp/src/app/modules/jobs/jobs.component.ts new file mode 100644 index 00000000..97a53644 --- /dev/null +++ b/webapp/src/app/modules/jobs/jobs.component.ts @@ -0,0 +1,561 @@ +import { CommonModule } from '@angular/common'; +import { + Component, + DestroyRef, + OnInit, + TemplateRef, + inject, + input, + signal, + viewChild, +} from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { + EMPTY, + Subject, + Subscription, + catchError, + merge, + switchMap, + timer, +} from 'rxjs'; +import { + BackgroundJobsService, + BackgroundJobTask, + DockerHealth, + RegistryHealth, +} from '../../api'; +import { + DataTableComponent, + GenericColumn, +} from '../../shared/ui/data-table/data-table.component'; +import { + formatRunDuration, + formatRunElapsed, + formatScheduleCron, + formatUtcDateAsLocal, + statusMeta, + toUtcMs, +} from './jobs.utils'; +import { + TaskScheduleDialogComponent, + TaskScheduleDialogData, + TaskScheduleDialogResult, +} from './task-schedule-dialog/task-schedule-dialog.component'; +import { + JobLogsDialogComponent, + JobLogsDialogData, +} from './job-logs-dialog/job-logs-dialog.component'; +import { TaskCreateDialogComponent } from './task-create-dialog/task-create-dialog.component'; +import { + TaskEditDialogComponent, + TaskEditDialogData, +} from './task-edit-dialog/task-edit-dialog.component'; + +const MAX_IDLE_POLL_WAIT_MS = 60000; + +@Component({ + selector: 'app-jobs', + imports: [ + CommonModule, + MatButtonModule, + MatCardModule, + MatDialogModule, + MatIconModule, + MatProgressSpinnerModule, + MatSnackBarModule, + MatTooltipModule, + DataTableComponent, + ], + templateUrl: './jobs.component.html', + styleUrl: './jobs.component.scss', + standalone: true, +}) +export class JobsComponent implements OnInit { + private readonly dialog = inject(MatDialog); + private readonly snackBar = inject(MatSnackBar); + private readonly backgroundJobsService = inject(BackgroundJobsService); + private readonly destroyRef = inject(DestroyRef); + + tasksInput = input.required({ alias: 'tasks' }); + dockerHealthInput = input.required({ alias: 'dockerHealth' }); + + protected readonly tasks = signal([]); + protected readonly dockerHealth = signal(null); + protected readonly dockerHealthLoading = signal(false); + protected readonly registryHealth = signal(null); + protected readonly registryHealthLoading = signal(false); + protected readonly deletingTaskIds = signal>(new Set()); + protected readonly nowMs = signal(Date.now()); + + protected readonly statusMeta = statusMeta; + protected readonly formatScheduleCron = formatScheduleCron; + protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal; + protected readonly formatRunDuration = formatRunDuration; + protected readonly formatRunElapsed = formatRunElapsed; + + protected taskColumns: GenericColumn[] = []; + + private readonly taskNameTmp = + viewChild.required>('taskNameTmp'); + private readonly taskScheduleTmp = + viewChild.required>('taskScheduleTmp'); + private readonly taskStatusTmp = + viewChild.required>('taskStatusTmp'); + private readonly taskLastRunTmp = + viewChild.required>('taskLastRunTmp'); + private readonly taskActionsTmp = + viewChild.required>('taskActionsTmp'); + private readonly taskActionsHeaderTmp = viewChild.required>( + 'taskActionsHeaderTmp', + ); + + private readonly taskRefreshTrigger = new Subject(); + private readonly pollNow = new Subject(); + private readonly pendingStopTaskIds = new Set(); + private pollDelaySub?: Subscription; + private tickSub?: Subscription; + + ngOnInit(): void { + this.tasks.set(this.tasksInput()); + this.dockerHealth.set(this.dockerHealthInput()); + this.refreshRegistryHealth(); + + merge(this.pollNow, this.taskRefreshTrigger) + .pipe( + switchMap(() => + this.backgroundJobsService + .getBackgroundJobTasks(undefined, 'body', false, { + transferCache: false, + }) + .pipe( + catchError(() => { + this.showError('Jobs konnten nicht aktualisiert werden.'); + return EMPTY; + }), + ), + ), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((tasks) => { + this.setTasksPreservingPendingStops(tasks); + this.syncBackgroundWork(); + }); + + this.syncBackgroundWork(); + + this.taskColumns = [ + { + id: 'name', + header: 'Job', + type: 'display', + cellTemplate: this.taskNameTmp(), + }, + { + id: 'schedule', + header: 'Zeitplan', + type: 'display', + cellTemplate: this.taskScheduleTmp(), + }, + { + id: 'status', + header: 'Status', + type: 'display', + cellTemplate: this.taskStatusTmp(), + }, + { + id: 'lastRun', + header: 'Letzter Lauf', + type: 'display', + cellTemplate: this.taskLastRunTmp(), + }, + { + id: 'actions', + header: 'Aktionen', + type: 'display', + headerTemplate: this.taskActionsHeaderTmp(), + cellTemplate: this.taskActionsTmp(), + }, + ]; + } + + protected refreshTasks(): void { + this.taskRefreshTrigger.next(); + } + + private hasActiveTask(): boolean { + return this.tasks().some( + (task) => task.status === 'running' || task.status === 'stopping', + ); + } + + private syncBackgroundWork(): void { + const active = this.hasActiveTask(); + + if (active && !this.tickSub) { + this.tickSub = timer(1000, 1000) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => this.nowMs.set(Date.now())); + } else if (!active && this.tickSub) { + this.tickSub.unsubscribe(); + this.tickSub = undefined; + } + + this.pollDelaySub?.unsubscribe(); + this.pollDelaySub = undefined; + const delayMs = this.nextPollDelayMs(active); + if (delayMs != null) { + this.pollDelaySub = timer(delayMs) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => this.pollNow.next()); + } + } + + private nextPollDelayMs(active: boolean): number | null { + if (active) return 5000; + + const nextRun = this.earliestUpcomingRun(); + if (nextRun == null) return null; + + const untilRun = nextRun - Date.now(); + if (untilRun <= 0) return 3000; + return Math.min(untilRun + 3000, MAX_IDLE_POLL_WAIT_MS); + } + + private earliestUpcomingRun(): number | null { + let earliest: number | null = null; + for (const task of this.tasks()) { + if (!task.enabled || !task.schedule || !task.next_run_at) continue; + const ts = toUtcMs(task.next_run_at); + if (earliest == null || ts < earliest) earliest = ts; + } + return earliest; + } + + protected refreshDockerHealth(): void { + this.dockerHealthLoading.set(true); + this.backgroundJobsService.getBackgroundJobsDockerHealth().subscribe({ + next: (health) => { + this.dockerHealth.set(health); + this.dockerHealthLoading.set(false); + }, + error: () => { + this.dockerHealthLoading.set(false); + this.showError('Docker-Status konnte nicht abgerufen werden.'); + }, + }); + } + + protected refreshRegistryHealth(): void { + this.registryHealthLoading.set(true); + this.backgroundJobsService + .getBackgroundJobsRegistryHealth() + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (health) => { + this.registryHealth.set(health); + this.registryHealthLoading.set(false); + }, + error: () => { + this.registryHealthLoading.set(false); + this.showError('Nexus-Status konnte nicht abgerufen werden.'); + }, + }); + } + + private notifyIfRegistryDown(): void { + this.backgroundJobsService + .getBackgroundJobsRegistryHealth() + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (health) => { + this.registryHealth.set(health); + if (!health.reachable) { + this.showError( + `Nexus-Registry nicht erreichbar: ${health.detail}. Die Image-Auswahl bleibt leer.`, + ); + } + }, + }); + } + + protected runNow(task: BackgroundJobTask): void { + if (['running', 'stopping'].includes(task.status)) return; + + this.backgroundJobsService.runBackgroundJobTask(task.id).subscribe({ + next: (run) => { + const status = run.status ?? 'running'; + this.updateTask(task.id, (current) => ({ + ...current, + status, + last_run: run, + })); + if (status === 'failed') { + this.showError( + `„${task.name}“ ist fehlgeschlagen — Details in den Logs.`, + ); + this.refreshRegistryHealth(); + } else { + this.snackBar.open(`„${task.name}“ wurde gestartet.`, 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + } + this.refreshTasks(); + }, + error: (error) => + this.showError( + error.status === 409 + ? `„${task.name}“ läuft bereits.` + : `„${task.name}“ konnte nicht gestartet werden.`, + ), + }); + } + + protected stopNow(task: BackgroundJobTask): void { + const runId = task.last_run?.id; + if (task.status !== 'running' || runId == null) return; + + this.pendingStopTaskIds.add(task.id); + this.updateTask(task.id, (current) => ({ + ...current, + status: 'stopping', + })); + + this.backgroundJobsService.stopBackgroundJobRun(runId).subscribe({ + next: (run) => { + this.pendingStopTaskIds.delete(task.id); + this.updateTask(task.id, (current) => ({ + ...current, + status: run.status ?? 'running', + last_run: run, + })); + const message = + run.status === 'stopped' + ? `„${task.name}“ wurde gestoppt.` + : `„${task.name}“ war bereits beendet.`; + this.snackBar.open(message, 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + this.refreshTasks(); + }, + error: (error) => { + this.pendingStopTaskIds.delete(task.id); + this.updateTask(task.id, (current) => ({ + ...current, + status: 'running', + })); + this.showError( + error.status === 409 + ? `„${task.name}“ läuft nicht.` + : `„${task.name}“ konnte nicht gestoppt werden.`, + ); + this.refreshTasks(); + }, + }); + } + + protected openLogsDialog(task: BackgroundJobTask): void { + if (task.last_run?.id == null) return; + + this.dialog.open( + JobLogsDialogComponent, + { + width: '640px', + maxWidth: 'calc(100vw - 32px)', + data: { task }, + }, + ); + } + + protected openCreateDialog(): void { + this.notifyIfRegistryDown(); + + const dialogRef = this.dialog.open< + TaskCreateDialogComponent, + void, + BackgroundJobTask | undefined + >(TaskCreateDialogComponent, { + width: '560px', + maxWidth: 'calc(100vw - 32px)', + }); + + dialogRef.afterClosed().subscribe((task) => { + if (!task) return; + + this.tasks.update((tasks) => [...tasks, task]); + this.snackBar.open(`„${task.name}“ wurde angelegt.`, 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + this.refreshTasks(); + }); + } + + protected openEditDialog(task: BackgroundJobTask): void { + if (['running', 'stopping'].includes(task.status)) return; + + this.notifyIfRegistryDown(); + + const dialogRef = this.dialog.open< + TaskEditDialogComponent, + TaskEditDialogData, + BackgroundJobTask | undefined + >(TaskEditDialogComponent, { + width: '560px', + maxWidth: 'calc(100vw - 32px)', + data: { task }, + }); + + dialogRef.afterClosed().subscribe((updatedTask) => { + if (!updatedTask) return; + + this.updateTask(updatedTask.id, () => updatedTask); + this.snackBar.open(`„${updatedTask.name}“ wurde gespeichert.`, 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + }); + } + + protected openScheduleDialog(task: BackgroundJobTask): void { + const dialogRef = this.dialog.open< + TaskScheduleDialogComponent, + TaskScheduleDialogData, + TaskScheduleDialogResult | undefined + >(TaskScheduleDialogComponent, { + width: '520px', + maxWidth: 'calc(100vw - 32px)', + data: { task }, + }); + + dialogRef.afterClosed().subscribe((result) => { + if (!result) return; + + this.backgroundJobsService + .updateBackgroundJobTask(result.taskId, { + enabled: result.enabled, + schedule: result.schedule, + }) + .subscribe({ + next: (updatedTask) => { + this.updateTask(result.taskId, () => updatedTask); + this.snackBar.open('Zeitplan wurde gespeichert.', 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + }, + error: (error) => + this.showError( + error?.error?.detail ?? + 'Zeitplan konnte nicht gespeichert werden.', + ), + }); + }); + } + + protected confirmDeleteTask(task: BackgroundJobTask): void { + if ( + ['running', 'stopping'].includes(task.status) || + this.deletingTaskIds().has(task.id) + ) { + return; + } + + import('../../shared/ui/confirmation-dialog/confirmation-dialog.component').then( + ({ ConfirmationDialogComponent }) => { + const dialogRef = this.dialog.open(ConfirmationDialogComponent, { + width: '520px', + maxWidth: 'calc(100vw - 32px)', + data: { + title: 'Job löschen', + message: `Möchtest Du „${task.name}“ wirklich löschen? Alle Laufdaten und gespeicherten Logs werden dauerhaft gelöscht.`, + confirmText: 'Löschen', + cancelText: 'Abbrechen', + }, + }); + + dialogRef.afterClosed().subscribe((confirmed) => { + if (confirmed) this.deleteTask(task); + }); + }, + ); + } + + private updateTask( + id: number, + updater: (task: BackgroundJobTask) => BackgroundJobTask, + ): void { + this.tasks.update((current) => + current.map((task) => (task.id === id ? updater(task) : task)), + ); + this.syncBackgroundWork(); + } + + private deleteTask(task: BackgroundJobTask): void { + this.deletingTaskIds.update((ids) => new Set(ids).add(task.id)); + + this.backgroundJobsService.deleteBackgroundJobTask(task.id).subscribe({ + next: () => { + this.finishDeletingTask(task.id); + this.tasks.update((tasks) => + tasks.filter((current) => current.id !== task.id), + ); + this.snackBar.open(`„${task.name}“ wurde gelöscht.`, 'OK', { + duration: 3000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + this.refreshTasks(); + }, + error: (error) => { + this.finishDeletingTask(task.id); + this.showError( + error.status === 409 + ? `„${task.name}“ läuft noch und kann nicht gelöscht werden.` + : `„${task.name}“ konnte nicht gelöscht werden.`, + ); + this.refreshTasks(); + }, + }); + } + + private finishDeletingTask(taskId: number): void { + this.deletingTaskIds.update((ids) => { + const updated = new Set(ids); + updated.delete(taskId); + return updated; + }); + } + + private setTasksPreservingPendingStops(tasks: BackgroundJobTask[]): void { + this.tasks.set( + tasks.map((task) => + this.pendingStopTaskIds.has(task.id) + ? { ...task, status: 'stopping' } + : task, + ), + ); + } + + private showError(message: string): void { + this.snackBar.open(message, 'OK', { + duration: 5000, + horizontalPosition: 'center', + verticalPosition: 'bottom', + }); + } +} diff --git a/webapp/src/app/modules/jobs/jobs.utils.ts b/webapp/src/app/modules/jobs/jobs.utils.ts new file mode 100644 index 00000000..23bcfc58 --- /dev/null +++ b/webapp/src/app/modules/jobs/jobs.utils.ts @@ -0,0 +1,84 @@ +import { JobRun } from '../../api'; + +export interface StatusMeta { + label: string; + icon: string; + cssClass: string; +} + +const STATUS_META: Record = { + running: { label: 'Läuft', icon: 'sync', cssClass: 'task-status--running' }, + stopping: { + label: 'Wird gestoppt', + icon: 'stop_circle', + cssClass: 'task-status--running', + }, + succeeded: { + label: 'Erfolgreich', + icon: 'check_circle', + cssClass: 'task-status--success', + }, + failed: { + label: 'Fehlgeschlagen', + icon: 'error', + cssClass: 'task-status--failed', + }, + stopped: { + label: 'Gestoppt', + icon: 'stop_circle', + cssClass: 'task-status--stopped', + }, + idle: { label: 'Bereit', icon: 'schedule', cssClass: 'task-status--idle' }, +}; + +export function statusMeta(status: string): StatusMeta { + return STATUS_META[status] ?? STATUS_META['idle']; +} + +export function formatScheduleCron(schedule: string | null): string { + return schedule ? `Cron: ${schedule}` : 'Nur manuell'; +} + +function appendUtcZ(value: string): string { + return /(?:Z|[+-]\d{2}:\d{2})$/.test(value) ? value : `${value}Z`; +} + +export function toUtcMs(value: string): number { + return new Date(appendUtcZ(value)).getTime(); +} + +export function formatUtcDateAsLocal(value: string | null | undefined): string { + if (!value) return ''; + return new Intl.DateTimeFormat('de-DE', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + hour12: false, + }).format(new Date(appendUtcZ(value))); +} + +export function formatDurationSeconds(totalSeconds: number): string { + const s = Math.max(0, Math.round(totalSeconds)); + const pad = (n: number) => n.toString().padStart(2, '0'); + const hours = Math.floor(s / 3600); + const minutes = Math.floor((s % 3600) / 60); + const seconds = s % 60; + if (hours > 0) { + return `${hours}:${pad(minutes)}:${pad(seconds)} h`; + } + return `${pad(minutes)}:${pad(seconds)} min`; +} + +export function formatRunDuration(run: JobRun): string | null { + if (!run.started_at || !run.finished_at) return null; + return formatDurationSeconds( + (toUtcMs(run.finished_at) - toUtcMs(run.started_at)) / 1000, + ); +} + +export function formatRunElapsed(run: JobRun, nowMs: number): string | null { + if (!run.started_at) return null; + return formatDurationSeconds((nowMs - toUtcMs(run.started_at)) / 1000); +} diff --git a/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.html b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.html new file mode 100644 index 00000000..a41f8ed6 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.html @@ -0,0 +1,117 @@ +

Neuer Job

+ + +
+ + Name + + info_outline + @if (form.controls.name.invalid) { + Bitte einen Namen eingeben. + } + + + + Befehl + + info_outline + + + + Image + + + @for (image of filteredImages(); track image) { + {{ image }} + } + + info_outline + @if (form.controls.image.invalid && form.controls.image.touched) { + Bitte ein Image auswählen oder eingeben. + } + Aus Nexus wählen oder eigenes Image eingeben. + + + + Beschreibung (optional) + + info_outline + + + + Ziel-Index (optional) + + info_outline + + + + Umgebungsvariablen (optional) + + info_outline + Eine Variable pro Zeile im Format KEY=value. + @if (form.controls.env.hasError('invalidEnv')) { + Ungültige Zeile — Format: KEY=value. + } + +
+ + @if (serverError()) { +

{{ serverError() }}

+ } +
+ + + + + diff --git a/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.scss b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.scss new file mode 100644 index 00000000..e4d82bc2 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.scss @@ -0,0 +1,50 @@ +.create-form { + display: flex; + flex-direction: column; + gap: 12px; + min-width: 400px; + + padding-top: 6px; +} + +.command-input, +.image-input { + resize: vertical; + font-family: + ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace; + font-size: 13px; + line-height: 1.5; + white-space: pre-wrap; + word-break: break-all; +} + +.commands-loading { + display: flex; + align-items: center; + gap: 8px; + color: #64748b; + font-size: 14px; +} + +.field-hint { + margin: -6px 0 0; + color: #64748b; + font-size: 12px; +} + +.field-info { + color: #94a3b8; + cursor: help; +} + +.server-error { + margin: 8px 0 0; + color: #b3261e; + font-size: 14px; +} + +@media (max-width: 640px) { + .create-form { + min-width: 0; + } +} diff --git a/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.ts b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.ts new file mode 100644 index 00000000..d4d1ae50 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-create-dialog/task-create-dialog.component.ts @@ -0,0 +1,147 @@ +import { CommonModule } from '@angular/common'; +import { Component, OnInit, computed, inject, signal } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { BackgroundJobTask, BackgroundJobsService } from '../../../api'; + +const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/; + +@Component({ + selector: 'app-task-create-dialog', + imports: [ + CommonModule, + ReactiveFormsModule, + MatAutocompleteModule, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatTooltipModule, + ], + templateUrl: './task-create-dialog.component.html', + styleUrl: './task-create-dialog.component.scss', + standalone: true, +}) +export class TaskCreateDialogComponent implements OnInit { + private readonly dialogRef = + inject< + MatDialogRef + >(MatDialogRef); + private readonly backgroundJobsService = inject(BackgroundJobsService); + + protected readonly creating = signal(false); + protected readonly serverError = signal(''); + protected readonly images = signal([]); + + protected readonly form = new FormGroup({ + name: new FormControl('', { + nonNullable: true, + validators: [Validators.required], + }), + description: new FormControl('', { nonNullable: true }), + targetIndex: new FormControl('', { nonNullable: true }), + command: new FormControl('', { nonNullable: true }), + image: new FormControl('', { + nonNullable: true, + validators: [Validators.required], + }), + env: new FormControl('', { nonNullable: true }), + }); + + private readonly imageQuery = toSignal( + this.form.controls.image.valueChanges, + { + initialValue: this.form.controls.image.value, + }, + ); + + protected readonly filteredImages = computed(() => { + const query = (this.imageQuery() ?? '').toLowerCase().trim(); + const all = this.images(); + if (!query) return all; + return all.filter((image) => image.toLowerCase().includes(query)); + }); + + ngOnInit(): void { + this.backgroundJobsService + .getBackgroundJobAvailableImages() + .subscribe({ next: (result) => this.images.set(result.images ?? []) }); + } + + protected submit(): void { + this.serverError.set(''); + const value = this.form.getRawValue(); + + const name = value.name.trim(); + if (!name) { + this.form.controls.name.markAsTouched(); + return; + } + + const image = value.image.trim(); + if (!image) { + this.form.controls.image.markAsTouched(); + return; + } + + const command = value.command.trim() || null; + const env = this.parseEnv(value.env); + if (env === undefined) return; + + this.creating.set(true); + this.backgroundJobsService + .createBackgroundJobTask({ + name, + description: value.description.trim(), + target_index: value.targetIndex.trim(), + image, + command, + env, + }) + .subscribe({ + next: (task) => this.dialogRef.close(task), + error: (error) => { + this.creating.set(false); + const detail = error?.error?.detail; + this.serverError.set( + typeof detail === 'string' + ? detail + : 'Der Job konnte nicht angelegt werden.', + ); + }, + }); + } + + protected close(): void { + this.dialogRef.close(); + } + + private parseEnv(text: string): { [key: string]: string } | undefined { + const env: { [key: string]: string } = {}; + for (const line of text.split('\n')) { + const trimmed = line.trim(); + if (!trimmed) continue; + if (!ENV_LINE_PATTERN.test(trimmed)) { + this.form.controls.env.setErrors({ invalidEnv: true }); + this.form.controls.env.markAsTouched(); + return undefined; + } + const separatorIndex = trimmed.indexOf('='); + env[trimmed.slice(0, separatorIndex)] = trimmed.slice(separatorIndex + 1); + } + return env; + } +} diff --git a/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.html b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.html new file mode 100644 index 00000000..59f0b31f --- /dev/null +++ b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.html @@ -0,0 +1,117 @@ +

Job bearbeiten

+ + +
+ + Name + + info_outline + @if (form.controls.name.invalid) { + Bitte einen Namen eingeben. + } + + + + Befehl + + info_outline + + + + Image + + + @for (image of filteredImages(); track image) { + {{ image }} + } + + info_outline + @if (form.controls.image.invalid && form.controls.image.touched) { + Bitte ein Image auswählen oder eingeben. + } + Aus Nexus wählen oder eigenes Image eingeben. + + + + Beschreibung (optional) + + info_outline + + + + Ziel-Index (optional) + + info_outline + + + + Umgebungsvariablen (optional) + + info_outline + Eine Variable pro Zeile im Format KEY=value. + @if (form.controls.env.hasError('invalidEnv')) { + Ungültige Zeile — Format: KEY=value. + } + +
+ + @if (serverError()) { +

{{ serverError() }}

+ } +
+ + + + + diff --git a/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.scss b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.scss new file mode 100644 index 00000000..6f18c2d5 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.scss @@ -0,0 +1,36 @@ +.edit-form { + display: flex; + flex-direction: column; + gap: 12px; + min-width: 400px; + + padding-top: 6px; +} + +.command-input, +.image-input { + resize: vertical; + font-family: + ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace; + font-size: 13px; + line-height: 1.5; + white-space: pre-wrap; + word-break: break-all; +} + +.field-info { + color: #94a3b8; + cursor: help; +} + +.server-error { + margin: 8px 0 0; + color: #b3261e; + font-size: 14px; +} + +@media (max-width: 640px) { + .edit-form { + min-width: 0; + } +} diff --git a/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.ts b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.ts new file mode 100644 index 00000000..87f52cdd --- /dev/null +++ b/webapp/src/app/modules/jobs/task-edit-dialog/task-edit-dialog.component.ts @@ -0,0 +1,169 @@ +import { CommonModule } from '@angular/common'; +import { Component, OnInit, computed, inject, signal } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { BackgroundJobTask, BackgroundJobsService } from '../../../api'; + +const ENV_LINE_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*=.*$/; + +export interface TaskEditDialogData { + task: BackgroundJobTask; +} + +@Component({ + selector: 'app-task-edit-dialog', + imports: [ + CommonModule, + ReactiveFormsModule, + MatAutocompleteModule, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatTooltipModule, + ], + templateUrl: './task-edit-dialog.component.html', + styleUrl: './task-edit-dialog.component.scss', + standalone: true, +}) +export class TaskEditDialogComponent implements OnInit { + private readonly dialogRef = + inject< + MatDialogRef + >(MatDialogRef); + private readonly backgroundJobsService = inject(BackgroundJobsService); + protected readonly data = inject(MAT_DIALOG_DATA); + + protected readonly saving = signal(false); + protected readonly serverError = signal(''); + protected readonly images = signal([]); + + protected readonly form = new FormGroup({ + name: new FormControl(this.data.task.name, { + nonNullable: true, + validators: [Validators.required], + }), + description: new FormControl(this.data.task.description, { + nonNullable: true, + }), + targetIndex: new FormControl(this.data.task.target_index, { + nonNullable: true, + }), + command: new FormControl(this.data.task.command ?? '', { + nonNullable: true, + }), + image: new FormControl(this.data.task.image ?? '', { + nonNullable: true, + validators: [Validators.required], + }), + env: new FormControl(this.envToText(this.data.task.env), { + nonNullable: true, + }), + }); + + private readonly imageQuery = toSignal( + this.form.controls.image.valueChanges, + { + initialValue: this.form.controls.image.value, + }, + ); + + protected readonly filteredImages = computed(() => { + const query = (this.imageQuery() ?? '').toLowerCase().trim(); + const all = this.images(); + if (!query) return all; + return all.filter((image) => image.toLowerCase().includes(query)); + }); + + ngOnInit(): void { + this.backgroundJobsService + .getBackgroundJobAvailableImages() + .subscribe({ next: (result) => this.images.set(result.images ?? []) }); + } + + protected submit(): void { + this.serverError.set(''); + const value = this.form.getRawValue(); + + const name = value.name.trim(); + if (!name) { + this.form.controls.name.markAsTouched(); + return; + } + + const image = value.image.trim(); + if (!image) { + this.form.controls.image.markAsTouched(); + return; + } + + const env = this.parseEnv(value.env); + if (env === undefined) return; + + this.saving.set(true); + this.backgroundJobsService + .updateBackgroundJobTask(this.data.task.id, { + name, + description: value.description.trim(), + target_index: value.targetIndex.trim(), + image, + command: value.command.trim() || null, + env, + }) + .subscribe({ + next: (task) => this.dialogRef.close(task), + error: (error) => { + this.saving.set(false); + const detail = error?.error?.detail; + this.serverError.set( + typeof detail === 'string' + ? detail + : 'Der Job konnte nicht gespeichert werden.', + ); + }, + }); + } + + protected close(): void { + this.dialogRef.close(); + } + + private envToText(env: { [key: string]: string }): string { + return Object.entries(env) + .map(([key, value]) => `${key}=${value}`) + .join('\n'); + } + + private parseEnv(text: string): { [key: string]: string } | undefined { + const env: { [key: string]: string } = {}; + for (const line of text.split('\n')) { + const trimmed = line.trim(); + if (!trimmed) continue; + if (!ENV_LINE_PATTERN.test(trimmed)) { + this.form.controls.env.setErrors({ invalidEnv: true }); + this.form.controls.env.markAsTouched(); + return undefined; + } + const separatorIndex = trimmed.indexOf('='); + env[trimmed.slice(0, separatorIndex)] = trimmed.slice(separatorIndex + 1); + } + return env; + } +} diff --git a/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.html b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.html new file mode 100644 index 00000000..670be803 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.html @@ -0,0 +1,129 @@ +

{{ data.task.name }}

+ + +

{{ data.task.description }}

+ +
+ + Ausführung + + Nur manuell + Stündlich + Täglich + Wöchentlich + Monatlich + Erweiterter Cron-Ausdruck + + + + @switch (form.controls.mode.value) { + @case ('hourly') { + + Minute der Stunde + + Angabe in UTC, zwischen 0 und 59. + @if (form.controls.minute.invalid) { + Bitte eine Minute zwischen 0 und 59 eingeben. + } + + } + @case ('daily') { + + } + @case ('weekly') { +
+ + Wochentag + + @for (weekday of weekdays; track weekday.value) { + + {{ weekday.label }} + + } + + + +
+ } + @case ('monthly') { +
+ + Tag des Monats + + @if (form.controls.monthDay.invalid) { + Bitte einen Tag zwischen 1 und 31 eingeben. + } + + +
+

+ In kürzeren Monaten wird ein nicht vorhandener Tag übersprungen. +

+ } + @case ('advanced') { + + Cron-Ausdruck (UTC) + + Minute · Stunde · Tag · Monat · Wochentag + @if (form.controls.cronExpression.hasError('invalidCron')) { + Ungültiger Cron-Ausdruck, z. B. „0 3 * * *“. + } + + } + } + + @if (form.controls.mode.value !== 'manual') { + + } + + @if (data.task.next_run_at && form.controls.mode.value !== 'manual') { +

+ Nächster geplanter Lauf: + {{ formatUtcDateAsLocal(data.task.next_run_at) }} Uhr +

+ } + + + + Uhrzeit (UTC) + + @if (form.controls.time.invalid) { + Bitte eine gültige Uhrzeit eingeben. + } + + +
+
+ + + + + diff --git a/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.scss b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.scss new file mode 100644 index 00000000..a684f79b --- /dev/null +++ b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.scss @@ -0,0 +1,97 @@ +.task-description { + margin: 0 0 16px; + color: #64748b; +} + +.schedule-form { + display: flex; + flex-direction: column; + gap: 12px; + min-width: 360px; +} + +.schedule-fields { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; +} + +.field-hint { + margin: -6px 0 0; + color: #64748b; + font-size: 12px; +} + +::ng-deep .schedule-mode-panel.mat-mdc-select-panel { + max-height: 360px; +} + +.enabled-toggle { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 0; + border: none; + background: none; + cursor: pointer; + font: inherit; + align-self: flex-start; +} + +.enabled-toggle__track { + position: relative; + flex: 0 0 auto; + width: 36px; + height: 20px; + border-radius: 999px; + background: #cbd5e1; + transition: background 0.15s ease; +} + +.enabled-toggle__thumb { + position: absolute; + top: 2px; + left: 2px; + width: 16px; + height: 16px; + border-radius: 50%; + background: #ffffff; + box-shadow: 0 1px 2px rgba(16, 26, 61, 0.3); + transition: transform 0.15s ease; +} + +.enabled-toggle--on .enabled-toggle__track { + background: #2259a8; +} + +.enabled-toggle--on .enabled-toggle__thumb { + transform: translateX(16px); +} + +.enabled-toggle__label { + font-size: 14px; + color: var(--sg-text, #101a3d); +} + +.enabled-toggle:focus-visible { + outline: 2px solid #2259a8; + outline-offset: 2px; + border-radius: 4px; +} + +.next-run-hint { + margin: 0; + font-size: 12px; + color: #64748b; +} + +@media (max-width: 640px) { + .schedule-form { + min-width: 0; + } + + .schedule-fields { + grid-template-columns: 1fr; + gap: 0; + } +} diff --git a/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.ts b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.ts new file mode 100644 index 00000000..75549038 --- /dev/null +++ b/webapp/src/app/modules/jobs/task-schedule-dialog/task-schedule-dialog.component.ts @@ -0,0 +1,223 @@ +import { CommonModule } from '@angular/common'; +import { Component, inject } from '@angular/core'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { BackgroundJobTask } from '../../../api'; +import { formatUtcDateAsLocal } from '../jobs.utils'; + +export interface TaskScheduleDialogData { + task: BackgroundJobTask; +} + +export interface TaskScheduleDialogResult { + taskId: number; + enabled: boolean; + schedule: string | null; +} + +type ScheduleMode = + | 'manual' + | 'hourly' + | 'daily' + | 'weekly' + | 'monthly' + | 'advanced'; + +interface ScheduleValues { + mode: ScheduleMode; + minute: number; + time: string; + weekday: number; + monthDay: number; +} + +const CRON_PATTERN = /^\S+\s+\S+\s+\S+\s+\S+\s+\S+$/; +const TIME_PATTERN = /^([01]\d|2[0-3]):([0-5]\d)$/; + +const WEEKDAYS = [ + { value: 1, label: 'Montag' }, + { value: 2, label: 'Dienstag' }, + { value: 3, label: 'Mittwoch' }, + { value: 4, label: 'Donnerstag' }, + { value: 5, label: 'Freitag' }, + { value: 6, label: 'Samstag' }, + { value: 0, label: 'Sonntag' }, +]; + +function parseSchedule(schedule: string | null): ScheduleValues { + const defaults: ScheduleValues = { + mode: 'manual', + minute: 0, + time: '03:00', + weekday: 1, + monthDay: 1, + }; + + if (!schedule) return defaults; + + let match = schedule.match(/^(\d{1,2}) \* \* \* \*$/); + if (match && Number(match[1]) <= 59) { + return { ...defaults, mode: 'hourly', minute: Number(match[1]) }; + } + + match = schedule.match(/^(\d{1,2}) (\d{1,2}) \* \* \*$/); + if (match && Number(match[1]) <= 59 && Number(match[2]) <= 23) { + return { + ...defaults, + mode: 'daily', + time: toTime(match[2], match[1]), + }; + } + + match = schedule.match(/^(\d{1,2}) (\d{1,2}) \* \* ([0-6])$/); + if (match && Number(match[1]) <= 59 && Number(match[2]) <= 23) { + return { + ...defaults, + mode: 'weekly', + time: toTime(match[2], match[1]), + weekday: Number(match[3]), + }; + } + + match = schedule.match(/^(\d{1,2}) (\d{1,2}) ([1-9]|[12]\d|3[01]) \* \*$/); + if (match && Number(match[1]) <= 59 && Number(match[2]) <= 23) { + return { + ...defaults, + mode: 'monthly', + time: toTime(match[2], match[1]), + monthDay: Number(match[3]), + }; + } + + return { ...defaults, mode: 'advanced' }; +} + +function toTime(hour: string, minute: string): string { + return `${hour.padStart(2, '0')}:${minute.padStart(2, '0')}`; +} + +@Component({ + selector: 'app-task-schedule-dialog', + imports: [ + CommonModule, + ReactiveFormsModule, + MatButtonModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatSelectModule, + ], + templateUrl: './task-schedule-dialog.component.html', + styleUrl: './task-schedule-dialog.component.scss', + standalone: true, +}) +export class TaskScheduleDialogComponent { + private readonly dialogRef = + inject< + MatDialogRef< + TaskScheduleDialogComponent, + TaskScheduleDialogResult | undefined + > + >(MatDialogRef); + protected readonly data = inject(MAT_DIALOG_DATA); + protected readonly weekdays = WEEKDAYS; + protected readonly formatUtcDateAsLocal = formatUtcDateAsLocal; + + private readonly initialSchedule = parseSchedule(this.data.task.schedule); + + protected readonly form = new FormGroup({ + enabled: new FormControl(this.data.task.enabled, { nonNullable: true }), + mode: new FormControl(this.initialSchedule.mode, { + nonNullable: true, + }), + minute: new FormControl(this.initialSchedule.minute, { + nonNullable: true, + validators: [Validators.min(0), Validators.max(59)], + }), + time: new FormControl(this.initialSchedule.time, { + nonNullable: true, + validators: [Validators.pattern(TIME_PATTERN)], + }), + weekday: new FormControl(this.initialSchedule.weekday, { + nonNullable: true, + }), + monthDay: new FormControl(this.initialSchedule.monthDay, { + nonNullable: true, + validators: [Validators.min(1), Validators.max(31)], + }), + cronExpression: new FormControl(this.data.task.schedule ?? '', { + nonNullable: true, + }), + }); + + protected submit(): void { + const value = this.form.getRawValue(); + const schedule = this.buildSchedule(value); + + if (schedule === undefined) return; + + this.dialogRef.close({ + taskId: this.data.task.id, + enabled: value.enabled, + schedule, + }); + } + + protected close(): void { + this.dialogRef.close(); + } + + private buildSchedule( + value: ReturnType, + ): string | null | undefined { + if (value.mode === 'manual') return null; + + if (value.mode === 'hourly') { + if (this.form.controls.minute.invalid) { + this.form.controls.minute.markAsTouched(); + return undefined; + } + return `${value.minute} * * * *`; + } + + if (['daily', 'weekly', 'monthly'].includes(value.mode)) { + if (this.form.controls.time.invalid) { + this.form.controls.time.markAsTouched(); + return undefined; + } + const [hour, minute] = value.time.split(':').map(Number); + if (value.mode === 'daily') return `${minute} ${hour} * * *`; + if (value.mode === 'weekly') { + return `${minute} ${hour} * * ${value.weekday}`; + } + if (this.form.controls.monthDay.invalid) { + this.form.controls.monthDay.markAsTouched(); + return undefined; + } + return `${minute} ${hour} ${value.monthDay} * *`; + } + + const cron = value.cronExpression.trim(); + if (!CRON_PATTERN.test(cron)) { + this.form.controls.cronExpression.setErrors({ invalidCron: true }); + this.form.controls.cronExpression.markAsTouched(); + return undefined; + } + return cron; + } +} diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts index 0194c0a6..b2435ab2 100644 --- a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts @@ -122,8 +122,7 @@ export class PersonCompanyConnectionsComponent implements OnInit { const parentRoute = this.route.parent; const authorId = parentRoute?.snapshot.paramMap.get('id'); const resolved = parentRoute?.snapshot.data['personData'] as - | PersonDataResolved - | undefined; + PersonDataResolved | undefined; if (!authorId || !resolved) { this.loading = false; diff --git a/webapp/src/app/modules/person-funding/person-funding.component.html b/webapp/src/app/modules/person-funding/person-funding.component.html index 00805abc..838cdb4a 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.html +++ b/webapp/src/app/modules/person-funding/person-funding.component.html @@ -466,7 +466,8 @@ }

-
+
{{ getUniquePublicationCount() }} diff --git a/webapp/src/app/modules/person-funding/person-funding.component.ts b/webapp/src/app/modules/person-funding/person-funding.component.ts index 250711b4..af9649f6 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.ts +++ b/webapp/src/app/modules/person-funding/person-funding.component.ts @@ -55,12 +55,7 @@ type FundingPublicationDetail = { @Component({ selector: 'app-person-funding', - imports: [ - CommonModule, - MatFormFieldModule, - MatSelectModule, - MatIconModule, - ], + imports: [CommonModule, MatFormFieldModule, MatSelectModule, MatIconModule], templateUrl: './person-funding.component.html', styleUrl: './person-funding.component.scss', }) diff --git a/webapp/src/app/modules/person-patents/person-patents.component.ts b/webapp/src/app/modules/person-patents/person-patents.component.ts index 9e837060..c2d57d30 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.ts +++ b/webapp/src/app/modules/person-patents/person-patents.component.ts @@ -63,8 +63,7 @@ export class PersonPatentsComponent { .pipe( switchMap((data) => { const resolved = data['personPatents'] as - | PersonPatentsResolved - | undefined; + PersonPatentsResolved | undefined; if (!resolved?.patents$) { return of(null); } diff --git a/webapp/src/app/modules/preprocessing-mock-backup/preprocessing.component.html b/webapp/src/app/modules/preprocessing-mock-backup/preprocessing.component.html new file mode 100644 index 00000000..b13eb6f3 --- /dev/null +++ b/webapp/src/app/modules/preprocessing-mock-backup/preprocessing.component.html @@ -0,0 +1,204 @@ +
+ + + + +
+ + +
+ {{ containerStatus().name }} +
+ {{ containerStatus().image }} + {{ + containerStatus().imageDigest + }} + @switch (containerStatus().state) { + @case ('running') { + Läuft{{ + containerStatus().uptime + ? ' · seit ' + containerStatus().uptime + : '' + }} + } + @case ('stopped') { + Gestoppt + } + @case ('restarting') { + Wird neu gestartet … + } + } + @if (containerStatus().updateAvailable) { + + upgrade + Neue Version verfügbar + + } +
+
+
+ +
+ @if (containerStatus().updateAvailable) { + + } + @if (containerStatus().state === 'running') { + + + } @else { + + } +
+
+
+ + + + + + +
+ + +
+ {{ row.name }} + {{ row.description }} + {{ row.targetIndex }} +
+
+ + +
+ {{ formatSchedule(row.schedule) }} + +
+
+ + + @switch (row.status) { + @case ('running') { + + + Läuft + + } + @case ('success') { + + check_circle + Erfolgreich + + } + @case ('failed') { + + error + Fehlgeschlagen + + } + @default { + + schedule + Bereit + + } + } + + + + @if (row.lastRun) { +
+ {{ row.lastRun.startedAt | date: 'dd.MM.yyyy HH:mm' }} + {{ row.lastRun.message }} +
+ } @else { + Noch nicht ausgeführt + } +
+ + +
+ + +
+
diff --git a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts index 003ae7c2..b6414b33 100644 --- a/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts +++ b/webapp/src/app/modules/projects/eu-cordis-details/eu-details.component.ts @@ -17,11 +17,7 @@ import { PatentsCardsComponent } from './patents-cards/patents-cards.component'; import { DeliverablesCardsComponent } from './deliverables-cards/deliverables-cards.component'; export type TabType = - | 'overview' - | 'organizations' - | 'publications' - | 'iprs' - | 'deliverables'; + 'overview' | 'organizations' | 'publications' | 'iprs' | 'deliverables'; @Component({ selector: 'app-eu-details', diff --git a/webapp/src/app/modules/publication-detail/research-profile/research-profile.component.ts b/webapp/src/app/modules/publication-detail/research-profile/research-profile.component.ts index 1a74b684..2fd6c24c 100644 --- a/webapp/src/app/modules/publication-detail/research-profile/research-profile.component.ts +++ b/webapp/src/app/modules/publication-detail/research-profile/research-profile.component.ts @@ -25,10 +25,7 @@ import { } from '../../../shared/ui/topic-chip/topic-chip.component'; type PasteurQuadrant = - | 'pure_basic' - | 'use_inspired_basic' - | 'pure_applied' - | 'not_applicable'; + 'pure_basic' | 'use_inspired_basic' | 'pure_applied' | 'not_applicable'; interface QuadrantDefinition { key: PasteurQuadrant; diff --git a/webapp/src/app/resolvers/background-job-tasks.resolver.ts b/webapp/src/app/resolvers/background-job-tasks.resolver.ts new file mode 100644 index 00000000..e32575bc --- /dev/null +++ b/webapp/src/app/resolvers/background-job-tasks.resolver.ts @@ -0,0 +1,14 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { BackgroundJobsService, BackgroundJobTask } from '../api'; + +export const backgroundJobTasksResolver: ResolveFn< + BackgroundJobTask[] +> = () => { + return inject(BackgroundJobsService).getBackgroundJobTasks( + undefined, + 'body', + false, + { transferCache: false }, + ); +}; diff --git a/webapp/src/app/resolvers/background-jobs-docker-health.resolver.ts b/webapp/src/app/resolvers/background-jobs-docker-health.resolver.ts new file mode 100644 index 00000000..5a8e1a94 --- /dev/null +++ b/webapp/src/app/resolvers/background-jobs-docker-health.resolver.ts @@ -0,0 +1,9 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { BackgroundJobsService, DockerHealth } from '../api'; + +export const backgroundJobsDockerHealthResolver: ResolveFn< + DockerHealth +> = () => { + return inject(BackgroundJobsService).getBackgroundJobsDockerHealth(); +}; diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index 7f0e1896..25b9782e 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -147,6 +147,13 @@ export class AppMenuComponent { disabled: false, superAdminOnly: true, }, + { + label: 'Jobs', + icon: 'sync', + route: '/jobs', + disabled: false, + superAdminOnly: true, + }, ]; return items; }); diff --git a/webapp/src/app/shared/ui/confirmation-dialog/confirmation-dialog.component.scss b/webapp/src/app/shared/ui/confirmation-dialog/confirmation-dialog.component.scss index 1dd84db8..a459ffda 100644 --- a/webapp/src/app/shared/ui/confirmation-dialog/confirmation-dialog.component.scss +++ b/webapp/src/app/shared/ui/confirmation-dialog/confirmation-dialog.component.scss @@ -1,4 +1,6 @@ .action { + justify-content: center; + button { min-width: 150px; } diff --git a/webapp/src/app/shared/ui/data-table/data-table.component.html b/webapp/src/app/shared/ui/data-table/data-table.component.html index babc2916..c7a62547 100644 --- a/webapp/src/app/shared/ui/data-table/data-table.component.html +++ b/webapp/src/app/shared/ui/data-table/data-table.component.html @@ -1,4 +1,7 @@ -
+
@for (col of columns(); track col.id) { - @if (col.type === 'accessor') { + @if (col.headerTemplate) { + + } @else if (col.type === 'accessor') { diff --git a/webapp/src/app/shared/ui/data-table/data-table.component.scss b/webapp/src/app/shared/ui/data-table/data-table.component.scss index 87d6020d..736905e6 100644 --- a/webapp/src/app/shared/ui/data-table/data-table.component.scss +++ b/webapp/src/app/shared/ui/data-table/data-table.component.scss @@ -1,3 +1,7 @@ +.data-table-container { + overflow-x: auto; +} + .mat-mdc-table { background-color: var(--sg-background); } diff --git a/webapp/src/app/shared/ui/data-table/data-table.component.ts b/webapp/src/app/shared/ui/data-table/data-table.component.ts index 6fa71428..6be5c79e 100644 --- a/webapp/src/app/shared/ui/data-table/data-table.component.ts +++ b/webapp/src/app/shared/ui/data-table/data-table.component.ts @@ -25,6 +25,7 @@ export interface BaseColumn { id: string; header: string; type: 'accessor' | 'display' | 'group'; + headerTemplate?: TemplateRef; cellTemplate?: TemplateRef; } diff --git a/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html index 16bea6b6..0b54ba44 100644 --- a/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html +++ b/webapp/src/app/shared/ui/topic-treemap/topic-treemap.component.html @@ -1,7 +1,11 @@ @if (data?.fields?.length) { @if (selectedNodeId) {
+ + {{ col.header }}