diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index a284a919..467410b7 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -90,6 +90,32 @@ async def get_all_author_works( ) +async def get_primary_topic_counts( + author_id: str, + client: OpenAlexWorksSearchClient | None = None, +) -> List[TopicCount]: + works = await get_all_author_works(author_id, client=client) + + counts = {} + + for work in works.results or []: + primary_topic = work.primary_topic + if not primary_topic or not primary_topic.display_name: + continue + + name = primary_topic.display_name + if name not in counts: + counts[name] = {"id": primary_topic.id, "name": name, "count": 0} + counts[name]["count"] += 1 + + items = sorted(counts.values(), key=lambda item: item["count"], reverse=True) + + return [ + TopicCount(id=item["id"], name=item["name"], count=item["count"]) + for item in items + ] + + async def get_topics_by_time_by_author( author_id: str, max_topics_per_year: int = 3, diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index 476f2b9a..127b69a5 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -17,6 +17,7 @@ from .. import security from . import logic from inse.models.work_page import WorkPage from inse.models.works_list_response import WorksListResponse +from inse.models.topic_count import TopicCount from inse.models.topics_by_time import TopicsByTime @@ -71,6 +72,17 @@ async def get_all_author_works( return await logic.get_all_author_works(author_id) +@router.get("/{author_id}/primary-topic-counts", + operation_id="getPrimaryTopicCountsByAuthor", + response_model=list[TopicCount], + summary="Returns work counts per primary topic for an author.") +async def get_primary_topic_counts( + author_id: Annotated[str, Path(description="The author id, for example A5023888391.")], + principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), +): + return await logic.get_primary_topic_counts(author_id) + + @router.get("/{author_id}/topics-by-time", operation_id="getTopicsByTimeByAuthor", response_model=TopicsByTime, diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 87266ecf..68623388 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -1,9 +1,10 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts api/api.ts +api/funding.service.ts +api/funding.serviceInterface.ts api/inse-account-service.service.ts api/inse-account-service.serviceInterface.ts api/inse-service.service.ts @@ -31,6 +32,7 @@ model/author-affiliations-inner.ts model/author-counts-by-year-inner.ts model/author-ids.ts model/author-parsed-longest-name.ts +model/author-position-count.ts model/author-summary-stats.ts model/author.ts model/authors-list-response.ts @@ -49,6 +51,8 @@ model/dehydrated-institution.ts model/dehydrated-source.ts model/filter-information.ts model/filter-properties.ts +model/funder-by-author.ts +model/funders-by-author-response.ts model/fwci.ts model/group-by-result.ts model/http-validation-error.ts @@ -63,14 +67,14 @@ model/model2-yr-mean-citedness.ts model/models.ts model/open-access.ts model/person-bio.ts +model/publication-ids-by-author-position.ts +model/publications-by-author-response.ts model/score.ts +model/topic-count.ts +model/topics-by-time.ts +model/topics-by-year.ts model/validation-error-loc-inner.ts model/validation-error.ts -model/topicCount.ts -model/topicsByTime.ts -model/topicsByYear.ts -model/validationError.ts -model/validationErrorLocInner.ts model/value.ts model/work-biblio.ts model/work-citation-normalized-percentile.ts diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index 18f669bf..7a97fdae 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,3 +1,6 @@ +export * from './funding.service'; +import { FundingService } from './funding.service'; +export * from './funding.serviceInterface'; export * from './inse-account-service.service'; import { INSEAccountServiceService } from './inse-account-service.service'; export * from './inse-account-service.serviceInterface'; @@ -22,4 +25,4 @@ export * from './topics.serviceInterface'; export * from './works.service'; import { WorksService } from './works.service'; export * from './works.serviceInterface'; -export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService]; +export const APIS = [FundingService, INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService]; diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts new file mode 100644 index 00000000..17619786 --- /dev/null +++ b/webapp/src/app/api/api/funding.service.ts @@ -0,0 +1,164 @@ +/** + * Innovation Search Engine 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 { FundersByAuthorResponse } from '../model/funders-by-author-response'; +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { PublicationsByAuthorResponse } from '../model/publications-by-author-response'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; +import { + FundingServiceInterface +} from './funding.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class FundingService extends BaseService implements FundingServiceInterface { + + 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.'); + } + + 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 + } + ); + } + + /** + * 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/funding.serviceInterface.ts b/webapp/src/app/api/api/funding.serviceInterface.ts new file mode 100644 index 00000000..86b8b171 --- /dev/null +++ b/webapp/src/app/api/api/funding.serviceInterface.ts @@ -0,0 +1,45 @@ +/** + * Innovation Search Engine 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 } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { FundersByAuthorResponse } from '../model/models'; +import { HTTPValidationError } from '../model/models'; +import { PublicationsByAuthorResponse } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface FundingServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Get funding organizations by author. + * + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + */ + getFundersByAuthor(authorId: string, extraHttpRequestParams?: any): Observable; + + /** + * Get funded publications by author. + * + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + */ + getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/inse-service.service.ts b/webapp/src/app/api/api/inse-service.service.ts index 80543705..b2058459 100644 --- a/webapp/src/app/api/api/inse-service.service.ts +++ b/webapp/src/app/api/api/inse-service.service.ts @@ -19,6 +19,8 @@ import { Observable } from 'rxjs'; // @ts-ignore import { AuthorsListResponse } from '../model/authors-list-response'; // @ts-ignore +import { FundersByAuthorResponse } from '../model/funders-by-author-response'; +// @ts-ignore import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore import { Item } from '../model/item'; @@ -28,6 +30,8 @@ import { ItemCreate } from '../model/item-create'; import { ItemPage } from '../model/item-page'; // @ts-ignore import { PersonBio } from '../model/person-bio'; +// @ts-ignore +import { PublicationsByAuthorResponse } from '../model/publications-by-author-response'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -361,6 +365,61 @@ export class INSEServiceService extends BaseService implements INSEServiceServic ); } + /** + * 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; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.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 + } + ); + } + /** * Returns the item with the id. * @endpoint get /api/inse-service/items/{id} @@ -546,6 +605,70 @@ export class INSEServiceService extends BaseService implements INSEServiceServic ); } + /** + * 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 + } + ); + } + /** * Searches for persons by ID or name. * @endpoint get /api/inse-service/persons/search diff --git a/webapp/src/app/api/api/inse-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts index 1326e650..e7f18df1 100644 --- a/webapp/src/app/api/api/inse-service.serviceInterface.ts +++ b/webapp/src/app/api/api/inse-service.serviceInterface.ts @@ -12,11 +12,13 @@ import { HttpHeaders } from '@angular/comm import { Observable } from 'rxjs'; import { AuthorsListResponse } from '../model/models'; +import { FundersByAuthorResponse } from '../model/models'; import { HTTPValidationError } from '../model/models'; import { Item } from '../model/models'; import { ItemCreate } from '../model/models'; import { ItemPage } from '../model/models'; import { PersonBio } from '../model/models'; +import { PublicationsByAuthorResponse } from '../model/models'; import { Configuration } from '../configuration'; @@ -69,6 +71,14 @@ export interface INSEServiceServiceInterface { */ generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable; + /** + * Get funding organizations by author. + * + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + */ + getFundersByAuthor(authorId: string, extraHttpRequestParams?: any): Observable; + /** * Returns the item with the id. * @@ -95,6 +105,16 @@ export interface INSEServiceServiceInterface { */ getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable; + /** + * Get funded publications by author. + * + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + */ + getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; + /** * Searches for persons by ID or name. * diff --git a/webapp/src/app/api/api/persons-search.service.ts b/webapp/src/app/api/api/persons-search.service.ts index 27a75280..a92a1b26 100644 --- a/webapp/src/app/api/api/persons-search.service.ts +++ b/webapp/src/app/api/api/persons-search.service.ts @@ -49,6 +49,7 @@ export class PersonsSearchService extends BaseService implements PersonsSearchSe * @param page Page number (1-indexed) * @param pageSize Results per page * @param include Comma-separated include tags + * @param strict Strict institution search by target year * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ diff --git a/webapp/src/app/api/api/persons-search.serviceInterface.ts b/webapp/src/app/api/api/persons-search.serviceInterface.ts index 57bd6eee..8221785d 100644 --- a/webapp/src/app/api/api/persons-search.serviceInterface.ts +++ b/webapp/src/app/api/api/persons-search.serviceInterface.ts @@ -33,7 +33,7 @@ export interface PersonsSearchServiceInterface { * @param page Page number (1-indexed) * @param pageSize Results per page * @param include Comma-separated include tags - * @param strict Strict search parameter + * @param strict Strict institution search by target year */ searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, extraHttpRequestParams?: any): Observable; diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index 42f22d04..a2d22321 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 @@ -11,7 +11,7 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; @@ -375,13 +375,14 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa * @param page Page number (1-indexed) * @param pageSize Results per page * @param include Comma-separated include tags + * @param strict Strict institution search by target year * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: 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, @@ -400,6 +401,8 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa pageSize, 'pageSize'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + strict, 'strict'); let localVarHeaders = this.defaultHeaders; @@ -442,26 +445,4 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa ); } - 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; - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - let localVarPath = `/api/inse-service/authors/${encodeURIComponent(authorId)}/funders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: 'json', - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - reportProgress: reportProgress - } - ); - } - } diff --git a/webapp/src/app/api/api/persons.serviceInterface.ts b/webapp/src/app/api/api/persons.serviceInterface.ts index e7235d9c..7ee1d04a 100644 --- a/webapp/src/app/api/api/persons.serviceInterface.ts +++ b/webapp/src/app/api/api/persons.serviceInterface.ts @@ -81,7 +81,8 @@ export interface PersonsServiceInterface { * @param page Page number (1-indexed) * @param pageSize Results per page * @param include Comma-separated include tags + * @param strict Strict institution search by target year */ - searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, extraHttpRequestParams?: any): Observable; + searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, extraHttpRequestParams?: any): Observable; } diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 2a156323..7121b4a2 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -9,26 +9,27 @@ */ /* 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/http-validation-error'; // @ts-ignore -import { TopicsByTime } from '../model/topicsByTime'; +import { TopicCount } from '../model/topic-count'; // @ts-ignore -import { WorkPage } from '../model/workPage'; +import { TopicsByTime } from '../model/topics-by-time'; +// @ts-ignore +import { WorkPage } from '../model/work-page'; // @ts-ignore import { WorksListResponse } from '../model/works-list-response'; // @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'; import { WorksServiceInterface @@ -37,11 +38,11 @@ import { @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class WorksService extends BaseService implements WorksServiceInterface { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } @@ -52,10 +53,10 @@ export class WorksService extends BaseService implements WorksServiceInterface { * @param observe set whether or not to return 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 { + 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.'); } @@ -88,7 +89,7 @@ export class WorksService extends BaseService implements WorksServiceInterface { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/all`; + 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}`, { @@ -115,35 +116,35 @@ export class WorksService extends BaseService implements WorksServiceInterface { * @param observe set whether or not to return 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, 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, 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, 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, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, 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, 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, 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, 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 }); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); + page, 'page'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); + size, 'size'); if (publicationYear) { publicationYear.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); + element, 'publication_year'); }) } if (type) { type.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'type'); + element, 'type'); }) } if (language) { language.forEach((element) => { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); + element, 'language'); }) } @@ -175,7 +176,7 @@ export class WorksService extends BaseService implements WorksServiceInterface { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; + 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}`, { @@ -191,6 +192,64 @@ export class WorksService extends BaseService implements WorksServiceInterface { ); } + /** + * 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; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/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 @@ -199,17 +258,17 @@ export class WorksService extends BaseService implements WorksServiceInterface { * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: 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 getTopicsByTimeByAuthor.'); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - maxTopicsPerYear, 'max_topics_per_year'); + maxTopicsPerYear, 'max_topics_per_year'); let localVarHeaders = this.defaultHeaders; @@ -239,7 +298,7 @@ export class WorksService extends BaseService implements WorksServiceInterface { } } - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/topics-by-time`; + 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}`, { diff --git a/webapp/src/app/api/api/works.serviceInterface.ts b/webapp/src/app/api/api/works.serviceInterface.ts index 887bb9c3..ed81c297 100644 --- a/webapp/src/app/api/api/works.serviceInterface.ts +++ b/webapp/src/app/api/api/works.serviceInterface.ts @@ -12,6 +12,8 @@ import { HttpHeaders } from '@angular/comm import { Observable } from 'rxjs'; import { HTTPValidationError } from '../model/models'; +import { TopicCount } from '../model/models'; +import { TopicsByTime } from '../model/models'; import { WorkPage } from '../model/models'; import { WorksListResponse } from '../model/models'; @@ -45,4 +47,21 @@ export interface WorksServiceInterface { */ getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, extraHttpRequestParams?: any): Observable; + /** + * 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. + */ + getPrimaryTopicCountsByAuthor(authorId: string, extraHttpRequestParams?: any): Observable>; + + /** + * 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. + */ + getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, extraHttpRequestParams?: any): Observable; + } diff --git a/webapp/src/app/api/model/author-position-count.ts b/webapp/src/app/api/model/author-position-count.ts new file mode 100644 index 00000000..a02e3749 --- /dev/null +++ b/webapp/src/app/api/model/author-position-count.ts @@ -0,0 +1,18 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; +} + diff --git a/webapp/src/app/api/model/funder-by-author.ts b/webapp/src/app/api/model/funder-by-author.ts new file mode 100644 index 00000000..06fa85f0 --- /dev/null +++ b/webapp/src/app/api/model/funder-by-author.ts @@ -0,0 +1,22 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PublicationIdsByAuthorPosition } from './publication-ids-by-author-position'; +import { AuthorPositionCount } from './author-position-count'; + + +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; }; +} + diff --git a/webapp/src/app/api/model/funders-by-author-response.ts b/webapp/src/app/api/model/funders-by-author-response.ts new file mode 100644 index 00000000..6949ed4b --- /dev/null +++ b/webapp/src/app/api/model/funders-by-author-response.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. + */ +import { FunderByAuthor } from './funder-by-author'; + + +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; +} + diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 7010515c..c9938757 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -6,6 +6,7 @@ export * from './author-affiliations-inner'; export * from './author-counts-by-year-inner'; export * from './author-ids'; export * from './author-parsed-longest-name'; +export * from './author-position-count'; export * from './author-summary-stats'; export * from './authors-list-response'; export * from './authorship'; @@ -23,6 +24,8 @@ export * from './dehydrated-institution'; export * from './dehydrated-source'; export * from './filter-information'; export * from './filter-properties'; +export * from './funder-by-author'; +export * from './funders-by-author-response'; export * from './fwci'; export * from './group-by-result'; export * from './http-validation-error'; @@ -36,12 +39,14 @@ export * from './meta'; export * from './model2-yr-mean-citedness'; export * from './open-access'; export * from './person-bio'; +export * from './publication-ids-by-author-position'; +export * from './publications-by-author-response'; export * from './score'; +export * from './topic-count'; +export * from './topics-by-time'; +export * from './topics-by-year'; export * from './validation-error'; export * from './validation-error-loc-inner'; -export * from './topicCount'; -export * from './topicsByTime'; -export * from './topicsByYear'; export * from './value'; export * from './work'; export * from './work-biblio'; diff --git a/webapp/src/app/api/model/publication-ids-by-author-position.ts b/webapp/src/app/api/model/publication-ids-by-author-position.ts new file mode 100644 index 00000000..c35050ef --- /dev/null +++ b/webapp/src/app/api/model/publication-ids-by-author-position.ts @@ -0,0 +1,18 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PublicationIdsByAuthorPosition { + first?: Array; + middle?: Array; + last?: Array; + unknown?: Array; +} + diff --git a/webapp/src/app/api/model/publications-by-author-response.ts b/webapp/src/app/api/model/publications-by-author-response.ts new file mode 100644 index 00000000..5176fe39 --- /dev/null +++ b/webapp/src/app/api/model/publications-by-author-response.ts @@ -0,0 +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 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/topicCount.ts b/webapp/src/app/api/model/topic-count.ts similarity index 94% rename from webapp/src/app/api/model/topicCount.ts rename to webapp/src/app/api/model/topic-count.ts index d6c3c481..c4e4ef18 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topic-count.ts @@ -10,6 +10,7 @@ export interface TopicCount { + id?: string | null; /** * The topic display name. */ diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topics-by-time.ts similarity index 89% rename from webapp/src/app/api/model/topicsByTime.ts rename to webapp/src/app/api/model/topics-by-time.ts index 0dac04a7..d2ecf101 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topics-by-time.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicsByYear } from './topicsByYear'; +import { TopicsByYear } from './topics-by-year'; export interface TopicsByTime { diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topics-by-year.ts similarity index 92% rename from webapp/src/app/api/model/topicsByYear.ts rename to webapp/src/app/api/model/topics-by-year.ts index fded8da0..707cda16 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topics-by-year.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicCount } from './topicCount'; +import { TopicCount } from './topic-count'; export interface TopicsByYear { 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 9f7c464c..c33c2d57 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.ts +++ b/webapp/src/app/modules/person-funding/person-funding.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ActivatedRoute } from '@angular/router'; import { Router } from '@angular/router'; -import { PersonsService } from '../../api'; +import { FundingService } from '../../api'; @Component({ selector: 'app-person-funding', @@ -13,7 +13,7 @@ import { PersonsService } from '../../api'; export class PersonFundingComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private personsApi = inject(PersonsService); + private fundingApi = inject(FundingService); private initialSelectedFunderKey: string | null = null; private initialPublicationPage = 1; private initialFunderListPage = 1; @@ -43,7 +43,7 @@ export class PersonFundingComponent implements OnInit { } if (authorId) { - this.personsApi.getFundersByAuthor(authorId).subscribe({ + this.fundingApi.getFundersByAuthor(authorId).subscribe({ next: (result: any) => { this.funders = result.funders ?? []; this.applyFilter(); diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.html b/webapp/src/app/modules/person-interesting/person-interesting.component.html index 7f79895c..14767892 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.html +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.html @@ -1,9 +1,14 @@ - +