diff --git a/service/src/main/inse/integrations/elasticsearch.py b/service/src/main/inse/integrations/elasticsearch.py
index 449b748f..8efe92ef 100644
--- a/service/src/main/inse/integrations/elasticsearch.py
+++ b/service/src/main/inse/integrations/elasticsearch.py
@@ -56,6 +56,7 @@ def search(
sort: Optional[List] = None,
body: Optional[Dict] = None,
track_total_hits=False,
+ highlight: Optional[Dict] = None,
cluster: str = "nes",
) -> Dict[str, Any]:
"""Searches the specified Elasticsearch index using either a simple query string or a full query body.
@@ -97,6 +98,8 @@ def search(
payload["sort"] = sort
if track_total_hits:
payload["track_total_hits"] = True
+ if highlight is not None:
+ payload["highlight"] = highlight
else:
payload = {
"query": {
diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py
index 7dae7575..24c763de 100644
--- a/service/src/main/inse/main.py
+++ b/service/src/main/inse/main.py
@@ -26,6 +26,8 @@ from inse.topics.service import router as topics_service_router
from inse.works.service import router as works_service_router
from inse.persons.service import router as persons_service_router
from inse.funders.service import router as funders_service_router
+from inse.news.service import router as news_service_router
+from inse.projects.router import router as projects_router
from inse.patents.service import router as patents_service_router
from inse.institutions.router import router as institutions_router
@@ -52,6 +54,7 @@ app.include_router(topics_service_router)
app.include_router(works_service_router)
app.include_router(persons_service_router)
app.include_router(funders_service_router)
+app.include_router(news_service_router)
app.include_router(company_connections_router)
app.include_router(service_router)
app.include_router(account_router)
diff --git a/service/src/main/inse/news/__init__.py b/service/src/main/inse/news/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/service/src/main/inse/news/logic.py b/service/src/main/inse/news/logic.py
new file mode 100644
index 00000000..48e7f5ff
--- /dev/null
+++ b/service/src/main/inse/news/logic.py
@@ -0,0 +1,274 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+Business logic for the "aktuell" news index on the INSE cluster.
+"""
+
+import logging
+
+from fastapi import HTTPException
+from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR
+
+from ..integrations import elasticsearch
+from ..persons.logic import find_ude_author_by_name, get_author_name_by_id
+from .model import MentionedPerson, NewsArticle, NewsArticleDetail, NewsPage
+
+logger = logging.getLogger(__name__)
+
+
+def get_news_page(page: int, page_size: int, sort_order: str = "desc") -> NewsPage:
+ offset = (page - 1) * page_size
+
+ response = _run_search(
+ query={"match_all": {}},
+ source=["date", "maintitle", "author", "url"],
+ size=page_size,
+ offset=offset,
+ sort=[{"date_full": sort_order}],
+ )
+
+ return _build_page(response, page, page_size)
+
+
+def search_news(query_text: str, page: int, page_size: int) -> NewsPage:
+ offset = (page - 1) * page_size
+
+ highlight = {
+ "fields": {"full_content": {"fragment_size": 200, "number_of_fragments": 1}},
+ "pre_tags": [""],
+ "post_tags": [""],
+ "encoder": "html",
+ }
+
+ response = _run_search(
+ query={"match": {"full_content": query_text}},
+ source=["date", "maintitle", "author", "url"],
+ size=page_size,
+ offset=offset,
+ sort=None,
+ highlight=highlight,
+ )
+
+ return _build_page(response, page, page_size)
+
+def get_news_by_author(
+ author_id: str,
+ page: int = 1,
+ page_size: int = 10,
+ sort_order: str = "desc",
+ query_text: str | None = None,
+) -> NewsPage:
+
+ author_name = get_author_name_by_id(author_id)
+ if not author_name:
+ return _empty_page(page, page_size)
+
+ news_ids = _find_news_ids_for_author(author_name)
+ if not news_ids:
+ return _empty_page(page, page_size)
+
+ es_query = {"bool": {"filter": [{"ids": {"values": news_ids}}]}}
+ if query_text:
+ es_query["bool"]["must"] = [
+ {"multi_match": {"query": query_text, "fields": ["maintitle", "author"]}}
+ ]
+
+ offset = (page - 1) * page_size
+ response = _run_search(
+ query=es_query,
+ source=["date", "maintitle", "author", "url"],
+ size=page_size,
+ offset=offset,
+ sort=[{"date_full": sort_order}],
+ )
+
+ return _build_page(response, page, page_size)
+
+
+def _find_news_ids_for_author(author_name: str) -> list:
+
+ try:
+ response = elasticsearch.search(
+ index="aktuell_postproc",
+ query={"term": {"authors.keyword": author_name}},
+ source=["news_id"],
+ size=1000,
+ cluster="inse",
+ )
+ except Exception:
+ logger.exception(f"Postproc-search: Finding news IDs for author '{author_name}' failed.")
+ return []
+
+ news_ids = []
+ for hit in response.get("hits", {}).get("hits", []):
+ news_id = hit.get("_source", {}).get("news_id")
+ if news_id:
+ news_ids.append(news_id)
+
+ return news_ids
+
+
+def _empty_page(page: int = 1, page_size: int = 0) -> NewsPage:
+ return NewsPage(total=0, page=page, page_size=page_size, results=[])
+
+
+def get_news_by_id(news_id: str) -> NewsArticleDetail:
+ try:
+ response = elasticsearch.get(
+ index="aktuell",
+ doc_id=news_id,
+ source=["date", "maintitle", "author", "url", "full_content"],
+ cluster="inse",
+ )
+ except Exception as exc:
+ logger.exception("Abruf des News-Artikels fehlgeschlagen.")
+ raise HTTPException(
+ status_code=HTTP_500_INTERNAL_SERVER_ERROR,
+ detail="Etwas ist schiefgelaufen.",
+ ) from exc
+
+ source = response.get("_source", {})
+
+ relevant, authors = _get_postproc_labels(news_id)
+
+ return NewsArticleDetail(
+ id=response.get("_id"),
+ date=source.get("date"),
+ maintitle=source.get("maintitle"),
+ author=source.get("author"),
+ url=source.get("url"),
+ full_content=source.get("full_content"),
+ relevant=relevant,
+ authors=_build_mentioned_persons(authors),
+ )
+
+
+def _build_mentioned_persons(author_names: list) -> list:
+
+ ude_persons = []
+ other_persons = []
+
+ for name in author_names:
+ match = find_ude_author_by_name(name)
+ if match:
+ ude_persons.append(
+ MentionedPerson(name=name, is_ude=True, person_id=match["id"])
+ )
+ else:
+ other_persons.append(MentionedPerson(name=name))
+
+ return ude_persons + other_persons
+
+
+def _get_postproc_labels(news_id: str) -> tuple[bool | None, list]:
+ try:
+ response = elasticsearch.search(
+ index="aktuell_postproc",
+ query={"term": {"news_id.keyword": news_id}},
+ source=["relevant", "authors"],
+ size=1,
+ cluster="inse",
+ )
+ except Exception:
+ logger.exception(f"Postproc-Lookup for {news_id} failed.")
+ return None, []
+
+ hits = response.get("hits", {}).get("hits", [])
+ if not hits:
+ return None, []
+
+ postproc_source = hits[0].get("_source", {})
+ relevant = bool(postproc_source.get("relevant", 0))
+ authors = postproc_source.get("authors") or []
+
+ return relevant, authors
+
+
+def _run_search(query: dict, source: list, size: int, offset: int, sort, highlight: dict = None) -> dict:
+ try:
+ return elasticsearch.search(
+ index="aktuell",
+ query=query,
+ source=source,
+ size=size,
+ offset=offset,
+ sort=sort,
+ track_total_hits=True,
+ highlight=highlight,
+ cluster="inse",
+ )
+ except Exception as exc:
+ logger.exception("Elasticsearch-Anfrage an Index 'aktuell' fehlgeschlagen.")
+ raise HTTPException(
+ status_code=HTTP_500_INTERNAL_SERVER_ERROR,
+ detail="Etwas ist schiefgelaufen.",
+ ) from exc
+
+
+def _build_page(response: dict, page: int, page_size: int) -> NewsPage:
+ hits_section = response.get("hits", {})
+ total = hits_section.get("total", {}).get("value", 0)
+ hits = hits_section.get("hits", [])
+
+ news_ids = []
+ for hit in hits:
+ news_id = hit.get("_id")
+ if news_id:
+ news_ids.append(news_id)
+
+ relevance_map = _get_relevance_map(news_ids)
+
+ articles = []
+ for hit in hits:
+ article = _parse_hit(hit)
+ article.relevant = relevance_map.get(article.id)
+ articles.append(article)
+
+ return NewsPage(
+ total=total,
+ page=page,
+ page_size=page_size,
+ results=articles,
+ )
+
+
+def _get_relevance_map(news_ids: list) -> dict:
+ if not news_ids:
+ return {}
+
+ try:
+ response = elasticsearch.search(
+ index="aktuell_postproc",
+ query={"terms": {"news_id.keyword": news_ids}},
+ source=["news_id", "relevant"],
+ size=len(news_ids),
+ cluster="inse",
+ )
+ except Exception:
+ logger.exception("Postproc-Relevanz-Lookup fehlgeschlagen.")
+ return {}
+
+ relevance_map = {}
+ for hit in response.get("hits", {}).get("hits", []):
+ postproc_source = hit.get("_source", {})
+ news_id = postproc_source.get("news_id")
+ if news_id is not None:
+ relevance_map[news_id] = bool(postproc_source.get("relevant", 0))
+
+ return relevance_map
+
+
+def _parse_hit(hit: dict) -> NewsArticle:
+ source = hit.get("_source", {})
+
+ fragments = hit.get("highlight", {}).get("full_content")
+ snippet = fragments[0] if fragments else None
+
+ return NewsArticle(
+ id=hit.get("_id"),
+ date=source.get("date"),
+ maintitle=source.get("maintitle"),
+ author=source.get("author"),
+ url=source.get("url"),
+ snippet=snippet,
+ )
diff --git a/service/src/main/inse/news/model.py b/service/src/main/inse/news/model.py
new file mode 100644
index 00000000..723e9b49
--- /dev/null
+++ b/service/src/main/inse/news/model.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from typing import List, Optional
+
+from pydantic import BaseModel
+
+
+class NewsArticle(BaseModel):
+ id: str
+ date: Optional[str] = None
+ maintitle: Optional[str] = None
+ author: Optional[str] = None
+ url: Optional[str] = None
+ relevant: Optional[bool] = None
+ snippet: Optional[str] = None
+
+
+class MentionedPerson(BaseModel):
+ name: str
+ is_ude: bool = False
+ person_id: Optional[str] = None
+
+
+class NewsArticleDetail(NewsArticle):
+ full_content: Optional[str] = None
+ relevant: Optional[bool] = None
+ authors: List[MentionedPerson] = []
+
+
+class NewsPage(BaseModel):
+ total: int
+ page: int
+ page_size: int
+ results: List[NewsArticle]
diff --git a/service/src/main/inse/news/service.py b/service/src/main/inse/news/service.py
new file mode 100644
index 00000000..5bb5dc03
--- /dev/null
+++ b/service/src/main/inse/news/service.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+REST API for the "aktuell" news index.
+"""
+
+from typing import Annotated
+
+from fastapi import APIRouter
+from fastapi import Path
+from fastapi import Query
+
+from inse.tags import Tags
+from . import logic
+from .model import NewsArticleDetail, NewsPage
+
+router = APIRouter(prefix="/api/news", tags=[Tags.NEWS])
+
+
+@router.get(
+ "",
+ operation_id="listNews",
+ response_model=NewsPage,
+ response_model_exclude_none=True,
+ summary="Returns a page of news articles, newest first.",
+ tags=[Tags.NEWS],
+)
+def list_news(
+ page: Annotated[
+ int, Query(description="Page number (1-based).", ge=1)
+ ] = 1,
+ page_size: Annotated[
+ int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100)
+ ] = 10,
+ sort_order: Annotated[
+ str, Query(alias="sortOrder", description="Sort order: 'desc' (newest first) or 'asc' (oldest first).", pattern="^(asc|desc)$")
+ ] = "desc",
+):
+ return logic.get_news_page(page, page_size, sort_order)
+
+
+@router.get(
+ "/search",
+ operation_id="searchNews",
+ response_model=NewsPage,
+ response_model_exclude_none=True,
+ summary="Searches news articles by full text (full_content).",
+ tags=[Tags.NEWS],
+)
+def search_news(
+ query: Annotated[
+ str, Query(description="Search term, matched against the full text (full_content).", min_length=1)
+ ],
+ page: Annotated[
+ int, Query(description="Page number (1-based).", ge=1)
+ ] = 1,
+ page_size: Annotated[
+ int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100)
+ ] = 10,
+):
+ return logic.search_news(query, page, page_size)
+
+
+@router.get(
+ "/by-author",
+ operation_id="getNewsByAuthor",
+ response_model=NewsPage,
+ response_model_exclude_none=True,
+ summary="Returns news articles in which the given person is mentioned.",
+ tags=[Tags.NEWS],
+)
+def get_news_by_author(
+ author_id: Annotated[
+ str, Query(alias="authorId", description="OpenAlex author id, e.g. A5034365278.")
+ ],
+ page: Annotated[
+ int, Query(description="Page number (1-based).", ge=1)
+ ] = 1,
+ page_size: Annotated[
+ int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100)
+ ] = 10,
+ sort_order: Annotated[
+ str, Query(alias="sortOrder", description="Sort order: 'desc' (newest first) or 'asc' (oldest first).", pattern="^(asc|desc)$")
+ ] = "desc",
+ query: Annotated[
+ str | None, Query(description="Optional search term, matched against title/author.")
+ ] = None,
+):
+ return logic.get_news_by_author(author_id, page, page_size, sort_order, query)
+
+
+@router.get(
+ "/{news_id}",
+ operation_id="getNewsById",
+ response_model=NewsArticleDetail,
+ response_model_exclude_none=True,
+ summary="Returns a single news article including its full content.",
+ tags=[Tags.NEWS],
+)
+def get_news_by_id(
+ news_id: Annotated[
+ str, Path(description="The unique id of the news article (Elasticsearch _id).")
+ ],
+):
+ return logic.get_news_by_id(news_id)
diff --git a/service/src/main/inse/persons/logic.py b/service/src/main/inse/persons/logic.py
index 76db43c7..458ecc23 100644
--- a/service/src/main/inse/persons/logic.py
+++ b/service/src/main/inse/persons/logic.py
@@ -30,6 +30,60 @@ from inse.persons.model import (
)
logger = logging.getLogger(__name__)
INDEX_NAME = "openalex-authors"
+UDE_INSTITUTION_ID = "https://openalex.org/I62318514" # Universität Duisburg-Essen
+
+def find_ude_author_by_name(display_name: str) -> Optional[dict]:
+ query = {
+ "_source": ["display_name"],
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match_phrase": {
+ "display_name": display_name
+ }
+ },
+ {
+ "nested": {
+ "path": "affiliations",
+ "query": {
+ "term": {
+ "affiliations.institution.id": UDE_INSTITUTION_ID
+ }
+ },
+ }
+ },
+ ]
+ }
+ },
+ "size": 10,
+ }
+
+ try:
+ data = elasticsearch.search(index=INDEX_NAME, body=query)
+ except Exception:
+ logger.exception(f"UDE-Lookup für '{display_name}' fehlgeschlagen.")
+ return None
+
+ hits = data.get("hits", {}).get("hits", [])
+
+ display_name = display_name.strip().lower()
+ exact_matches = []
+
+ for hit in hits:
+ hit_display_name = hit.get("_source", {}).get("display_name", "")
+ if hit_display_name.strip().lower() == display_name:
+ exact_matches.append(hit)
+
+ if not exact_matches:
+ return None
+
+ hit = exact_matches[0]
+
+ return {
+ "id": hit.get("_id"),
+ "display_name": hit.get("_source", {}).get("display_name"),
+ }
def get_author_name_by_id(author_id: str) -> Optional[str]:
diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py
index 600bcfb0..bd0b79c0 100644
--- a/service/src/main/inse/tags.py
+++ b/service/src/main/inse/tags.py
@@ -7,4 +7,5 @@ class Tags(Enum):
INSTITUTIONS = "Institutions"
TOPICS = "Topics"
WORKS = "Works"
+ NEWS = "News"
PROJECTS = "Projects"
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 7344de8e..eb0b53f3 100644
--- a/webapp/src/app/api/api/api.ts
+++ b/webapp/src/app/api/api/api.ts
@@ -20,4 +20,16 @@ export * from './topics.service';
import { TopicsService } from './topics.service';
export * from './works.service';
import { WorksService } from './works.service';
-export const APIS = [CompanyConnectionsService, FundingService, INSEAccountServiceService, INSEServiceService, InstitutionsService, ItemsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, WorksService];
+export const APIS = [
+ CompanyConnectionsService,
+ FundingService,
+ INSEAccountServiceService,
+ INSEServiceService,
+ InstitutionsService,
+ ItemsService,
+ PersonNetworkService,
+ PersonsService,
+ ProjectsService,
+ TopicsService,
+ WorksService,
+];
diff --git a/webapp/src/app/api/api/companyConnections.service.ts b/webapp/src/app/api/api/companyConnections.service.ts
index cbc5f803..6ad850ea 100644
--- a/webapp/src/app/api/api/companyConnections.service.ts
+++ b/webapp/src/app/api/api/companyConnections.service.ts
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
- *
+ *
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,12 +9,18 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
-import { Inject, Injectable, Optional } from '@angular/core';
-import { HttpClient, HttpHeaders, HttpParams,
- HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
+import { Inject, Injectable, Optional } from '@angular/core';
+import {
+ HttpClient,
+ HttpHeaders,
+ HttpParams,
+ HttpResponse,
+ HttpEvent,
+ HttpParameterCodec,
+ HttpContext,
+} from '@angular/common/http';
+import { CustomHttpParameterCodec } from '../encoder';
+import { Observable } from 'rxjs';
// @ts-ignore
import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse';
@@ -22,74 +28,121 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
+import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
+import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
-
-
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class CompanyConnectionsService extends BaseService {
+ constructor(
+ protected httpClient: HttpClient,
+ @Optional() @Inject(BASE_PATH) basePath: string | string[],
+ @Optional() configuration?: Configuration,
+ ) {
+ super(basePath, configuration);
+ }
- constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
- super(basePath, configuration);
+ /**
+ * Get possible company connections by OpenAlex author ID.
+ * @endpoint get /api/inse-service/authors/{author_id}/company-connections
+ * @param authorId
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getCompanyConnectionsByAuthor(
+ authorId: string,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public getCompanyConnectionsByAuthor(
+ authorId: string,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getCompanyConnectionsByAuthor(
+ authorId: string,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getCompanyConnectionsByAuthor(
+ authorId: string,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (authorId === null || authorId === undefined) {
+ throw new Error(
+ 'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.',
+ );
}
- /**
- * Get possible company connections by OpenAlex author ID.
- * @endpoint get /api/inse-service/authors/{author_id}/company-connections
- * @param authorId
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public getCompanyConnectionsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public getCompanyConnectionsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getCompanyConnectionsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getCompanyConnectionsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (authorId === null || authorId === undefined) {
- throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.');
- }
+ let localVarHeaders = this.defaultHeaders;
- let localVarHeaders = this.defaultHeaders;
-
- const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
- 'application/json'
- ]);
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
- const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
-
- const localVarTransferCache: boolean = options?.transferCache ?? true;
-
-
- let responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('get', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- responseType: responseType_,
- ...(withCredentials ? { withCredentials } : {}),
- headers: localVarHeaders,
- observe: observe,
- ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
- reportProgress: reportProgress
- }
- );
+ const localVarHttpHeaderAcceptSelected: string | undefined =
+ options?.httpHeaderAccept ??
+ this.configuration.selectHeaderAccept(['application/json']);
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
+ localVarHeaders = localVarHeaders.set(
+ 'Accept',
+ localVarHttpHeaderAcceptSelected,
+ );
}
+ const localVarHttpContext: HttpContext =
+ options?.context ?? new HttpContext();
+
+ const localVarTransferCache: boolean = options?.transferCache ?? true;
+
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
+ }
+
+ let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request(
+ 'get',
+ `${basePath}${localVarPath}`,
+ {
+ context: localVarHttpContext,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ },
+ );
+ }
}
diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts
index 46772768..f1f0a1a7 100644
--- a/webapp/src/app/api/api/funding.service.ts
+++ b/webapp/src/app/api/api/funding.service.ts
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
- *
+ *
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,12 +9,18 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
-import { Inject, Injectable, Optional } from '@angular/core';
-import { HttpClient, HttpHeaders, HttpParams,
- HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
+import { Inject, Injectable, Optional } from '@angular/core';
+import {
+ HttpClient,
+ HttpHeaders,
+ HttpParams,
+ HttpResponse,
+ HttpEvent,
+ HttpParameterCodec,
+ HttpContext,
+} from '@angular/common/http';
+import { CustomHttpParameterCodec } from '../encoder';
+import { Observable } from 'rxjs';
// @ts-ignore
import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse';
@@ -24,138 +30,246 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse';
// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
+import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
+import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
-
-
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class FundingService extends BaseService {
+ constructor(
+ protected httpClient: HttpClient,
+ @Optional() @Inject(BASE_PATH) basePath: string | string[],
+ @Optional() configuration?: Configuration,
+ ) {
+ super(basePath, configuration);
+ }
- constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
- super(basePath, configuration);
+ /**
+ * Get funding organizations by author.
+ * @endpoint get /api/inse-service/authors/{author_id}/funders
+ * @param authorId
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getFundersByAuthor(
+ authorId: string,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public getFundersByAuthor(
+ authorId: string,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getFundersByAuthor(
+ authorId: string,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getFundersByAuthor(
+ authorId: string,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (authorId === null || authorId === undefined) {
+ throw new Error(
+ 'Required parameter authorId was null or undefined when calling getFundersByAuthor.',
+ );
}
- /**
- * Get funding organizations by author.
- * @endpoint get /api/inse-service/authors/{author_id}/funders
- * @param authorId
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (authorId === null || authorId === undefined) {
- throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.');
- }
+ let localVarHeaders = this.defaultHeaders;
- let localVarHeaders = this.defaultHeaders;
-
- const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
- 'application/json'
- ]);
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
- const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
-
- const localVarTransferCache: boolean = options?.transferCache ?? true;
-
-
- let responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('get', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- responseType: responseType_,
- ...(withCredentials ? { withCredentials } : {}),
- headers: localVarHeaders,
- observe: observe,
- ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
- reportProgress: reportProgress
- }
- );
+ const localVarHttpHeaderAcceptSelected: string | undefined =
+ options?.httpHeaderAccept ??
+ this.configuration.selectHeaderAccept(['application/json']);
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
+ localVarHeaders = localVarHeaders.set(
+ 'Accept',
+ localVarHttpHeaderAcceptSelected,
+ );
}
- /**
- * Get funded publications by author.
- * @endpoint get /api/inse-service/authors/{author_id}/publications
- * @param authorId
- * @param page
- * @param pageSize
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (authorId === null || authorId === undefined) {
- throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.');
- }
+ const localVarHttpContext: HttpContext =
+ options?.context ?? new HttpContext();
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- page, 'page');
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- pageSize, 'page_size');
+ const localVarTransferCache: boolean = options?.transferCache ?? true;
- let localVarHeaders = this.defaultHeaders;
-
- const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
- 'application/json'
- ]);
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
- const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
-
- const localVarTransferCache: boolean = options?.transferCache ?? true;
-
-
- let responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('get', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- params: localVarQueryParameters,
- responseType: responseType_,
- ...(withCredentials ? { withCredentials } : {}),
- headers: localVarHeaders,
- observe: observe,
- ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
- reportProgress: reportProgress
- }
- );
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
}
+ let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request(
+ 'get',
+ `${basePath}${localVarPath}`,
+ {
+ context: localVarHttpContext,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ },
+ );
+ }
+
+ /**
+ * Get funded publications by author.
+ * @endpoint get /api/inse-service/authors/{author_id}/publications
+ * @param authorId
+ * @param page
+ * @param pageSize
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getPublicationsByAuthor(
+ authorId: string,
+ page?: number,
+ pageSize?: number,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public getPublicationsByAuthor(
+ authorId: string,
+ page?: number,
+ pageSize?: number,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getPublicationsByAuthor(
+ authorId: string,
+ page?: number,
+ pageSize?: number,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getPublicationsByAuthor(
+ authorId: string,
+ page?: number,
+ pageSize?: number,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (authorId === null || authorId === undefined) {
+ throw new Error(
+ 'Required parameter authorId was null or undefined when calling getPublicationsByAuthor.',
+ );
+ }
+
+ let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
+ localVarQueryParameters = this.addToHttpParams(
+ localVarQueryParameters,
+ page,
+ 'page',
+ );
+ localVarQueryParameters = this.addToHttpParams(
+ localVarQueryParameters,
+ pageSize,
+ 'page_size',
+ );
+
+ let localVarHeaders = this.defaultHeaders;
+
+ const localVarHttpHeaderAcceptSelected: string | undefined =
+ options?.httpHeaderAccept ??
+ this.configuration.selectHeaderAccept(['application/json']);
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
+ localVarHeaders = localVarHeaders.set(
+ 'Accept',
+ localVarHttpHeaderAcceptSelected,
+ );
+ }
+
+ const localVarHttpContext: HttpContext =
+ options?.context ?? new HttpContext();
+
+ const localVarTransferCache: boolean = options?.transferCache ?? true;
+
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
+ }
+
+ let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request(
+ 'get',
+ `${basePath}${localVarPath}`,
+ {
+ context: localVarHttpContext,
+ params: localVarQueryParameters,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ },
+ );
+ }
}
diff --git a/webapp/src/app/api/api/iNSEAccountService.service.ts b/webapp/src/app/api/api/iNSEAccountService.service.ts
index 90181dbd..4874a0a8 100644
--- a/webapp/src/app/api/api/iNSEAccountService.service.ts
+++ b/webapp/src/app/api/api/iNSEAccountService.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 { AccessGrant } from '../model/accessGrant';
@@ -28,255 +34,424 @@ import { IdentityGrant } from '../model/identityGrant';
import { User } from '../model/user';
// @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 INSEAccountServiceService 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 User
+ * @endpoint post /inse-account/create
+ * @param bodyCreateUser
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public createUser(
+ bodyCreateUser: BodyCreateUser,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public createUser(
+ bodyCreateUser: BodyCreateUser,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public createUser(
+ bodyCreateUser: BodyCreateUser,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public createUser(
+ bodyCreateUser: BodyCreateUser,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (bodyCreateUser === null || bodyCreateUser === undefined) {
+ throw new Error(
+ 'Required parameter bodyCreateUser was null or undefined when calling createUser.',
+ );
}
- /**
- * Create User
- * @endpoint post /inse-account/create
- * @param bodyCreateUser
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public createUser(bodyCreateUser: BodyCreateUser, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public createUser(bodyCreateUser: BodyCreateUser, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public createUser(bodyCreateUser: BodyCreateUser, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public createUser(bodyCreateUser: BodyCreateUser, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (bodyCreateUser === null || bodyCreateUser === undefined) {
- throw new Error('Required parameter bodyCreateUser was null or undefined when calling createUser.');
- }
+ 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 = `/inse-account/create`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('post', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- body: bodyCreateUser,
- 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 Access Grant
- * @endpoint post /inse-account/auth/access
- * @param secret
- * @param account
- * @param organization
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public getAccessGrant(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public getAccessGrant(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getAccessGrant(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getAccessGrant(secret: string, account: number, organization: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (secret === null || secret === undefined) {
- throw new Error('Required parameter secret was null or undefined when calling getAccessGrant.');
- }
- if (account === null || account === undefined) {
- throw new Error('Required parameter account was null or undefined when calling getAccessGrant.');
- }
- if (organization === null || organization === undefined) {
- throw new Error('Required parameter organization was null or undefined when calling getAccessGrant.');
- }
+ 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/x-www-form-urlencoded'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (secret !== undefined) {
- localVarFormParams = localVarFormParams.append('secret', secret) as any || localVarFormParams;
- }
- if (account !== undefined) {
- localVarFormParams = localVarFormParams.append('account', account) as any || localVarFormParams;
- }
- if (organization !== undefined) {
- localVarFormParams = localVarFormParams.append('organization', organization) as any || localVarFormParams;
- }
-
- let responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- let localVarPath = `/inse-account/auth/access`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('post', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- 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 Identity Grant
- * @endpoint post /inse-account/auth/id
- * @param username
- * @param password
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public getIdentityGrant(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable;
- public getIdentityGrant(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getIdentityGrant(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public getIdentityGrant(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling getIdentityGrant.');
- }
- if (password === null || password === undefined) {
- throw new Error('Required parameter password was null or undefined when calling getIdentityGrant.');
- }
-
- 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/x-www-form-urlencoded'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (username !== undefined) {
- localVarFormParams = localVarFormParams.append('username', username) as any || localVarFormParams;
- }
- if (password !== undefined) {
- localVarFormParams = localVarFormParams.append('password', password) as any || localVarFormParams;
- }
-
- let responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- let localVarPath = `/inse-account/auth/id`;
- const { basePath, withCredentials } = this.configuration;
- return this.httpClient.request('post', `${basePath}${localVarPath}`,
- {
- context: localVarHttpContext,
- body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- 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 = `/inse-account/create`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request('post', `${basePath}${localVarPath}`, {
+ context: localVarHttpContext,
+ body: bodyCreateUser,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ });
+ }
+
+ /**
+ * Get Access Grant
+ * @endpoint post /inse-account/auth/access
+ * @param secret
+ * @param account
+ * @param organization
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getAccessGrant(
+ secret: string,
+ account: number,
+ organization: number,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public getAccessGrant(
+ secret: string,
+ account: number,
+ organization: number,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getAccessGrant(
+ secret: string,
+ account: number,
+ organization: number,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getAccessGrant(
+ secret: string,
+ account: number,
+ organization: number,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (secret === null || secret === undefined) {
+ throw new Error(
+ 'Required parameter secret was null or undefined when calling getAccessGrant.',
+ );
+ }
+ if (account === null || account === undefined) {
+ throw new Error(
+ 'Required parameter account was null or undefined when calling getAccessGrant.',
+ );
+ }
+ if (organization === null || organization === undefined) {
+ throw new Error(
+ 'Required parameter organization was null or undefined when calling getAccessGrant.',
+ );
+ }
+
+ 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/x-www-form-urlencoded'];
+
+ const canConsumeForm = this.canConsumeForm(consumes);
+
+ let localVarFormParams: { append(param: string, value: any): any };
+ let localVarUseForm = false;
+ let localVarConvertFormParamsToString = false;
+ if (localVarUseForm) {
+ localVarFormParams = new FormData();
+ } else {
+ localVarFormParams = new HttpParams({ encoder: this.encoder });
+ }
+
+ if (secret !== undefined) {
+ localVarFormParams =
+ (localVarFormParams.append('secret', secret) as any) ||
+ localVarFormParams;
+ }
+ if (account !== undefined) {
+ localVarFormParams =
+ (localVarFormParams.append('account', account) as any) ||
+ localVarFormParams;
+ }
+ if (organization !== undefined) {
+ localVarFormParams =
+ (localVarFormParams.append('organization', organization) as any) ||
+ localVarFormParams;
+ }
+
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
+ }
+
+ let localVarPath = `/inse-account/auth/access`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request(
+ 'post',
+ `${basePath}${localVarPath}`,
+ {
+ context: localVarHttpContext,
+ body: localVarConvertFormParamsToString
+ ? localVarFormParams.toString()
+ : localVarFormParams,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ },
+ );
+ }
+
+ /**
+ * Get Identity Grant
+ * @endpoint post /inse-account/auth/id
+ * @param username
+ * @param password
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public getIdentityGrant(
+ username: string,
+ password: string,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable;
+ public getIdentityGrant(
+ username: string,
+ password: string,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getIdentityGrant(
+ username: string,
+ password: string,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public getIdentityGrant(
+ username: string,
+ password: string,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (username === null || username === undefined) {
+ throw new Error(
+ 'Required parameter username was null or undefined when calling getIdentityGrant.',
+ );
+ }
+ if (password === null || password === undefined) {
+ throw new Error(
+ 'Required parameter password was null or undefined when calling getIdentityGrant.',
+ );
+ }
+
+ 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/x-www-form-urlencoded'];
+
+ const canConsumeForm = this.canConsumeForm(consumes);
+
+ let localVarFormParams: { append(param: string, value: any): any };
+ let localVarUseForm = false;
+ let localVarConvertFormParamsToString = false;
+ if (localVarUseForm) {
+ localVarFormParams = new FormData();
+ } else {
+ localVarFormParams = new HttpParams({ encoder: this.encoder });
+ }
+
+ if (username !== undefined) {
+ localVarFormParams =
+ (localVarFormParams.append('username', username) as any) ||
+ localVarFormParams;
+ }
+ if (password !== undefined) {
+ localVarFormParams =
+ (localVarFormParams.append('password', password) as any) ||
+ localVarFormParams;
+ }
+
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
+ }
+
+ let localVarPath = `/inse-account/auth/id`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request(
+ 'post',
+ `${basePath}${localVarPath}`,
+ {
+ context: localVarHttpContext,
+ body: localVarConvertFormParamsToString
+ ? localVarFormParams.toString()
+ : localVarFormParams,
+ 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 cf95d68e..8788adee 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,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';
@@ -26,513 +32,922 @@ import { ItemCreate } from '../model/itemCreate';
import { ItemPage } from '../model/itemPage';
// @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);
+ /**
+ * Adds a new item.
+ * @endpoint post /api/inse-service/items
+ * @param itemCreate
+ * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
+ * @param reportProgress flag to report request and response progress.
+ */
+ public addItem(
+ itemCreate: ItemCreate,
+ observe?: 'body',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable- ;
+ public addItem(
+ itemCreate: ItemCreate,
+ observe?: 'response',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public addItem(
+ itemCreate: ItemCreate,
+ observe?: 'events',
+ reportProgress?: boolean,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable>;
+ public addItem(
+ itemCreate: ItemCreate,
+ observe: any = 'body',
+ reportProgress: boolean = false,
+ options?: {
+ httpHeaderAccept?: 'application/json';
+ context?: HttpContext;
+ transferCache?: boolean;
+ },
+ ): Observable {
+ if (itemCreate === null || itemCreate === undefined) {
+ throw new Error(
+ 'Required parameter itemCreate was null or undefined when calling addItem.',
+ );
}
- /**
- * Adds a new item.
- * @endpoint post /api/inse-service/items
- * @param itemCreate
- * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
- * @param reportProgress flag to report request and response progress.
- */
- public addItem(itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable
- ;
- public addItem(itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public addItem(itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>;
- public addItem(itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable {
- if (itemCreate === null || itemCreate === undefined) {
- throw new Error('Required parameter itemCreate was null or undefined when calling addItem.');
- }
+ let localVarHeaders = this.defaultHeaders;
- let localVarHeaders = this.defaultHeaders;
+ // authentication (bearer) required
+ localVarHeaders = this.configuration.addCredentialToHeaders(
+ 'bearer',
+ 'Authorization',
+ localVarHeaders,
+ 'Bearer ',
+ );
- // authentication (bearer) required
- localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer ');
+ const localVarHttpHeaderAcceptSelected: string | undefined =
+ options?.httpHeaderAccept ??
+ this.configuration.selectHeaderAccept(['application/json']);
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
+ localVarHeaders = localVarHeaders.set(
+ 'Accept',
+ localVarHttpHeaderAcceptSelected,
+ );
+ }
- const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
- 'application/json'
- ]);
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
+ const localVarHttpContext: HttpContext =
+ options?.context ?? new HttpContext();
- const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
+ const localVarTransferCache: boolean = options?.transferCache ?? true;
- const localVarTransferCache: boolean = options?.transferCache ?? true;
+ // to determine the Content-Type header
+ const consumes: string[] = ['application/json'];
+ const httpContentTypeSelected: string | undefined =
+ this.configuration.selectHeaderContentType(consumes);
+ if (httpContentTypeSelected !== undefined) {
+ localVarHeaders = localVarHeaders.set(
+ 'Content-Type',
+ httpContentTypeSelected,
+ );
+ }
+ let responseType_: 'text' | 'json' | 'blob' = 'json';
+ if (localVarHttpHeaderAcceptSelected) {
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
+ responseType_ = 'text';
+ } else if (
+ this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
+ ) {
+ responseType_ = 'json';
+ } else {
+ responseType_ = 'blob';
+ }
+ }
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/json'
- ];
- const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
- if (httpContentTypeSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
- }
+ let localVarPath = `/api/inse-service/items`;
+ const { basePath, withCredentials } = this.configuration;
+ return this.httpClient.request
- ('post', `${basePath}${localVarPath}`, {
+ context: localVarHttpContext,
+ body: itemCreate,
+ responseType: responseType_,
+ ...(withCredentials ? { withCredentials } : {}),
+ headers: localVarHeaders,
+ observe: observe,
+ ...(localVarTransferCache !== undefined
+ ? { transferCache: localVarTransferCache }
+ : {}),
+ reportProgress: reportProgress,
+ });
+ }
- let 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