From b657508f1a8506b8d06605c52c3de7efa69e41cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20Paul=20Ton=C4=8Dik?= Date: Wed, 10 Jun 2026 21:24:26 +0200 Subject: [PATCH] Added institution based finding of bund and eu projects --- projects_eu_all_names.txt | 8 + service/src/main/inse/.env | 5 +- service/src/main/inse/config.py | 3 + .../institutions_search_client.py | 132 + service/src/main/inse/institutions/logic.py | 42 +- .../main/inse/institutions/search_client.py | 11 +- service/src/main/inse/institutions/service.py | 58 +- service/src/main/inse/main.py | 3 + service/src/main/inse/models/bund_project.py | 226 ++ service/src/main/inse/models/dfg_project.py | 94 + service/src/main/inse/models/eu_project.py | 192 ++ service/src/main/inse/projects/model.py | 31 + .../inse/projects/projects_search_client.py | 297 ++ service/src/main/inse/projects/router.py | 135 + service/src/main/inse/projects/service.py | 95 + service/src/main/inse/tags.py | 1 + ude_person.http | 255 +- webapp/openapi.json | 182 -- webapp/src/app/api/.openapi-generator/FILES | 171 +- webapp/src/app/api/README.md | 91 +- webapp/src/app/api/api.base.service.ts | 158 +- webapp/src/app/api/api.module.ts | 52 +- webapp/src/app/api/api/api.ts | 35 +- webapp/src/app/api/api/funding.service.ts | 378 +-- .../app/api/api/funding.serviceInterface.ts | 49 - .../app/api/api/iNSEAccountService.service.ts | 482 ++-- webapp/src/app/api/api/iNSEService.service.ts | 1357 +++------ .../api/api/inse-account-service.service.ts | 347 --- .../inse-account-service.serviceInterface.ts | 51 - .../src/app/api/api/inse-service.service.ts | 957 ------ .../api/api/inse-service.serviceInterface.ts | 108 - .../src/app/api/api/institutions.service.ts | 552 ++-- .../api/api/institutions.serviceInterface.ts | 67 - webapp/src/app/api/api/items.service.ts | 912 +++--- .../src/app/api/api/items.serviceInterface.ts | 77 - .../src/app/api/api/person-network.service.ts | 172 -- .../api/person-network.serviceInterface.ts | 36 - .../src/app/api/api/personNetwork.service.ts | 215 +- webapp/src/app/api/api/persons.service.ts | 2554 ++++++----------- .../app/api/api/persons.serviceInterface.ts | 226 -- webapp/src/app/api/api/projects.service.ts | 246 ++ webapp/src/app/api/api/topics.service.ts | 975 +++---- .../app/api/api/topics.serviceInterface.ts | 100 - webapp/src/app/api/api/works.service.ts | 1027 +++---- .../src/app/api/api/works.serviceInterface.ts | 98 - webapp/src/app/api/configuration.ts | 368 ++- webapp/src/app/api/encoder.ts | 24 +- webapp/src/app/api/model/access-grant.ts | 18 - webapp/src/app/api/model/accessGrant.ts | 16 +- webapp/src/app/api/model/auth-scope.ts | 17 - webapp/src/app/api/model/authAccount.ts | 12 +- webapp/src/app/api/model/authScope.ts | 14 +- .../api/model/author-affiliations-inner.ts | 18 - .../api/model/author-counts-by-year-inner.ts | 18 - webapp/src/app/api/model/author-ids.ts | 18 - .../src/app/api/model/author-network-node.ts | 26 - .../api/model/author-parsed-longest-name.ts | 20 - .../app/api/model/author-position-count.ts | 16 - .../src/app/api/model/author-summary-stats.ts | 19 - webapp/src/app/api/model/author.ts | 54 +- .../app/api/model/authorAffiliationsInner.ts | 10 +- .../app/api/model/authorCountsByYearInner.ts | 12 +- webapp/src/app/api/model/authorIds.ts | 12 +- webapp/src/app/api/model/authorNetworkNode.ts | 34 +- .../app/api/model/authorParsedLongestName.ts | 16 +- .../src/app/api/model/authorPositionCount.ts | 14 +- .../src/app/api/model/authorSummaryStats.ts | 12 +- .../api/model/authors-filter-properties.ts | 24 - .../app/api/model/authors-list-response.ts | 21 - .../app/api/model/authorsFilterProperties.ts | 30 +- .../src/app/api/model/authorsListResponse.ts | 12 +- webapp/src/app/api/model/authorship.ts | 24 +- .../api/model/autocomplete-response-meta.ts | 17 - .../autocomplete-response-results-inner.ts | 22 - .../app/api/model/autocomplete-response.ts | 19 - .../src/app/api/model/autocompleteResponse.ts | 10 +- .../app/api/model/autocompleteResponseMeta.ts | 10 +- .../model/autocompleteResponseResultsInner.ts | 20 +- webapp/src/app/api/model/award.ts | 18 +- webapp/src/app/api/model/bundProject.ts | 42 + webapp/src/app/api/model/bundProjectPage.ts | 31 + webapp/src/app/api/model/categoryNested.ts | 26 + .../api/model/collaboration-network-edge.ts | 20 - .../model/collaboration-network-node-type.ts | 17 - .../app/api/model/collaboration-network.ts | 41 - .../src/app/api/model/collaborationNetwork.ts | 54 +- .../app/api/model/collaborationNetworkEdge.ts | 22 +- .../api/model/collaborationNetworkNodeType.ts | 13 +- webapp/src/app/api/model/cost-usd.ts | 14 - webapp/src/app/api/model/costUsd.ts | 7 +- webapp/src/app/api/model/custom-author.ts | 37 - .../api/model/custom-authors-list-response.ts | 20 - webapp/src/app/api/model/customAuthor.ts | 42 +- .../api/model/customAuthorsListResponse.ts | 14 +- webapp/src/app/api/model/dehydrated-author.ts | 18 - webapp/src/app/api/model/dehydrated-funder.ts | 18 - .../app/api/model/dehydrated-institution.ts | 21 - webapp/src/app/api/model/dehydrated-source.ts | 26 - webapp/src/app/api/model/dehydratedAuthor.ts | 12 +- webapp/src/app/api/model/dehydratedFunder.ts | 12 +- .../app/api/model/dehydratedInstitution.ts | 18 +- webapp/src/app/api/model/dehydratedSource.ts | 28 +- ...ccount.ts => displayCodeSplittedNested.ts} | 10 +- webapp/src/app/api/model/euProject.ts | 51 + webapp/src/app/api/model/euProjectPage.ts | 31 + .../src/app/api/model/filter-information.ts | 30 - webapp/src/app/api/model/filter-properties.ts | 20 - webapp/src/app/api/model/filterInformation.ts | 38 +- webapp/src/app/api/model/filterProperties.ts | 18 +- webapp/src/app/api/model/funder-by-author.ts | 21 - webapp/src/app/api/model/funderByAuthor.ts | 22 +- .../api/model/funders-by-author-response.ts | 17 - .../app/api/model/fundersByAuthorResponse.ts | 14 +- webapp/src/app/api/model/fwci.ts | 7 +- webapp/src/app/api/model/group-by-result.ts | 18 - webapp/src/app/api/model/groupByResult.ts | 12 +- .../src/app/api/model/hTTPValidationError.ts | 8 +- .../app/api/model/http-validation-error.ts | 14 - webapp/src/app/api/model/identity-grant.ts | 17 - webapp/src/app/api/model/identityGrant.ts | 14 +- webapp/src/app/api/model/institution-geo.ts | 24 - webapp/src/app/api/model/institution-ids.ts | 21 - .../app/api/model/institution-information.ts | 20 - .../app/api/model/institution-network-node.ts | 26 - webapp/src/app/api/model/institution.ts | 54 +- webapp/src/app/api/model/institutionGeo.ts | 20 +- webapp/src/app/api/model/institutionIds.ts | 18 +- .../app/api/model/institutionInformation.ts | 22 +- .../app/api/model/institutionNetworkNode.ts | 34 +- .../api/model/institutions-list-response.ts | 21 - .../app/api/model/institutionsListResponse.ts | 12 +- webapp/src/app/api/model/item-create.ts | 20 - webapp/src/app/api/model/item-page.ts | 29 - webapp/src/app/api/model/item.ts | 30 +- webapp/src/app/api/model/itemCreate.ts | 22 +- webapp/src/app/api/model/itemPage.ts | 38 +- ...-yr-mean-citedness.ts => keywordNested.ts} | 8 +- webapp/src/app/api/model/latitude.ts | 7 +- webapp/src/app/api/model/location.ts | 26 +- webapp/src/app/api/model/longitude.ts | 7 +- webapp/src/app/api/model/meta.ts | 22 +- .../app/api/model/model2YrMeanCitedness.ts | 7 +- webapp/src/app/api/model/models.ts | 154 +- webapp/src/app/api/model/open-access.ts | 19 - webapp/src/app/api/model/openAccess.ts | 14 +- .../src/app/api/model/organizationNested.ts | 20 + webapp/src/app/api/model/personBio.ts | 14 +- .../{person-bio.ts => programmeNested.ts} | 13 +- .../publication-ids-by-author-position.ts | 16 - .../api/model/publicationDetailByFunder.ts | 45 + .../model/publicationIdsByAuthorPosition.ts | 14 +- .../model/publications-by-author-response.ts | 19 - .../api/model/publicationsByAuthorResponse.ts | 20 +- webapp/src/app/api/model/score.ts | 7 +- webapp/src/app/api/model/topic-count.ts | 22 - webapp/src/app/api/model/topic-domain.ts | 17 - webapp/src/app/api/model/topic-field.ts | 17 - webapp/src/app/api/model/topic-ids.ts | 17 - webapp/src/app/api/model/topic-subfield.ts | 17 - webapp/src/app/api/model/topic.ts | 40 +- webapp/src/app/api/model/topicCount.ts | 26 +- webapp/src/app/api/model/topicDomain.ts | 10 +- webapp/src/app/api/model/topicField.ts | 10 +- webapp/src/app/api/model/topicIds.ts | 10 +- webapp/src/app/api/model/topicSubfield.ts | 10 +- webapp/src/app/api/model/topics-by-time.ts | 33 - webapp/src/app/api/model/topics-by-year.ts | 29 - .../src/app/api/model/topics-list-response.ts | 21 - webapp/src/app/api/model/topicsByTime.ts | 48 +- webapp/src/app/api/model/topicsByYear.ts | 38 +- .../src/app/api/model/topicsListResponse.ts | 12 +- .../api/model/validation-error-loc-inner.ts | 11 - webapp/src/app/api/model/validation-error.ts | 16 - webapp/src/app/api/model/validationError.ts | 12 +- .../app/api/model/validationErrorLocInner.ts | 7 +- webapp/src/app/api/model/value.ts | 7 +- webapp/src/app/api/model/work-biblio.ts | 19 - .../work-citation-normalized-percentile.ts | 19 - .../model/work-cited-by-percentile-year.ts | 17 - .../api/model/work-counts-by-year-inner.ts | 17 - webapp/src/app/api/model/work-has-content.ts | 17 - webapp/src/app/api/model/work-ids.ts | 20 - webapp/src/app/api/model/work-keyword.ts | 19 - webapp/src/app/api/model/work-mesh-inner.ts | 20 - webapp/src/app/api/model/work-network-node.ts | 29 - webapp/src/app/api/model/work-page.ts | 33 - ...ork-sustainable-development-goals-inner.ts | 19 - webapp/src/app/api/model/work-topic-domain.ts | 17 - webapp/src/app/api/model/work-topic-field.ts | 17 - .../app/api/model/work-topic-information.ts | 20 - .../src/app/api/model/work-topic-subfield.ts | 17 - webapp/src/app/api/model/work-topic.ts | 25 - webapp/src/app/api/model/work.ts | 106 +- webapp/src/app/api/model/workBiblio.ts | 14 +- .../model/workCitationNormalizedPercentile.ts | 12 +- .../api/model/workCitedByPercentileYear.ts | 10 +- .../app/api/model/workCountsByYearInner.ts | 10 +- webapp/src/app/api/model/workHasContent.ts | 10 +- webapp/src/app/api/model/workIds.ts | 16 +- webapp/src/app/api/model/workKeyword.ts | 12 +- webapp/src/app/api/model/workMeshInner.ts | 16 +- webapp/src/app/api/model/workNetworkNode.ts | 38 +- webapp/src/app/api/model/workPage.ts | 46 +- .../workSustainableDevelopmentGoalsInner.ts | 12 +- webapp/src/app/api/model/workTopic.ts | 18 +- webapp/src/app/api/model/workTopicDomain.ts | 10 +- webapp/src/app/api/model/workTopicField.ts | 10 +- .../src/app/api/model/workTopicInformation.ts | 22 +- webapp/src/app/api/model/workTopicSubfield.ts | 10 +- .../app/api/model/works-filter-properties.ts | 32 - .../src/app/api/model/works-list-response.ts | 21 - .../app/api/model/worksFilterProperties.ts | 46 +- webapp/src/app/api/model/worksListResponse.ts | 12 +- webapp/src/app/api/param.ts | 37 +- webapp/src/app/api/provide-api.ts | 24 +- webapp/src/app/api/variables.ts | 10 +- webapp/src/app/app.routes.ts | 21 +- .../src/app/directives/debounce.directive.ts | 30 + .../institution-projects-bund.component.html | 41 + .../institution-projects-bund.component.scss | 3 + .../institution-projects-bund.component.ts | 109 + .../institution-projects-eu.component.html | 40 + .../institution-projects-eu.component.scss | 0 .../institution-projects-eu.component.ts | 104 + .../institution/institution.component.html | 36 +- .../institution/institution.component.scss | 3 + .../institution/institution.component.ts | 117 +- .../app/resolvers/bund-projects.resolver.ts | 27 + .../src/app/resolvers/eu-projects.resolver.ts | 23 + .../src/app/resolvers/institution.resolver.ts | 17 + 230 files changed, 7034 insertions(+), 10862 deletions(-) create mode 100644 projects_eu_all_names.txt create mode 100644 service/src/main/inse/institutions/institutions_search_client.py create mode 100644 service/src/main/inse/models/bund_project.py create mode 100644 service/src/main/inse/models/dfg_project.py create mode 100644 service/src/main/inse/models/eu_project.py create mode 100644 service/src/main/inse/projects/model.py create mode 100644 service/src/main/inse/projects/projects_search_client.py create mode 100644 service/src/main/inse/projects/router.py create mode 100644 service/src/main/inse/projects/service.py delete mode 100644 webapp/openapi.json delete mode 100644 webapp/src/app/api/api/funding.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/inse-account-service.service.ts delete mode 100644 webapp/src/app/api/api/inse-account-service.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/inse-service.service.ts delete mode 100644 webapp/src/app/api/api/inse-service.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/institutions.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/items.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/person-network.service.ts delete mode 100644 webapp/src/app/api/api/person-network.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/persons.serviceInterface.ts create mode 100644 webapp/src/app/api/api/projects.service.ts delete mode 100644 webapp/src/app/api/api/topics.serviceInterface.ts delete mode 100644 webapp/src/app/api/api/works.serviceInterface.ts delete mode 100644 webapp/src/app/api/model/access-grant.ts delete mode 100644 webapp/src/app/api/model/auth-scope.ts delete mode 100644 webapp/src/app/api/model/author-affiliations-inner.ts delete mode 100644 webapp/src/app/api/model/author-counts-by-year-inner.ts delete mode 100644 webapp/src/app/api/model/author-ids.ts delete mode 100644 webapp/src/app/api/model/author-network-node.ts delete mode 100644 webapp/src/app/api/model/author-parsed-longest-name.ts delete mode 100644 webapp/src/app/api/model/author-position-count.ts delete mode 100644 webapp/src/app/api/model/author-summary-stats.ts delete mode 100644 webapp/src/app/api/model/authors-filter-properties.ts delete mode 100644 webapp/src/app/api/model/authors-list-response.ts delete mode 100644 webapp/src/app/api/model/autocomplete-response-meta.ts delete mode 100644 webapp/src/app/api/model/autocomplete-response-results-inner.ts delete mode 100644 webapp/src/app/api/model/autocomplete-response.ts create mode 100644 webapp/src/app/api/model/bundProject.ts create mode 100644 webapp/src/app/api/model/bundProjectPage.ts create mode 100644 webapp/src/app/api/model/categoryNested.ts delete mode 100644 webapp/src/app/api/model/collaboration-network-edge.ts delete mode 100644 webapp/src/app/api/model/collaboration-network-node-type.ts delete mode 100644 webapp/src/app/api/model/collaboration-network.ts delete mode 100644 webapp/src/app/api/model/cost-usd.ts delete mode 100644 webapp/src/app/api/model/custom-author.ts delete mode 100644 webapp/src/app/api/model/custom-authors-list-response.ts delete mode 100644 webapp/src/app/api/model/dehydrated-author.ts delete mode 100644 webapp/src/app/api/model/dehydrated-funder.ts delete mode 100644 webapp/src/app/api/model/dehydrated-institution.ts delete mode 100644 webapp/src/app/api/model/dehydrated-source.ts rename webapp/src/app/api/model/{auth-account.ts => displayCodeSplittedNested.ts} (69%) create mode 100644 webapp/src/app/api/model/euProject.ts create mode 100644 webapp/src/app/api/model/euProjectPage.ts delete mode 100644 webapp/src/app/api/model/filter-information.ts delete mode 100644 webapp/src/app/api/model/filter-properties.ts delete mode 100644 webapp/src/app/api/model/funder-by-author.ts delete mode 100644 webapp/src/app/api/model/funders-by-author-response.ts delete mode 100644 webapp/src/app/api/model/group-by-result.ts delete mode 100644 webapp/src/app/api/model/http-validation-error.ts delete mode 100644 webapp/src/app/api/model/identity-grant.ts delete mode 100644 webapp/src/app/api/model/institution-geo.ts delete mode 100644 webapp/src/app/api/model/institution-ids.ts delete mode 100644 webapp/src/app/api/model/institution-information.ts delete mode 100644 webapp/src/app/api/model/institution-network-node.ts delete mode 100644 webapp/src/app/api/model/institutions-list-response.ts delete mode 100644 webapp/src/app/api/model/item-create.ts delete mode 100644 webapp/src/app/api/model/item-page.ts rename webapp/src/app/api/model/{model2-yr-mean-citedness.ts => keywordNested.ts} (74%) delete mode 100644 webapp/src/app/api/model/open-access.ts create mode 100644 webapp/src/app/api/model/organizationNested.ts rename webapp/src/app/api/model/{person-bio.ts => programmeNested.ts} (63%) delete mode 100644 webapp/src/app/api/model/publication-ids-by-author-position.ts create mode 100644 webapp/src/app/api/model/publicationDetailByFunder.ts delete mode 100644 webapp/src/app/api/model/publications-by-author-response.ts delete mode 100644 webapp/src/app/api/model/topic-count.ts delete mode 100644 webapp/src/app/api/model/topic-domain.ts delete mode 100644 webapp/src/app/api/model/topic-field.ts delete mode 100644 webapp/src/app/api/model/topic-ids.ts delete mode 100644 webapp/src/app/api/model/topic-subfield.ts delete mode 100644 webapp/src/app/api/model/topics-by-time.ts delete mode 100644 webapp/src/app/api/model/topics-by-year.ts delete mode 100644 webapp/src/app/api/model/topics-list-response.ts delete mode 100644 webapp/src/app/api/model/validation-error-loc-inner.ts delete mode 100644 webapp/src/app/api/model/validation-error.ts delete mode 100644 webapp/src/app/api/model/work-biblio.ts delete mode 100644 webapp/src/app/api/model/work-citation-normalized-percentile.ts delete mode 100644 webapp/src/app/api/model/work-cited-by-percentile-year.ts delete mode 100644 webapp/src/app/api/model/work-counts-by-year-inner.ts delete mode 100644 webapp/src/app/api/model/work-has-content.ts delete mode 100644 webapp/src/app/api/model/work-ids.ts delete mode 100644 webapp/src/app/api/model/work-keyword.ts delete mode 100644 webapp/src/app/api/model/work-mesh-inner.ts delete mode 100644 webapp/src/app/api/model/work-network-node.ts delete mode 100644 webapp/src/app/api/model/work-page.ts delete mode 100644 webapp/src/app/api/model/work-sustainable-development-goals-inner.ts delete mode 100644 webapp/src/app/api/model/work-topic-domain.ts delete mode 100644 webapp/src/app/api/model/work-topic-field.ts delete mode 100644 webapp/src/app/api/model/work-topic-information.ts delete mode 100644 webapp/src/app/api/model/work-topic-subfield.ts delete mode 100644 webapp/src/app/api/model/work-topic.ts delete mode 100644 webapp/src/app/api/model/works-filter-properties.ts delete mode 100644 webapp/src/app/api/model/works-list-response.ts create mode 100644 webapp/src/app/directives/debounce.directive.ts create mode 100644 webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.html create mode 100644 webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.scss create mode 100644 webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.ts create mode 100644 webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.html create mode 100644 webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.scss create mode 100644 webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.ts create mode 100644 webapp/src/app/resolvers/bund-projects.resolver.ts create mode 100644 webapp/src/app/resolvers/eu-projects.resolver.ts create mode 100644 webapp/src/app/resolvers/institution.resolver.ts diff --git a/projects_eu_all_names.txt b/projects_eu_all_names.txt new file mode 100644 index 00000000..2f5cc250 --- /dev/null +++ b/projects_eu_all_names.txt @@ -0,0 +1,8 @@ +UNIVERSITAET DUISBURG-ESSEN +UNIVERSITAET DUISBURG-ESSEN - STANDORT DUISBURG +UNIVERSITÄT DUISBURG-ESSEN +UNIVERSITAET DUISBURG-ESSEN - STANDORT ESSEN +UNIVERSITAET DUISBURG-ESSEN (UNIVERSITY OF DUISBURG-ESSEN) +UNIVERSITAT DUISBURG-ESSEN +UNIVERSITY OF DUISBURG-ESSEN +UNIVERSITÄT DUISBURG ESSEN \ No newline at end of file diff --git a/service/src/main/inse/.env b/service/src/main/inse/.env index f2fc4762..db52757d 100644 --- a/service/src/main/inse/.env +++ b/service/src/main/inse/.env @@ -3,4 +3,7 @@ ELASTICSEARCH_API_KEY=am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ LLM_API_URL=https://project.nes.uni-due.de/llm2/v1/ LLM_API_KEY=c2d5e7ccf7a4760dd3d19bed2caed9d85ff7437400e0ea82a6d6f912ebc2f212 -LLM_MODEL=gemma4-e4b \ No newline at end of file +LLM_MODEL=gemma4-e4b + +ELASTICSEARCH_INSE_URL=https://inse.nes.uni-due.de/elastic +ELASTICSEARCH_INSE_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== \ No newline at end of file diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py index 4d83fe03..b6d1ef39 100644 --- a/service/src/main/inse/config.py +++ b/service/src/main/inse/config.py @@ -56,6 +56,9 @@ class Settings(BaseSettings): {"url": "http://localhost:8000", "description": "Local development server"}, ] + elasticsearch_inse_url: Optional[str] = None + elasticsearch_inse_api_key: Optional[str] = None + settings = Settings() diff --git a/service/src/main/inse/institutions/institutions_search_client.py b/service/src/main/inse/institutions/institutions_search_client.py new file mode 100644 index 00000000..93f0a7cf --- /dev/null +++ b/service/src/main/inse/institutions/institutions_search_client.py @@ -0,0 +1,132 @@ +import logging +from typing import List, Set + +import httpx + +from inse.models.institution import Institution + +logger = logging.getLogger(__name__) + + +class InstitutionsSearchClient: + def __init__( + self, + base_url: str, + api_key: str, + ): + self.base_url = base_url + self.api_key = api_key + self.headers = { + "Content-Type": "application/json", + "Authorization": f"ApiKey {self.api_key}", + } + + async def get_institution_by_id(self, raw_institution_id: str) -> Institution: + query = { + "query": { + "match": { + "id": f"https://openalex.org/{raw_institution_id.upper()}", + } + }, + "size": 1, + } + async with httpx.AsyncClient() as client: + response = await client.post( + f"{self.base_url}/openalex-institutions/_search", + json=query, + headers=self.headers, + ) + response.raise_for_status() + hits = response.json().get("hits", {}).get("hits", []) + if not hits: + raise ValueError( + f"Institution with ID '{raw_institution_id}' not found." + ) + return Institution.from_dict(hits[0]["_source"]) + + async def get_institution_aliases_by_id(self, raw_institution_id: str) -> List[str]: + """Get a list of institution aliases for a given institution ID, including both display name alternatives and predefined aliases. + + Args: + raw_institution_id (str): The raw institution ID for which to retrieve aliases. + + Returns: + List[str]: A list of aliases for the given institution ID. + """ + institution = await self.get_institution_by_id(raw_institution_id) + aliases = list( + self.augment_aliases(set(institution.display_name_alternatives or [])) + | self.get_predefined_institution_aliases(raw_institution_id) + ) + logger.debug( + "Retrieved aliases for institution_id=%s: %s", raw_institution_id, aliases + ) + return aliases + + def get_predefined_institution_aliases(self, raw_institution_id: str) -> Set[str]: + """Get predefined aliases for a given institution ID. + + Args: + raw_institution_id (str): The raw institution ID for which to retrieve predefined aliases. + + Returns: + Set[str]: A set of predefined aliases for the given institution ID. + """ + raw_institution_id = raw_institution_id.upper() + predefined_aliases = { + "I62318514": [ + "universität duisburg-essen", + "university of duisburg-essen", + "universitaet duisburg-essen", + "universität duisburg-essen", + "universitat duisburg-essen", + ], + } + + return self.augment_aliases(set(predefined_aliases.get(raw_institution_id, []))) + + def augment_aliases(self, aliases: Set[str]) -> Set[str]: + """Augment a set of aliases by applying the augment_alias function to each alias. + + Args: + aliases (Set[str]): A set of aliases to augment. + + Returns: + Set[str]: A set of augmented aliases. + """ + augmented_aliases = set() + for alias in aliases: + augmented_aliases.update(self.augment_alias(alias)) + return augmented_aliases + + def augment_alias(self, alias: str) -> List[str]: + """Augment an alias by replacing German umlauts and ß with their alternative spellings. + + Args: + alias (str): The alias to augment. + + Returns: + List[str]: A list of augmented aliases. + """ + alias = alias.lower() + aliases = [alias] + aliases.append( + alias.replace("ä", "ae") + .replace("ö", "oe") + .replace("ü", "ue") + .replace("ß", "ss") + ) + aliases.append( + alias.replace("ae", "ä") + .replace("oe", "ö") + .replace("ue", "ü") + .replace("ss", "ß") + ) + aliases.append( + alias.replace("ä", "a") + .replace("ö", "o") + .replace("ü", "u") + .replace("ß", "s") + ) + aliases.append(alias.replace("-", " ")) + return aliases diff --git a/service/src/main/inse/institutions/logic.py b/service/src/main/inse/institutions/logic.py index 34504553..5cfa3172 100644 --- a/service/src/main/inse/institutions/logic.py +++ b/service/src/main/inse/institutions/logic.py @@ -3,9 +3,10 @@ """ Business logic for OpenAlex institutions. """ + import logging from copy import deepcopy -from typing import Any +from typing import Any, Optional import httpx from fastapi import HTTPException @@ -15,9 +16,13 @@ from starlette.status import HTTP_502_BAD_GATEWAY from inse.models.autocomplete_response import AutocompleteResponse from inse.models.autocomplete_response_meta import AutocompleteResponseMeta -from inse.models.autocomplete_response_results_inner import AutocompleteResponseResultsInner +from inse.models.autocomplete_response_results_inner import ( + AutocompleteResponseResultsInner, +) from inse.models.institutions_list_response import InstitutionsListResponse +from inse.models.institution import Institution from .search_client import OpenAlexInstitutionsClient +from inse.institutions.institutions_search_client import InstitutionsSearchClient logger = logging.getLogger(__name__) @@ -33,6 +38,12 @@ _VALID_INSTITUTION_TYPES = { } +async def get_institution_by_id( + raw_institution_id: str, client: InstitutionsSearchClient +) -> Institution: + return await client.get_institution_by_id(raw_institution_id) + + async def list_institutions( *, search: str | None = None, @@ -85,7 +96,10 @@ async def list_institutions( try: normalized_data = _normalize_institutions_response(data) - return InstitutionsListResponse.from_dict(normalized_data) or InstitutionsListResponse() + return ( + InstitutionsListResponse.from_dict(normalized_data) + or InstitutionsListResponse() + ) except ValidationError as exc: logger.exception("OpenAlex institutions response could not be parsed.") raise HTTPException( @@ -114,10 +128,7 @@ async def autocomplete_institutions( sort="works_count:desc", per_page=limit, page=1, - select=( - "id,ror,display_name,country_code,type,works_count," - "cited_by_count,geo" - ), + select=("id,ror,display_name,country_code,type,works_count,cited_by_count,geo"), client=client, ) @@ -165,7 +176,13 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: meta = normalized.get("meta") if isinstance(meta, dict): - for field in ["count", "db_response_time_ms", "page", "per_page", "groups_count"]: + for field in [ + "count", + "db_response_time_ms", + "page", + "per_page", + "groups_count", + ]: meta[field] = _int_or_none(meta.get(field)) meta["next_cursor"] = _str_or_none(meta.get("next_cursor")) meta["cost_usd"] = _number_or_none(meta.get("cost_usd")) @@ -187,7 +204,10 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: institution[field] = _str_or_none(institution.get(field)) institution_type = institution.get("type") - if institution_type is not None and institution_type not in _VALID_INSTITUTION_TYPES: + if ( + institution_type is not None + and institution_type not in _VALID_INSTITUTION_TYPES + ): institution["type"] = None else: institution["type"] = _str_or_none(institution_type) @@ -202,7 +222,9 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: institution["works_count"] = _int_or_none(institution.get("works_count")) institution["cited_by_count"] = _int_or_none(institution.get("cited_by_count")) institution["created_date"] = _date_str_or_none(institution.get("created_date")) - institution["updated_date"] = _datetime_str_or_none(institution.get("updated_date")) + institution["updated_date"] = _datetime_str_or_none( + institution.get("updated_date") + ) summary_stats = institution.get("summary_stats") if isinstance(summary_stats, dict): diff --git a/service/src/main/inse/institutions/search_client.py b/service/src/main/inse/institutions/search_client.py index 3db5e1dd..9839e24c 100644 --- a/service/src/main/inse/institutions/search_client.py +++ b/service/src/main/inse/institutions/search_client.py @@ -3,6 +3,7 @@ """ HTTP client for OpenAlex institutions. """ + from typing import Any import httpx @@ -19,8 +20,14 @@ class OpenAlexInstitutionsClient: transport: httpx.AsyncBaseTransport | None = None, ): self.base_url = (base_url or config.settings.openalex_api_base_url).rstrip("/") - self.api_key = api_key if api_key is not None else config.settings.openalex_api_key - self.timeout = timeout if timeout is not None else config.settings.openalex_api_timeout_seconds + self.api_key = ( + api_key if api_key is not None else config.settings.openalex_api_key + ) + self.timeout = ( + timeout + if timeout is not None + else config.settings.openalex_api_timeout_seconds + ) self.transport = transport def list_institutions_params( diff --git a/service/src/main/inse/institutions/service.py b/service/src/main/inse/institutions/service.py index 69d6911e..3a3b6c2b 100644 --- a/service/src/main/inse/institutions/service.py +++ b/service/src/main/inse/institutions/service.py @@ -3,19 +3,58 @@ """ REST API for OpenAlex institutions. """ + +from functools import lru_cache from typing import Annotated -from fastapi import APIRouter -from fastapi import Query +from fastapi import APIRouter, Depends, status, Query from inse.models.autocomplete_response import AutocompleteResponse from inse.models.institutions_list_response import InstitutionsListResponse from inse.tags import Tags +from inse.models.institution import Institution +from inse.config import get_settings from . import logic +from inse.institutions.institutions_search_client import InstitutionsSearchClient router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS]) +@lru_cache +def get_institutions_search_client() -> InstitutionsSearchClient: + settings = get_settings() + if not settings.elasticsearch_url: + raise ValueError("Elasticsearch URL is missing in settings.") + if not settings.elasticsearch_api_key: + raise ValueError("Elasticsearch API key is missing in settings.") + + return InstitutionsSearchClient( + api_key=settings.elasticsearch_api_key, + base_url=settings.elasticsearch_url, + ) + + +@router.get( + "/{id}", + summary="Returns a single institution by ID.", + description="Returns a single institution by its OpenAlex ID.", + operation_id="getInstitutionById", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": Institution, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, +) +async def get_institution( + id: str, + client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], +) -> Institution: + return await logic.get_institution_by_id(raw_institution_id=id, client=client) + @router.get( "/autocomplete", @@ -27,7 +66,10 @@ router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS]) async def autocomplete_institutions( query: Annotated[ str, - Query(description="Institution search text, for example 'Duisburg Essen'.", min_length=1), + Query( + description="Institution search text, for example 'Duisburg Essen'.", + min_length=1, + ), ], country_code: Annotated[ str | None, @@ -64,7 +106,9 @@ async def list_institutions( ] = None, filter: Annotated[ str | None, - Query(description="OpenAlex filter, for example 'country_code:DE,type:education'."), + Query( + description="OpenAlex filter, for example 'country_code:DE,type:education'." + ), ] = None, sort: Annotated[ str | None, @@ -88,7 +132,11 @@ async def list_institutions( ] = None, sample: Annotated[ int | None, - Query(description="Random sample size. Cannot be combined with sort or page.", ge=1, le=10000), + Query( + description="Random sample size. Cannot be combined with sort or page.", + ge=1, + le=10000, + ), ] = None, select: Annotated[ str | None, diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index a1e4614e..ab6d63f1 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -16,6 +16,7 @@ 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.projects.router import router as projects_router from . import config from .service import router as service_router @@ -43,6 +44,8 @@ app.include_router(funders_service_router) app.include_router(service_router) app.include_router(account_router) +app.include_router(projects_router) + app.add_middleware( CORSMiddleware, allow_origins=settings.allowed_origins, diff --git a/service/src/main/inse/models/bund_project.py b/service/src/main/inse/models/bund_project.py new file mode 100644 index 00000000..6599ed41 --- /dev/null +++ b/service/src/main/inse/models/bund_project.py @@ -0,0 +1,226 @@ +from datetime import datetime, date +from typing import Annotated, Optional + +from pydantic import BaseModel, BeforeValidator, ConfigDict, Field + + +def parse_german_date(value: Optional[str]) -> Optional[date]: + if value is None or isinstance(value, date): + return value + + return datetime.strptime(value, "%d.%m.%Y").date() + + +class BundProject(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + extra="ignore", + ) + + funding_code: Optional[str] = Field( + default=None, + validation_alias="Förderkennzeichen", + description="The funding code of the project", + examples=["19F2266G"], + ) + + department: Optional[str] = Field( + default=None, + validation_alias="Ressort", + description="The department of the project", + examples=["BMDV"], + ) + + department_fullname: Optional[str] = Field( + default=None, + validation_alias="Ressort_fullname", + description="The full name of the department of the project", + examples=["Bundesministerium für Digitales und Verkehr"], + ) + + referat: Optional[str] = Field( + default=None, + validation_alias="Referat", + description="The referat of the project", + examples=["DP20"], + ) + + project_sponsor: Optional[str] = Field( + default=None, + validation_alias="Projektträger", + description="The project sponsor of the project", + examples=["PT-TÜV"], + ) + + project_sponsor_fullname: Optional[str] = Field( + default=None, + validation_alias="Projektträger_fullname", + description="The full name of the project sponsor of the project", + examples=["Projektträger TÜV Rheinland"], + ) + + work_unit: Optional[str] = Field( + default=None, + validation_alias="Arb.-Einh.", + description="The work unit of the project", + examples=["mFUND"], + ) + + recipient: Optional[str] = Field( + default=None, + validation_alias="Zuwendungsempfänger", + description="The recipient of the project", + examples=["Universität Duisburg-Essen"], + ) + + municipal_code: Optional[str] = Field( + default=None, + validation_alias="Gemeindekennziffer", + description="The municipal code of the project", + examples=["05113000"], + ) + + municipality: Optional[str] = Field( + default=None, + validation_alias="Stadt/Gemeinde", + description="The municipality of the project", + examples=["Essen"], + ) + + place: Optional[str] = Field( + default=None, + validation_alias="Ort", + description="The place of the project", + examples=["Essen"], + ) + + state: Optional[str] = Field( + default=None, + validation_alias="Bundesland", + description="The state of the project", + examples=["Nordrhein-Westfalen"], + ) + + country: Optional[str] = Field( + default=None, + validation_alias="Staat", + description="The country of the project", + examples=["Deutschland"], + ) + + implementing_agency: Optional[str] = Field( + default=None, + validation_alias="Ausführende Stelle", + description="The implementing agency of the project", + examples=[ + "Universität Duisburg-Essen - Fachbereich Allgemeine Informatik - Lehrstuhl Networked Embedded Systems (NES)" + ], + ) + + topic: Optional[str] = Field( + default=None, + validation_alias="Thema", + description="The topic of the project", + examples=[ + "Verbundprojekt: Multimodaler Mobilitäts-Index - Moby_Dex -, Teilvorhaben: Universität Duisburg-Essen" + ], + ) + + performance_plan_system: Optional[str] = Field( + default=None, + validation_alias="Leistungsplansystematik", + description="The performance plan system of the project", + examples=["GA6011"], + ) + + performance_plan_system_text: Optional[str] = Field( + default=None, + validation_alias="Klartext Leistungsplansystematik", + description="The performance plan system text of the project", + examples=["Angewandte Forschung und Experimentelle Entwicklung"], + ) + + funding_start: Annotated[ + Optional[date], + Field( + default=None, + validation_alias="Förderbeginn", + description="The funding start date of the project", + examples=["01.09.2023"], + ), + BeforeValidator(parse_german_date), + ] + + funding_end: Annotated[ + Optional[date], + Field( + default=None, + validation_alias="Förderende", + description="The funding end date of the project", + examples=["31.08.2026"], + ), + BeforeValidator(parse_german_date), + ] + + grant_amount: Optional[float] = Field( + default=None, + validation_alias="Fördersumme", + description="The grant amount of the project", + examples=[367651.00], + ) + + funding_profile: Optional[str] = Field( + default=None, + validation_alias="Förderprofil", + description="The funding profile of the project", + examples=["Technologie- und Innovationsförderung"], + ) + + joint_project: Optional[str] = Field( + default=None, + validation_alias="Verbundprojekt", + description="Whether the project is a joint project", + examples=["Moby_Dex"], + ) + + funding_type: Optional[str] = Field( + default=None, + validation_alias="Förderart", + description="The funding type of the project", + examples=["PDIR"], + ) + + publication_date: Optional[str] = Field( + default=None, + validation_alias="Publikationsdatum", + description="The publication date of the project", + examples=["2023"], + ) + + unix_timestamp: Optional[int] = Field( + default=None, + validation_alias="Unix-Timestamp", + description="The unix timestamp of the project", + examples=[1737411518], + ) + + date: Optional[str] = Field( + default=None, + validation_alias="datum", + description="The date of the project", + examples=["20.01.2025"], + ) + + new: Optional[bool] = Field( + default=None, + validation_alias="neu", + description="Whether the project is new", + examples=[False], + ) + + duration: Optional[str] = Field( + default=None, + validation_alias="Laufzeit", + description="The duration of the project", + examples=["von 01.09.2023 bis 31.08.2026"], + ) diff --git a/service/src/main/inse/models/dfg_project.py b/service/src/main/inse/models/dfg_project.py new file mode 100644 index 00000000..409e0fe5 --- /dev/null +++ b/service/src/main/inse/models/dfg_project.py @@ -0,0 +1,94 @@ +from datetime import date +from typing import Optional, Set + +from pydantic import BaseModel, Field + + +class DfgProject(BaseModel): + id: str = Field(description="The ID of the DFG project") + link: str = Field(description="The link to the DFG project") + title: str = Field(description="The title of the DFG project") + description: str = Field(description="The description of the DFG project") + + project_identifier: str = Field( + description="The project identifier of the DFG project" + ) + + funding_start_date: str = Field( + description="The funding start date of the DFG project" + ) + funding_end_date: str = Field(description="The funding end date of the DFG project") + + associated_persons: list[str] = Field( + description="The associated persons of the DFG project" + ) + + institutions: list[str] = Field( + description="The institutions associated with the DFG project" + ) + + @classmethod + def from_elastic_hit(cls, hit: dict): + source = hit["_source"] + + associated_persons: Set[str] = set() + institutions: Set[str] = set() + + # persons + + if "Antragsteller" in source: + associated_persons.update(source["Antragsteller"].split(";")) + + if "Antragstellerin" in source: + associated_persons.add(source["Antragstellerin"]) + + if "Sprecher" in source: + associated_persons.add(source["Sprecher"]) + + if "Sprecherin" in source: + associated_persons.add(source["Sprecherin"]) + + if "Leiter" in source: + associated_persons.add(source["Leiter"]) + + if "Leiterin" in source: + associated_persons.add(source["Leiterin"]) + + if "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler" in source: + associated_persons.update( + source[ + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler" + ].split(";") + ) + + if "Beteiligte Personen" in source: + associated_persons.update(source["Beteiligte Personen"].split(";")) + + if "Teilprojektleiter" in source: + associated_persons.update(source["Teilprojektleiter"].split(";")) + + # institutions + + if "Antragstellende Institution" in source: + institutions.add(source["Antragstellende Institution"]) + + if "Mitantragstellende Institution" in source: + institutions.add(source["Mitantragstellende Institution"]) + + if "Beteiligte Institution" in source: + institutions.add(source["Beteiligte Institution"]) + + if "Beteiligte Hochschule" in source: + institutions.add(source["Beteiligte Hochschule"]) + + return cls( + id=hit["_id"], + link=source["link"], + title=source["title"], + description=source["description"], + project_identifier=source["Projektkennzeichen"], + funding_start_date=source["funding_start"], + funding_end_date=source["funding_end"], + associated_persons=list(associated_persons), + institutions=list(institutions), + ) diff --git a/service/src/main/inse/models/eu_project.py b/service/src/main/inse/models/eu_project.py new file mode 100644 index 00000000..a499216a --- /dev/null +++ b/service/src/main/inse/models/eu_project.py @@ -0,0 +1,192 @@ +from typing import List, Optional +from pydantic import BaseModel, ConfigDict, Field + + +class DisplayCodeSplittedNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + single_display_code: Optional[str] = Field( + default=None, + validation_alias="singleDisplayCode", + description="A solitary segment or specific component broken out from the main display code.", + ) + + +class CategoryNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + category: Optional[str] = Field( + default=None, + description="The descriptive classification title or taxonomy name for the project.", + ) + code: Optional[str] = Field( + default=None, description="The system code representing the specific category." + ) + display_code: Optional[str] = Field( + default=None, + validation_alias="displayCode", + description="The alphanumeric code formatted for user interface display purposes.", + ) + # REFINED: Mapped to List[str] because the real data provides an array of strings + display_code_splitted: List[str] = Field( + default_factory=list, + validation_alias="displayCode_splitted", + description="A tokenized hierarchy breakdown of the display code represented as an array of strings.", + ) + display_code_splitted_nested: List[DisplayCodeSplittedNested] = Field( + default_factory=list, + validation_alias="displayCode_splitted_nested", + description="Granular, nested breakdowns of the split parts of the display code.", + ) + + +class KeywordNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + keyword: Optional[str] = Field( + default=None, + description="An individual standalone keyword or tag used for granular search index filtering.", + ) + + +class OrganizationNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + ec_contribution: Optional[str] = Field( + default=None, + validation_alias="ecContribution", + description="The gross European Commission financial contribution allocated to this specific participant organization.", + ) + id: Optional[str] = Field( + default=None, + description="The unique identifier or Participant Identification Code (PIC) of the organization.", + ) + name: Optional[str] = Field( + default=None, + description="The full legal name of the participating organization or institution.", + ) + net_ec_contribution: Optional[str] = Field( + default=None, + validation_alias="netEcContribution", + description="The net European Commission financial funding provided to the organization after adjustments.", + ) + total_cost: Optional[str] = Field( + default=None, + validation_alias="totalCost", + description="The overall individual budget or total cost declared by this organization for its share of work.", + ) + organization_type: Optional[str] = Field( + default=None, + validation_alias="type", + description="The legal entity type or role of the organization (e.g., coordinator, participant).", + ) + + +class ProgrammeNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + code: Optional[str] = Field( + default=None, + description="The structural code identifying the framework or specific funding sub-programme.", + ) + id: Optional[str] = Field( + default=None, + description="The unique identifier of the funding program within the registry.", + ) + programme: Optional[str] = Field( + default=None, + description="The official title or description of the EU funding program.", + ) + + +class EuProject(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + acronym: Optional[str] = Field( + default=None, + description="The official, short acronym chosen to identify the EU project.", + ) + categories_nested: List[CategoryNested] = Field( + default_factory=list, + description="Structured lists of classification categories and taxonomy mappings assigned to the project.", + ) + doc_number: Optional[str] = Field( + default=None, + description="The internal administrative document control number or record tracking identifier.", + ) + doi: Optional[str] = Field( + default=None, + description="The Digital Object Identifier (DOI) linked to the project's official metadata or primary publication.", + ) + ec_max_contribution: Optional[str] = Field( + default=None, + validation_alias="ecMaxContribution", + description="The maximum authorized limit for the European Commission's financial grant contribution to the project.", + ) + end_date: Optional[str] = Field( + default=None, + validation_alias="endDate", + description="The calendar date marking the official structural conclusion of the project execution timeline.", + ) + funding_end: Optional[str] = Field( + default=None, + description="The exact calendar termination year for the project's financial eligibility period.", + ) + funding_start: Optional[str] = Field( + default=None, + description="The exact calendar activation year from which project expenses can be billed against the grant.", + ) + id: Optional[str] = Field( + default=None, + description="The unique global record ID for the project document (typically the Grant Agreement Number).", + ) + keywords: Optional[str] = Field( + default=None, + description="A general text string or comma-separated list of keywords applied to the project record.", + ) + keywords_nested: List[KeywordNested] = Field( + default_factory=list, + description="Strictly tokenized and isolated keywords nested for targeted search engine aggregations.", + ) + link: Optional[str] = Field( + default=None, + description="The web URL linking directly to the project's public profile page on CORDIS or an equivalent registry.", + ) + objective: Optional[str] = Field( + default=None, + description="The complete, detailed abstract outlining the goals, methodology, and expected impact of the project.", + ) + organization_nested: List[OrganizationNested] = Field( + default_factory=list, + description="The full roster of academic, public, or private organizations participating in the project consortium.", + ) + programme_nested: List[ProgrammeNested] = Field( + default_factory=list, + description="The nested historical line of EU funding frameworks and structural grants supporting this project.", + ) + source: Optional[str] = Field( + default=None, + description="The specific upstream system or database repository from which this document was fetched or synced.", + ) + start_date: Optional[str] = Field( + default=None, + validation_alias="startDate", + description="The official calendar date marking the active kickoff and formal initiation of the project.", + ) + status: Optional[str] = Field( + default=None, + description="The lifecycle phase of the project (e.g., 'CLOSED', 'ONGOING').", + ) + teaser: Optional[str] = Field( + default=None, + description="A brief, high-level summary or editorial sentence written for general public consumption.", + ) + title: Optional[str] = Field( + default=None, + description="The comprehensive, full legal title describing the scope of the project.", + ) + total_cost: Optional[str] = Field( + default=None, + validation_alias="totalCost", + description="The combined sum total budget estimated for the implementation of the entire project.", + ) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py new file mode 100644 index 00000000..2739cc50 --- /dev/null +++ b/service/src/main/inse/projects/model.py @@ -0,0 +1,31 @@ +from typing import List + +from pydantic import BaseModel, Field + +from inse.models.bund_project import BundProject +from inse.models.eu_project import EuProject + + +class BundProjectPage(BaseModel): + elements: List[BundProject] = Field( + default_factory=list, description="The bund projects on this page." + ) + page: int = Field(default=0, description="The current page number.") + size: int = Field(default=20, description="The requested page size.") + total: int = Field(default=0, description="The total number of bund projects.") + + +class BundProjectList(BaseModel): + elements: List[BundProject] = Field( + default_factory=list, description="All bund projects." + ) + total: int = Field(default=0, description="The total number of bund projects.") + + +class EuProjectPage(BaseModel): + elements: List[EuProject] = Field( + default_factory=list, description="The EU projects on this page." + ) + page: int = Field(default=0, description="The current page number.") + size: int = Field(default=20, description="The requested page size.") + total: int = Field(default=0, description="The total number of EU projects.") diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py new file mode 100644 index 00000000..18ffc350 --- /dev/null +++ b/service/src/main/inse/projects/projects_search_client.py @@ -0,0 +1,297 @@ +import json +import logging +from typing import Any, Dict, List, Optional + +import httpx + +from inse.config import get_settings +from inse.models.bund_project import BundProject +from inse.projects.model import BundProjectPage, EuProjectPage +from inse.models.eu_project import EuProject + + +logger = logging.getLogger(__name__) + +settings = get_settings() + + +class ProjectsSearchClient: + def __init__( + self, + base_url: str, + index: str, + api_key: str, + ): + self.base_url = base_url + self.index = index + self.api_key = api_key + self.headers = { + "Content-Type": "application/json", + "Authorization": f"ApiKey {self.api_key}", + } + + async def make_search_request(self, query: dict) -> dict: + async with httpx.AsyncClient() as client: + response = await client.post( + f"{self.base_url}/{self.index}/_search", + json=query, + headers=self.headers, + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as e: + logger.exception( + f"HTTP error occurred: {e.response.status_code} - {e.response.text}" + ) + raise + + return response.json() + + +class BundProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_bund", + api_key=settings.elasticsearch_inse_api_key, + ) + + def bund_projects_query( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> dict: + from_ = (page - 1) * size + query = { + "size": size, + "from": from_, + "query": { + "match_all": {}, + }, + } + if id: + query["query"] = {"match": {"id": id}} + + if len(institution_names) > 0: + query["query"] = { + "bool": { + "should": [ + { + "match": { + "Zuwendungsempfänger": { + "query": name, + "operator": "and", + } + } + } + for name in institution_names + ], + "minimum_should_match": 1, + } + } + + sort_by = sort_by.strip() + if sort_by == "topic": + sort_by = "Thema.keyword" + elif sort_by == "department": + sort_by = "Ressort_fullname.keyword" + elif sort_by == "grant_amount": + sort_by = "Fördersumme" + + sort_direction = sort_direction.strip().lower() + if sort_direction not in ["asc", "desc"]: + sort_direction = "asc" + + query["sort"] = [{f"{sort_by}": {"order": sort_direction}}] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed query: {query_str}") + return query + + def response_to_bund_project_page( + self, response: dict, page: int, size: int + ) -> BundProjectPage: + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + BundProject.model_validate(hit["_source"]) + for hit in hits_block.get("hits", []) + ] + return BundProjectPage( + elements=elements, total=total_hits, page=page, size=size + ) + + async def search_bund_projects( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> BundProjectPage: + query = self.bund_projects_query( + page, size, id, institution_names, sort_by, sort_direction + ) + response = await self.make_search_request(query) + return self.response_to_bund_project_page(response, page, size) + + async def get_bund_projects_by_institution_name( + self, + institution_names: List[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> BundProjectPage: + query = self.bund_projects_query( + page, + size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_bund_project_page(response, page, size) + + +class EuProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_eu_all", + api_key=settings.elasticsearch_inse_api_key, + ) + + def eu_projects_query( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> dict: + from_ = (page - 1) * size + query: Dict[str, Any] = {"size": size, "from": from_, "query": {}} + + must_clauses: List[Dict[str, Any]] = [] + if id: + must_clauses.append({"match": {"id": id}}) + + if institution_names: + must_clauses.append( + { + "nested": { + "path": "organization_nested", + "query": { + "bool": { + "should": [ + { + "match": { + "organization_nested.name": { + "query": name, + "operator": "and", + } + } + } + for name in institution_names + ], + "minimum_should_match": 1, + } + }, + } + } + ) + + if must_clauses: + query["query"] = {"bool": {"must": must_clauses}} + else: + query["query"] = {"match_all": {}} + + sort_by = sort_by.strip().lower() + sort_direction = sort_direction.strip().lower() + if sort_direction not in ["asc", "desc"]: + sort_direction = "asc" + + sort_config: Dict[str, Any] = {} + + if sort_by == "topic": + sort_config = {"title.keyword": {"order": sort_direction}} + + elif sort_by == "grant_amount": + sort_config = {"totalCost.keyword": {"order": sort_direction}} + + elif sort_by == "department": + sort_config = { + "programme_nested.programme.keyword": { + "order": sort_direction, + "nested": {"path": "programme_nested"}, + } + } + else: + sort_config = {"id.keyword": {"order": sort_direction}} + + query["sort"] = [sort_config] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed query: {query_str}") + + return query + + def response_to_eu_project_page( + self, response: dict, page: int, size: int + ) -> EuProjectPage: + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + EuProject.model_validate(hit["_source"]) + for hit in hits_block.get("hits", []) + ] + return EuProjectPage(elements=elements, total=total_hits, page=page, size=size) + + async def search_eu_projects( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> EuProjectPage: + query = self.eu_projects_query( + page, size, id, institution_names, sort_by, sort_direction + ) + response = await self.make_search_request(query) + return self.response_to_eu_project_page(response, page, size) + + async def get_eu_projects_by_institution_name( + self, + institution_names: List[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> EuProjectPage: + query = self.eu_projects_query( + page, + size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_eu_project_page(response, page, size) diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py new file mode 100644 index 00000000..21063ffa --- /dev/null +++ b/service/src/main/inse/projects/router.py @@ -0,0 +1,135 @@ +from functools import lru_cache +import logging +from typing import Annotated + +from fastapi import APIRouter, Depends, Path, Query, status + +from inse.models.bund_project import BundProject +from inse.projects.model import BundProjectPage, EuProjectPage +from inse.tags import Tags +from inse.projects import service as projects_service +from inse.projects.projects_search_client import ( + BundProjectsSearchClient, + EuProjectsSearchClient, +) +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) +from inse.institutions.service import get_institutions_search_client + +logger = logging.getLogger(__name__) + +router = APIRouter(prefix="/api/projects", tags=[Tags.PROJECTS]) + + +@lru_cache +def get_bund_search_client() -> BundProjectsSearchClient: + return BundProjectsSearchClient() + + +@lru_cache +def get_eu_search_client() -> EuProjectsSearchClient: + return EuProjectsSearchClient() + + +@router.get( + "/bund/search", + summary="Get bund projects.", + description="Returns a page of bund projects based on the provided pagination parameters and optional institution filter.", + operation_id="getBundProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": BundProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def get_bund_projects( + bund_search_client: Annotated[ + BundProjectsSearchClient, Depends(get_bund_search_client) + ], + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + institution_id: Annotated[ + str, Query(description="The institution ID to filter by.") + ], + page: Annotated[int, Query(description="The page number.", ge=1)] = 1, + size: Annotated[int, Query(description="The page size.", ge=1)] = 20, + sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", + sort_direction: Annotated[ + str, Query(description="The sort direction (asc or desc).") + ] = "asc", +) -> BundProjectPage: + return await projects_service.get_bund_projects_by_institution_id( + bund_search_client=bund_search_client, + institutions_search_client=institutions_search_client, + institution_id=institution_id, + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + +@router.get( + "/eu/search", + summary="Get EU projects.", + description="Returns a page of EU projects based on the provided pagination parameters and optional institution filter.", + operation_id="getEuProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": EuProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def get_eu_projects( + eu_search_client: Annotated[EuProjectsSearchClient, Depends(get_eu_search_client)], + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + institution_id: Annotated[ + str, Query(description="The institution ID to filter by.") + ], + page: Annotated[int, Query(description="The page number.", ge=1)] = 1, + size: Annotated[int, Query(description="The page size.", ge=1)] = 20, + sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", + sort_direction: Annotated[ + str, Query(description="The sort direction (asc or desc).") + ] = "asc", +) -> EuProjectPage: + return await projects_service.get_eu_projects_by_institution_id( + eu_search_client=eu_search_client, + institutions_search_client=institutions_search_client, + institution_id=institution_id, + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + +@router.get( + "/bund/{bund_project_id}", + summary="Get a bund project by its project ID.", + description="Returns a bund project based on its project ID.", + operation_id="getBundProjectById", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": BundProject, + }, + status.HTTP_404_NOT_FOUND: {"description": "Bund project not found"}, + }, +) +async def get_bund_project_by_id( + bund_project_id: Annotated[ + str, Path(description="The ID of the bund project to retrieve.") + ], +): + return {"bund_project_id": bund_project_id} diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py new file mode 100644 index 00000000..666a986e --- /dev/null +++ b/service/src/main/inse/projects/service.py @@ -0,0 +1,95 @@ +import logging +from typing import List + +from inse.projects.projects_search_client import ( + BundProjectsSearchClient, + EuProjectsSearchClient, +) +from inse.projects.model import BundProjectPage, EuProjectPage +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) + +logger = logging.getLogger(__name__) + + +async def get_bund_projects_by_institution_id( + bund_search_client: BundProjectsSearchClient, + institutions_search_client: InstitutionsSearchClient, + institution_id: str, + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", +) -> BundProjectPage: + logger.info( + f"Fetching bund projects for institution_id={institution_id}, page={page}, size={size}" + ) + institution_aliases = ( + await institutions_search_client.get_institution_aliases_by_id(institution_id) + ) + logger.debug( + f"Found institution aliases for institution_id={institution_id}: {institution_aliases}" + ) + response = await bund_search_client.search_bund_projects( + page=page, + size=size, + institution_names=institution_aliases, + sort_by=sort_by, + sort_direction=sort_direction, + ) + logger.debug(f"get_bund_projects_by_institution_id response: {response}") + return response + + +async def get_eu_projects_by_institution_id( + eu_search_client: EuProjectsSearchClient, + institutions_search_client: InstitutionsSearchClient, + institution_id: str, + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", +) -> EuProjectPage: + logger.info( + f"Fetching EU projects for institution_id={institution_id}, page={page}, size={size}" + ) + institution_aliases = ( + await institutions_search_client.get_institution_aliases_by_id(institution_id) + ) + logger.debug( + f"Found institution aliases for institution_id={institution_id}: {institution_aliases}" + ) + response = await eu_search_client.search_eu_projects( + page=page, + size=size, + institution_names=institution_aliases, + sort_by=sort_by, + sort_direction=sort_direction, + ) + logger.debug(f"get_eu_projects_by_institution_id response: {response}") + return response + + +async def get_bund_projects_by_institution_name( + bund_search_client: BundProjectsSearchClient, + page: int, + size: int, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", +) -> BundProjectPage: + logger.info( + f"Fetching bund projects for institution_names={institution_names}, page={page}, size={size}" + ) + response = await bund_search_client.search_bund_projects( + page=page, + size=size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + logger.debug(f"get_bund_projects_by_institution_name response: {response}") + + return response diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 21c6b03c..600bcfb0 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -7,3 +7,4 @@ class Tags(Enum): INSTITUTIONS = "Institutions" TOPICS = "Topics" WORKS = "Works" + PROJECTS = "Projects" diff --git a/ude_person.http b/ude_person.http index 0eef0048..bbe99668 100644 --- a/ude_person.http +++ b/ude_person.http @@ -6,12 +6,236 @@ Content-Type: application/json "query": { "query_string": { "default_field": "name", - "query": "Tobias Janelt" + "query": "Marcus Handte" } } } +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +# { +# "size": 100, +# "query": { +# "multi_match": { +# "query": "Rizk", +# "fields": [ +# "Antragsteller", +# "Antragstellerin", +# "Sprecher", +# "Sprecherin", +# "Leiter", +# "Leiterin", +# "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", +# "Teilprojektleiter" +# ] +# } +# } +# } + +# { +# "size": 100, +# "query": { +# "multi_match": { +# "query": "Duisburg-Essen", +# "fields": [ +# "Antragstellende Institution", +# "Mitantragstellende Institution", +# "Beteiligte Institution" +# ] +# } +# } +# } + +# "aggs": { + +# "antragstellende": { + +# "terms": { + +# "field": "Antragstellende Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "mitantragstellende": { + +# "terms": { + +# "field": "Mitantragstellende Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "beteiligte": { + +# "terms": { + +# "field": "Beteiligte Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "partner": { + +# "terms": { + +# "field": "Partnerorganisation.keyword", + +# "size": 100 + +# } + +# } + +# } + +# } + + +### +GET https://inse.nes.uni-due.de/elastic/projects_bund/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/projects_bund/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + + "size": 10, + "from": 1000, + "query": { + "match": { + "Zuwendungsempf\u00e4nger": { + "query": "Universit\u00e4t Duisburg-Essen", + "operator": "and" + } + } + }, + "sort": [ + { + "Thema.keyword": { + "order": "asc" + } + } + ] + +} + +#{'size': 10, 'from': 0, 'query': {'match': {'Zuwendungsempfänger': {'query': 'Universität Duisburg-Essen', 'operator': 'and'}}}, 'sort': [{'Thema': {'order': 'asc'}}]} + +# { +# "size": 1000, +# "query": { +# "match": { +# "Zuwendungsempfänger": { +# "query": "Universität Duisburg-Essen", +# "operator": "and" +# } +# } +# } +# } + +### +GET https://inse.nes.uni-due.de/elastic/projects_eu_all/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + + +### +GET https://inse.nes.uni-due.de/elastic/projects_eu_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + + "size": 0, + + "query": { + + "nested": { + + "path": "organization_nested", + + "query": { + + "match": { + + "organization_nested.name": "Dortmund" + + } + + } + + } + + }, + + "aggs": { + + "organizations": { + + "nested": { + + "path": "organization_nested" + + }, + + "aggs": { + + "matching": { + + "filter": { + + "match": { + + "organization_nested.name": "Dortmund" + + } + + }, + + "aggs": { + + "names": { + + "terms": { + + "field": "organization_nested.name.keyword", + + "size": 100 + + } + + } + + } + + } + + } + + } + + } + +} + ### GET https://inse.nes.uni-due.de/elastic/ude_organization_content_august_2025/_search @@ -36,9 +260,36 @@ Content-Type: application/json # "query": "Tobias Janelt" # } # } - # } +### + +GET https://project.nes.uni-due.de/elastic/openalex-awards/_mapping +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +### + +GET https://project.nes.uni-due.de/elastic/openalex-awards/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 1000, + "query": { + "bool": { + "must": [ + { + "prefix": { + "landing_page_url": "https://gepris.dfg.de/gepris/projekt/" + } + } + ] + } + } +} + + ### GET https://project.nes.uni-due.de/elastic/openalex-authors/_search diff --git a/webapp/openapi.json b/webapp/openapi.json deleted file mode 100644 index a0e514dd..00000000 --- a/webapp/openapi.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Innovation Search Engine API", - "description": "API for the Innovation Search Engine (INSE) application.", - "version": "0.1.0" - }, - "servers": [ - { - "url": "http://localhost:8000", - "description": "Local development server" - } - ], - "paths": { - "/api/person/network/{raw_user_id}": { - "get": { - "tags": ["Person Network"], - "summary": "Get a person's collaboration network.", - "description": "Returns a person's collaboration network based on their works and co-authors.", - "operationId": "getCollaborationNetwork", - "parameters": [ - { - "name": "raw_user_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "The raw user ID of the person.", - "title": "Raw User Id" - }, - "description": "The raw user ID of the person." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CollaborationNetwork" - } - } - } - }, - "404": { "description": "Person not found" }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "CollaborationNetwork": { - "properties": { - "raw_person_id": { - "type": "string", - "title": "Raw Person ID", - "description": "The raw person ID of the person whose collaboration network this is." - }, - "nodes": { - "items": { - "$ref": "#/components/schemas/CollaborationNetworkNode" - }, - "type": "array", - "title": "Collaboration Network Nodes", - "description": "The nodes in the collaboration network." - }, - "edges": { - "items": { - "$ref": "#/components/schemas/CollaborationNetworkEdge" - }, - "type": "array", - "title": "Collaboration Network Edges", - "description": "The edges in the collaboration network." - }, - "works": { - "items": { "$ref": "#/components/schemas/CollaborationWork" }, - "type": "array", - "title": "Collaboration Works", - "description": "The works that represent the collaborations in the collaboration network." - } - }, - "type": "object", - "required": ["raw_person_id", "nodes", "edges", "works"], - "title": "CollaborationNetwork" - }, - "CollaborationNetworkEdge": { - "properties": { - "raw_source_person_id": { - "type": "string", - "title": "Source Raw Person ID", - "description": "The raw person ID of the source person." - }, - "raw_target_person_id": { - "type": "string", - "title": "Target Raw Person ID", - "description": "The raw person ID of the target person." - }, - "raw_work_ids": { - "items": { "type": "string" }, - "type": "array", - "title": "Work IDs", - "description": "The list of work IDs that represent the collaborations between the two persons." - } - }, - "type": "object", - "required": [ - "raw_source_person_id", - "raw_target_person_id", - "raw_work_ids" - ], - "title": "CollaborationNetworkEdge" - }, - "CollaborationNetworkNode": { - "properties": { - "raw_person_id": { - "type": "string", - "title": "Raw Person ID", - "description": "The raw person ID of the person." - }, - "display_name": { - "type": "string", - "title": "Display Name", - "description": "The display name of the person." - } - }, - "type": "object", - "required": ["raw_person_id", "display_name"], - "title": "CollaborationNetworkNode" - }, - "CollaborationWork": { - "properties": { - "raw_work_id": { - "type": "string", - "title": "Raw Work ID", - "description": "The raw work ID of the work." - }, - "display_title": { - "type": "string", - "title": "Display Title", - "description": "The display title of the work." - } - }, - "type": "object", - "required": ["raw_work_id", "display_title"], - "title": "CollaborationWork" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { "$ref": "#/components/schemas/ValidationError" }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] }, - "type": "array", - "title": "Location" - }, - "msg": { "type": "string", "title": "Message" }, - "type": { "type": "string", "title": "Error Type" } - }, - "type": "object", - "required": ["loc", "msg", "type"], - "title": "ValidationError" - } - } - } -} diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 9779c964..63db0e7f 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -1,117 +1,120 @@ .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 -api/inse-service.serviceInterface.ts +api/iNSEAccountService.service.ts +api/iNSEService.service.ts api/institutions.service.ts -api/institutions.serviceInterface.ts api/items.service.ts -api/items.serviceInterface.ts -api/person-network.service.ts -api/person-network.serviceInterface.ts +api/personNetwork.service.ts api/persons.service.ts -api/persons.serviceInterface.ts +api/projects.service.ts api/topics.service.ts -api/topics.serviceInterface.ts api/works.service.ts -api/works.serviceInterface.ts configuration.ts encoder.ts git_push.sh index.ts -model/access-grant.ts -model/auth-account.ts -model/auth-scope.ts -model/author-affiliations-inner.ts -model/author-counts-by-year-inner.ts -model/author-ids.ts -model/author-network-node.ts -model/author-parsed-longest-name.ts -model/author-position-count.ts -model/author-summary-stats.ts +model/accessGrant.ts +model/authAccount.ts +model/authScope.ts model/author.ts -model/authors-filter-properties.ts -model/authors-list-response.ts +model/authorAffiliationsInner.ts +model/authorCountsByYearInner.ts +model/authorIds.ts +model/authorNetworkNode.ts +model/authorParsedLongestName.ts +model/authorPositionCount.ts +model/authorSummaryStats.ts +model/authorsFilterProperties.ts +model/authorsListResponse.ts model/authorship.ts -model/autocomplete-response-meta.ts -model/autocomplete-response-results-inner.ts -model/autocomplete-response.ts +model/autocompleteResponse.ts +model/autocompleteResponseMeta.ts +model/autocompleteResponseResultsInner.ts model/award.ts -model/collaboration-network-edge.ts -model/collaboration-network-node-type.ts -model/collaboration-network.ts -model/cost-usd.ts -model/custom-author.ts -model/custom-authors-list-response.ts -model/dehydrated-author.ts -model/dehydrated-funder.ts -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/bundProject.ts +model/bundProjectPage.ts +model/categoryNested.ts +model/collaborationNetwork.ts +model/collaborationNetworkEdge.ts +model/collaborationNetworkNodeType.ts +model/costUsd.ts +model/customAuthor.ts +model/customAuthorsListResponse.ts +model/dehydratedAuthor.ts +model/dehydratedFunder.ts +model/dehydratedInstitution.ts +model/dehydratedSource.ts +model/displayCodeSplittedNested.ts +model/euProject.ts +model/euProjectPage.ts +model/filterInformation.ts +model/filterProperties.ts +model/funderByAuthor.ts +model/fundersByAuthorResponse.ts model/fwci.ts -model/group-by-result.ts -model/http-validation-error.ts -model/identity-grant.ts -model/institution-geo.ts -model/institution-ids.ts -model/institution-information.ts -model/institution-network-node.ts +model/groupByResult.ts +model/hTTPValidationError.ts +model/identityGrant.ts model/institution.ts -model/institutions-list-response.ts -model/item-create.ts -model/item-page.ts +model/institutionGeo.ts +model/institutionIds.ts +model/institutionInformation.ts +model/institutionNetworkNode.ts +model/institutionsListResponse.ts model/item.ts +model/itemCreate.ts +model/itemPage.ts +model/keywordNested.ts model/latitude.ts model/location.ts model/longitude.ts model/meta.ts -model/model2-yr-mean-citedness.ts +model/model2YrMeanCitedness.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/openAccess.ts +model/organizationNested.ts +model/personBio.ts +model/programmeNested.ts +model/publicationDetailByFunder.ts +model/publicationIdsByAuthorPosition.ts +model/publicationsByAuthorResponse.ts model/score.ts -model/topic-count.ts -model/topic-domain.ts -model/topic-field.ts -model/topic-ids.ts -model/topic-subfield.ts model/topic.ts -model/topics-by-time.ts -model/topics-by-year.ts -model/topics-list-response.ts -model/validation-error-loc-inner.ts -model/validation-error.ts +model/topicCount.ts +model/topicDomain.ts +model/topicField.ts +model/topicIds.ts +model/topicSubfield.ts +model/topicsByTime.ts +model/topicsByYear.ts +model/topicsListResponse.ts +model/validationError.ts +model/validationErrorLocInner.ts model/value.ts -model/work-biblio.ts -model/work-citation-normalized-percentile.ts -model/work-cited-by-percentile-year.ts -model/work-counts-by-year-inner.ts -model/work-has-content.ts -model/work-ids.ts -model/work-keyword.ts -model/work-mesh-inner.ts -model/work-network-node.ts -model/work-page.ts -model/work-sustainable-development-goals-inner.ts -model/work-topic-domain.ts -model/work-topic-field.ts -model/work-topic-information.ts -model/work-topic-subfield.ts -model/work-topic.ts model/work.ts -model/works-filter-properties.ts -model/works-list-response.ts +model/workBiblio.ts +model/workCitationNormalizedPercentile.ts +model/workCitedByPercentileYear.ts +model/workCountsByYearInner.ts +model/workHasContent.ts +model/workIds.ts +model/workKeyword.ts +model/workMeshInner.ts +model/workNetworkNode.ts +model/workPage.ts +model/workSustainableDevelopmentGoalsInner.ts +model/workTopic.ts +model/workTopicDomain.ts +model/workTopicField.ts +model/workTopicInformation.ts +model/workTopicSubfield.ts +model/worksFilterProperties.ts +model/worksListResponse.ts param.ts provide-api.ts variables.ts diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md index 2df9da7b..dfa7b6e7 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,22 +120,21 @@ 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 + } + ], }; ``` @@ -152,12 +151,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), + ], }; ``` @@ -177,8 +176,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 d9ec8f2e..dcf56358 100644 --- a/webapp/src/app/api/api.base.service.ts +++ b/webapp/src/app/api/api.base.service.ts @@ -1,109 +1,83 @@ /** * Innovation Search Engine 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(); - } - - protected canConsumeForm(consumes: string[]): boolean { - return consumes.indexOf('multipart/form-data') !== -1; - } - - protected addToHttpParams( - httpParams: HttpParams, - value: any, - key?: string, - isDeep: boolean = false, - ): HttpParams { - // If the value is an object (but not a Date), recursively add its keys. - if (typeof value === 'object' && !(value instanceof Date)) { - return this.addToHttpParamsRecursive( - httpParams, - value, - isDeep ? key : undefined, - isDeep, - ); - } - return this.addToHttpParamsRecursive(httpParams, value, key); - } - - protected addToHttpParamsRecursive( - httpParams: HttpParams, - value?: any, - key?: string, - isDeep: boolean = false, - ): HttpParams { - if (value === null || value === undefined) { - return httpParams; - } - if (typeof value === 'object') { - // If JSON format is preferred, key must be provided. - if (key != null) { - return isDeep - ? Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ) - : httpParams.append(key, JSON.stringify(value)); - } - // Otherwise, if it's an array, add each element. - if (Array.isArray(value)) { - value.forEach( - (elem) => - (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), - ); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, value.toISOString()); - } else { - throw Error('key may not be null if value is Date'); + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } - } 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); + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); } - 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 e29250f2..58d341fb 100644 --- a/webapp/src/app/api/api.module.ts +++ b/webapp/src/app/api/api.module.ts @@ -1,42 +1,30 @@ -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.', - ); + 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'); + } } - 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 a51f46b8..5406f421 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,38 +1,21 @@ 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'; -export * from './inse-service.service'; -import { INSEServiceService } from './inse-service.service'; -export * from './inse-service.serviceInterface'; +export * from './iNSEAccountService.service'; +import { INSEAccountServiceService } from './iNSEAccountService.service'; +export * from './iNSEService.service'; +import { INSEServiceService } from './iNSEService.service'; export * from './institutions.service'; import { InstitutionsService } from './institutions.service'; -export * from './institutions.serviceInterface'; export * from './items.service'; import { ItemsService } from './items.service'; -export * from './items.serviceInterface'; -export * from './person-network.service'; -import { PersonNetworkService } from './person-network.service'; -export * from './person-network.serviceInterface'; +export * from './personNetwork.service'; +import { PersonNetworkService } from './personNetwork.service'; export * from './persons.service'; import { PersonsService } from './persons.service'; -export * from './persons.serviceInterface'; +export * from './projects.service'; +import { ProjectsService } from './projects.service'; export * from './topics.service'; import { TopicsService } from './topics.service'; -export * from './topics.serviceInterface'; export * from './works.service'; import { WorksService } from './works.service'; -export * from './works.serviceInterface'; -export const APIS = [ - FundingService, - INSEAccountServiceService, - INSEServiceService, - InstitutionsService, - ItemsService, - PersonNetworkService, - PersonsService, - TopicsService, - WorksService, -]; +export const APIS = [FundingService, INSEAccountServiceService, INSEServiceService, InstitutionsService, ItemsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, WorksService]; diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts index 340b881f..46772768 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,271 +9,153 @@ */ /* 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/funders-by-author-response'; +import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { PublicationsByAuthorResponse } from '../model/publications-by-author-response'; +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'; -import { FundingServiceInterface } from './funding.serviceInterface'; + + @Injectable({ - providedIn: 'root', + 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); - } +export class FundingService extends BaseService { - /** - * 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.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * 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.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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 localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * 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 localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + 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 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 deleted file mode 100644 index 18504afd..00000000 --- a/webapp/src/app/api/api/funding.serviceInterface.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { 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/iNSEAccountService.service.ts b/webapp/src/app/api/api/iNSEAccountService.service.ts index 116f1dd4..7b43eaa5 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,18 +9,12 @@ */ /* 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'; @@ -30,314 +24,190 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { IdentityGrant } from '../model/identityGrant'; // @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); - } - /** - * 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 getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessGrantInseAccountAuthAccessPost( - 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 getAccessGrantInseAccountAuthAccessPost.', - ); - } - if (account === null || account === undefined) { - throw new Error( - 'Required parameter account was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.', - ); - } - if (organization === null || organization === undefined) { - throw new Error( - 'Required parameter organization was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * 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 getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessGrantInseAccountAuthAccessPost(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 getAccessGrantInseAccountAuthAccessPost.'); + } + if (account === null || account === undefined) { + throw new Error('Required parameter account was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); + } + if (organization === null || organization === undefined) { + throw new Error('Required parameter organization was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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 + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * 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 getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getIdentityGrantInseAccountAuthIdPost(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 getIdentityGrantInseAccountAuthIdPost.'); + } + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/x-www-form-urlencoded']; + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const canConsumeForm = this.canConsumeForm(consumes); + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - 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 }); + 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 + } + ); } - 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 getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getIdentityGrantInseAccountAuthIdPost( - 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 getIdentityGrantInseAccountAuthIdPost.', - ); - } - if (password === null || password === undefined) { - throw new Error( - 'Required parameter password was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.', - ); - } - - 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 8788adee..cf95d68e 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,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -32,922 +26,513 @@ 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); - } - /** - * 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.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * 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.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - // 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, - ); - } + 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/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, - }); - } + // 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); + } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - saveJson, - 'save_json', - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy( - topic: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public countTopicHierarchy( - topic: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling countTopicHierarchy.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + 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 localVarHeaders = this.defaultHeaders; + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + saveJson, 'save_json'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Deletes the item with the id. + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteItem.'); + } - /** - * Deletes the item with the id. - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public deleteItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling deleteItem.', - ); + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Returns the item with the id. + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getItem.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // 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/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a page of items. + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItems(pageOffset?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'pageOffset'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + 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/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns the item with the id. - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getItem.', - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Updates the item with the id. + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateItem.'); + } + if (itemCreate === null || itemCreate === undefined) { + throw new Error('Required parameter itemCreate was null or undefined when calling updateItem.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - 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/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Returns a page of items. - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'pageOffset', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicHierarchy( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Updates the item with the id. - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling updateItem.', - ); - } - if (itemCreate === null || itemCreate === undefined) { - throw new Error( - 'Required parameter itemCreate was null or undefined when calling updateItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } } diff --git a/webapp/src/app/api/api/inse-account-service.service.ts b/webapp/src/app/api/api/inse-account-service.service.ts deleted file mode 100644 index 4e455475..00000000 --- a/webapp/src/app/api/api/inse-account-service.service.ts +++ /dev/null @@ -1,347 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* 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 { AccessGrant } from '../model/access-grant'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -import { IdentityGrant } from '../model/identity-grant'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; -import { INSEAccountServiceServiceInterface } from './inse-account-service.serviceInterface'; - -@Injectable({ - providedIn: 'root', -}) -export class INSEAccountServiceService - extends BaseService - implements INSEAccountServiceServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - - /** - * 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 getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessGrantInseAccountAuthAccessPost( - 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 getAccessGrantInseAccountAuthAccessPost.', - ); - } - if (account === null || account === undefined) { - throw new Error( - 'Required parameter account was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.', - ); - } - if (organization === null || organization === undefined) { - throw new Error( - 'Required parameter organization was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.', - ); - } - - 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 getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getIdentityGrantInseAccountAuthIdPost( - 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 getIdentityGrantInseAccountAuthIdPost.', - ); - } - if (password === null || password === undefined) { - throw new Error( - 'Required parameter password was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.', - ); - } - - 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/inse-account-service.serviceInterface.ts b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts deleted file mode 100644 index 4f3d6db7..00000000 --- a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AccessGrant } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { IdentityGrant } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface INSEAccountServiceServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Get Access Grant - * - * @endpoint post /inse-account/auth/access - * @param secret - * @param account - * @param organization - */ - getAccessGrantInseAccountAuthAccessPost( - secret: string, - account: number, - organization: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Get Identity Grant - * - * @endpoint post /inse-account/auth/id - * @param username - * @param password - */ - getIdentityGrantInseAccountAuthIdPost( - username: string, - password: string, - 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 deleted file mode 100644 index 1ce8270c..00000000 --- a/webapp/src/app/api/api/inse-service.service.ts +++ /dev/null @@ -1,957 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -import { Item } from '../model/item'; -// @ts-ignore -import { ItemCreate } from '../model/item-create'; -// @ts-ignore -import { ItemPage } from '../model/item-page'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; -import { INSEServiceServiceInterface } from './inse-service.serviceInterface'; - -@Injectable({ - providedIn: 'root', -}) -export class INSEServiceService - extends BaseService - implements INSEServiceServiceInterface -{ - 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.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/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, - }); - } - - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - saveJson, - 'save_json', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy( - topic: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public countTopicHierarchy( - topic: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling countTopicHierarchy.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', - ); - }); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Deletes the item with the id. - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public deleteItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling deleteItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the item with the id. - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Returns a page of items. - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'pageOffset', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicHierarchy( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Updates the item with the id. - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling updateItem.', - ); - } - if (itemCreate === null || itemCreate === undefined) { - throw new Error( - 'Required parameter itemCreate was null or undefined when calling updateItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } -} diff --git a/webapp/src/app/api/api/inse-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts deleted file mode 100644 index 97898ea0..00000000 --- a/webapp/src/app/api/api/inse-service.serviceInterface.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { HTTPValidationError } from '../model/models'; -import { Item } from '../model/models'; -import { ItemCreate } from '../model/models'; -import { ItemPage } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface INSEServiceServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Adds a new item. - * - * @endpoint post /api/inse-service/items - * @param itemCreate - */ - addItem( - itemCreate: ItemCreate, - extraHttpRequestParams?: any, - ): Observable; - - /** - * 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. - */ - buildTopicCache( - pageSize?: number, - saveJson?: boolean, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Counts topic hierarchy occurrences from cache. - * - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - */ - countTopicHierarchy( - topic: Array, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Deletes the item with the id. - * - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - */ - deleteItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns the item with the id. - * - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - */ - getItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns a page of items. - * - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - */ - getItems( - pageOffset?: number, - pageSize?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * - * @endpoint get /api/inse-service/topics/hierarchy - */ - getTopicHierarchy(extraHttpRequestParams?: any): Observable; - - /** - * Updates the item with the id. - * - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - */ - updateItem( - id: number, - itemCreate: ItemCreate, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/institutions.service.ts b/webapp/src/app/api/api/institutions.service.ts index 2700f021..7a956eca 100644 --- a/webapp/src/app/api/api/institutions.service.ts +++ b/webapp/src/app/api/api/institutions.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,368 +9,242 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { AutocompleteResponse } from '../model/autocomplete-response'; +import { AutocompleteResponse } from '../model/autocompleteResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { InstitutionsListResponse } from '../model/institutions-list-response'; +import { Institution } from '../model/institution'; +// @ts-ignore +import { InstitutionsListResponse } from '../model/institutionsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { InstitutionsServiceInterface } from './institutions.serviceInterface'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) -export class InstitutionsService - extends BaseService - implements InstitutionsServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } +export class InstitutionsService extends BaseService { - /** - * Returns institution options for autocomplete inputs. - * @endpoint get /api/institutions/autocomplete - * @param query Institution search text, for example \'Duisburg Essen\'. - * @param countryCode Optional ISO country code filter. - * @param type Optional institution type filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling autocompleteInstitutions.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - countryCode, - 'countryCode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - type, - 'type', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); + /** + * Returns institution options for autocomplete inputs. + * @endpoint get /api/institutions/autocomplete + * @param query Institution search text, for example \'Duisburg Essen\'. + * @param countryCode Optional ISO country code filter. + * @param type Optional institution type filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling autocompleteInstitutions.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + countryCode, 'countryCode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + type, 'type'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/institutions/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a single institution by ID. + * Returns a single institution by its OpenAlex ID. + * @endpoint get /api/institutions/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionById(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionById(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionById(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionById(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getInstitutionById.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/institutions/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns a list of OpenAlex institutions. + * @endpoint get /api/institutions + * @param search Full-text search, for example \'Duisburg Essen\'. + * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'country_code\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns a list of OpenAlex institutions. - * @endpoint get /api/institutions - * @param search Full-text search, for example \'Duisburg Essen\'. - * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'country_code\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filter, - 'filter', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sort, - 'sort', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - groupBy, - 'group_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - perPage, - 'per_page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - cursor, - 'cursor', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sample, - 'sample', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - select, - 'select', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filter, 'filter'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sort, 'sort'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + groupBy, 'group_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + perPage, 'per_page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + cursor, 'cursor'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sample, 'sample'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + select, 'select'); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/institutions`; - 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/institutions.serviceInterface.ts b/webapp/src/app/api/api/institutions.serviceInterface.ts deleted file mode 100644 index bfb7f511..00000000 --- a/webapp/src/app/api/api/institutions.serviceInterface.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AutocompleteResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { InstitutionsListResponse } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface InstitutionsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Returns institution options for autocomplete inputs. - * - * @endpoint get /api/institutions/autocomplete - * @param query Institution search text, for example \'Duisburg Essen\'. - * @param countryCode Optional ISO country code filter. - * @param type Optional institution type filter. - * @param limit Maximum number of autocomplete options. - */ - autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns a list of OpenAlex institutions. - * - * @endpoint get /api/institutions - * @param search Full-text search, for example \'Duisburg Essen\'. - * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'country_code\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - */ - listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/items.service.ts b/webapp/src/app/api/api/items.service.ts index 969303a5..69cd8e54 100644 --- a/webapp/src/app/api/api/items.service.ts +++ b/webapp/src/app/api/api/items.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,627 +9,355 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore import { Item } from '../model/item'; // @ts-ignore -import { ItemCreate } from '../model/item-create'; +import { ItemCreate } from '../model/itemCreate'; // @ts-ignore -import { ItemPage } from '../model/item-page'; +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'; -import { ItemsServiceInterface } from './items.serviceInterface'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) -export class ItemsService extends BaseService implements ItemsServiceInterface { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } +export class ItemsService extends BaseService { - /** - * 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.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * 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.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/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 + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Deletes the item with the id. + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteItem.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // 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, - ); + // 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/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * Returns the item with the id. + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getItem.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - 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, - }); - } + /** + * Returns a page of items. + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItems(pageOffset?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Deletes the item with the id. - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public deleteItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling deleteItem.', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'pageOffset'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Updates the item with the id. + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateItem.'); + } + if (itemCreate === null || itemCreate === undefined) { + throw new Error('Required parameter itemCreate was null or undefined when calling updateItem.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - 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/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the item with the id. - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItem( - id: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItem( - id: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItem( - id: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Returns a page of items. - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getItems( - pageOffset?: number, - pageSize?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'pageOffset', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Updates the item with the id. - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateItem( - id: number, - itemCreate: ItemCreate, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling updateItem.', - ); - } - if (itemCreate === null || itemCreate === undefined) { - throw new Error( - 'Required parameter itemCreate was null or undefined when calling updateItem.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } } diff --git a/webapp/src/app/api/api/items.serviceInterface.ts b/webapp/src/app/api/api/items.serviceInterface.ts deleted file mode 100644 index 89cbb34c..00000000 --- a/webapp/src/app/api/api/items.serviceInterface.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { HTTPValidationError } from '../model/models'; -import { Item } from '../model/models'; -import { ItemCreate } from '../model/models'; -import { ItemPage } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface ItemsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Adds a new item. - * - * @endpoint post /api/inse-service/items - * @param itemCreate - */ - addItem( - itemCreate: ItemCreate, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Deletes the item with the id. - * - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - */ - deleteItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns the item with the id. - * - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - */ - getItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns a page of items. - * - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - */ - getItems( - pageOffset?: number, - pageSize?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Updates the item with the id. - * - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - */ - updateItem( - id: number, - itemCreate: ItemCreate, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/person-network.service.ts b/webapp/src/app/api/api/person-network.service.ts deleted file mode 100644 index 2dc1c55e..00000000 --- a/webapp/src/app/api/api/person-network.service.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* 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 { CollaborationNetwork } from '../model/collaboration-network'; -// @ts-ignore -import { FilterProperties } from '../model/filter-properties'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; -import { PersonNetworkServiceInterface } from './person-network.serviceInterface'; - -@Injectable({ - providedIn: 'root', -}) -export class PersonNetworkService - extends BaseService - implements PersonNetworkServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error( - 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } -} diff --git a/webapp/src/app/api/api/person-network.serviceInterface.ts b/webapp/src/app/api/api/person-network.serviceInterface.ts deleted file mode 100644 index 1a3b6479..00000000 --- a/webapp/src/app/api/api/person-network.serviceInterface.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { CollaborationNetwork } from '../model/models'; -import { FilterProperties } from '../model/models'; -import { HTTPValidationError } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface PersonNetworkServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - */ - getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/personNetwork.service.ts index 5b468938..b1183ff6 100644 --- a/webapp/src/app/api/api/personNetwork.service.ts +++ b/webapp/src/app/api/api/personNetwork.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CollaborationNetwork } from '../model/collaborationNetwork'; @@ -30,139 +24,86 @@ import { FilterProperties } from '../model/filterProperties'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class PersonNetworkService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error( - 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawUserId === null || rawUserId === undefined) { + throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: filterProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index da1cde14..a45848ef 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,1736 +9,880 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { AuthorsListResponse } from '../model/authors-list-response'; +import { AuthorsListResponse } from '../model/authorsListResponse'; // @ts-ignore -import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; +import { CustomAuthorsListResponse } from '../model/customAuthorsListResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { PersonBio } from '../model/person-bio'; +import { PersonBio } from '../model/personBio'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { PersonsServiceInterface } from './persons.serviceInterface'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) -export class PersonsService - extends BaseService - implements PersonsServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } +export class PersonsService extends BaseService { - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public generatePersonBio( - authorId: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling generatePersonBio.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'author_id', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID( - id: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPersonByID( - id: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID( - id: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID( - id: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getPersonByID.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling getPersonByID.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID_1( - id: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPersonByID_1( - id: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID_1( - id: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID_1( - id: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getPersonByID_1.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling getPersonByID_1.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'author_id', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsAutocomplete.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error( - 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByInstitution.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institution_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error( - 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByInstitution_3.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institution_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsByName.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByName.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsByName_4.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByName_4.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsList( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institutionName', - ); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + /** + * Generates a bio for a person by author ID. + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - strict, - 'strict', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterMode, - 'filterMode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterYear, - 'filterYear', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID(id: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPersonByID(id: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID(id: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID(id: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling getPersonByID.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + let localVarHeaders = this.defaultHeaders; - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList_5( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsList_5( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList_5( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList_5( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institutionName', - ); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - strict, - 'strict', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterMode, - 'filterMode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterYear, - 'filterYear', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID_1(id: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPersonByID_1(id: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID_1(id: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID_1(id: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPersonByID_1.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling getPersonByID_1.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institution_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution_3.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institution_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName_4.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByName_4.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + strict, 'strict'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterMode, 'filterMode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterYear, 'filterYear'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList_5(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList_5(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList_5(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList_5(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + strict, 'strict'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterMode, 'filterMode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterYear, 'filterYear'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/persons.serviceInterface.ts b/webapp/src/app/api/api/persons.serviceInterface.ts deleted file mode 100644 index d6b3e740..00000000 --- a/webapp/src/app/api/api/persons.serviceInterface.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AuthorsListResponse } from '../model/models'; -import { CustomAuthorsListResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { PersonBio } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface PersonsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Generates a bio for a person by author ID. - * - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - */ - generatePersonBio( - authorId: string, - include?: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by ID. - * - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - getPersonByID( - id: string, - include: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by ID. - * - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - getPersonByID_1( - id: string, - include: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for persons by ID or name. - * - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - */ - searchPersons( - authorId?: string, - query?: string, - include?: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsAutocomplete( - authorName: string, - include: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsAutocomplete_2( - authorName: string, - include: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for persons by institution name. - * - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for persons by institution name. - * - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - */ - searchPersonsList( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - */ - searchPersonsList_5( - query?: string, - institutionName?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts new file mode 100644 index 00000000..cbc915e7 --- /dev/null +++ b/webapp/src/app/api/api/projects.service.ts @@ -0,0 +1,246 @@ +/** + * Innovation Search Engine 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 { BundProject } from '../model/bundProject'; +// @ts-ignore +import { BundProjectPage } from '../model/bundProjectPage'; +// @ts-ignore +import { EuProjectPage } from '../model/euProjectPage'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ProjectsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Get a bund project by its project ID. + * Returns a bund project based on its project ID. + * @endpoint get /api/projects/bund/{bund_project_id} + * @param bundProjectId The ID of the bund project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBundProjectById(bundProjectId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getBundProjectById(bundProjectId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBundProjectById(bundProjectId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBundProjectById(bundProjectId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bundProjectId === null || bundProjectId === undefined) { + throw new Error('Required parameter bundProjectId was null or undefined when calling getBundProjectById.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/bund/${this.configuration.encodeParam({name: "bundProjectId", value: bundProjectId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Get bund projects. + * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/bund/search + * @param institutionId The institution ID to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getBundProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getBundProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBundProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getBundProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionId === null || institutionId === undefined) { + throw new Error('Required parameter institutionId was null or undefined when calling getBundProjects.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionId, 'institution_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/bund/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Get EU projects. + * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/eu/search + * @param institutionId The institution ID to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getEuProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getEuProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getEuProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getEuProjects(institutionId: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionId === null || institutionId === undefined) { + throw new Error('Required parameter institutionId was null or undefined when calling getEuProjects.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionId, 'institution_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/eu/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index 9eb7c66d..2667546d 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,697 +9,362 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { AutocompleteResponse } from '../model/autocomplete-response'; +import { AutocompleteResponse } from '../model/autocompleteResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { TopicsListResponse } from '../model/topics-list-response'; +import { TopicsListResponse } from '../model/topicsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { TopicsServiceInterface } from './topics.serviceInterface'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) -export class TopicsService - extends BaseService - implements TopicsServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } +export class TopicsService extends BaseService { - /** - * Returns topic options for autocomplete inputs. - * @endpoint get /api/topics/autocomplete - * @param query Topic search text, for example \'machine learning\'. - * @param domainId Optional OpenAlex domain id filter. - * @param fieldId Optional OpenAlex field id filter. - * @param subfieldId Optional OpenAlex subfield id filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling autocompleteTopics.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - domainId, - 'domainId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fieldId, - 'fieldId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - subfieldId, - 'subfieldId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); + /** + * Returns topic options for autocomplete inputs. + * @endpoint get /api/topics/autocomplete + * @param query Topic search text, for example \'machine learning\'. + * @param domainId Optional OpenAlex domain id filter. + * @param fieldId Optional OpenAlex field id filter. + * @param subfieldId Optional OpenAlex subfield id filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling autocompleteTopics.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + domainId, 'domainId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fieldId, 'fieldId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + subfieldId, 'subfieldId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + let localVarHeaders = this.defaultHeaders; - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/api/topics/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - saveJson, - 'save_json', - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy( - topic: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public countTopicHierarchy( - topic: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling countTopicHierarchy.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + let localVarPath = `/api/topics/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - let localVarHeaders = this.defaultHeaders; + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + saveJson, 'save_json'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicHierarchy( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a list of OpenAlex topics. + * @endpoint get /api/topics + * @param search Full-text search, for example \'machine learning\'. + * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'domain.id\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filter, 'filter'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sort, 'sort'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + groupBy, 'group_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + perPage, 'per_page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + cursor, 'cursor'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sample, 'sample'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + select, 'select'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of OpenAlex topics. - * @endpoint get /api/topics - * @param search Full-text search, for example \'machine learning\'. - * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'domain.id\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filter, - 'filter', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sort, - 'sort', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - groupBy, - 'group_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - perPage, - 'per_page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - cursor, - 'cursor', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sample, - 'sample', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - select, - 'select', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/topics.serviceInterface.ts b/webapp/src/app/api/api/topics.serviceInterface.ts deleted file mode 100644 index 43bdd05d..00000000 --- a/webapp/src/app/api/api/topics.serviceInterface.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AutocompleteResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { TopicsListResponse } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface TopicsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Returns topic options for autocomplete inputs. - * - * @endpoint get /api/topics/autocomplete - * @param query Topic search text, for example \'machine learning\'. - * @param domainId Optional OpenAlex domain id filter. - * @param fieldId Optional OpenAlex field id filter. - * @param subfieldId Optional OpenAlex subfield id filter. - * @param limit Maximum number of autocomplete options. - */ - autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * 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. - */ - buildTopicCache( - pageSize?: number, - saveJson?: boolean, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Counts topic hierarchy occurrences from cache. - * - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - */ - countTopicHierarchy( - topic: Array, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * - * @endpoint get /api/inse-service/topics/hierarchy - */ - getTopicHierarchy(extraHttpRequestParams?: any): Observable; - - /** - * Returns a list of OpenAlex topics. - * - * @endpoint get /api/topics - * @param search Full-text search, for example \'machine learning\'. - * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'domain.id\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - */ - listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 3806a5e6..9d95c5d8 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,719 +9,386 @@ */ /* 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'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { TopicCount } from '../model/topic-count'; +import { TopicCount } from '../model/topicCount'; // @ts-ignore -import { TopicsByTime } from '../model/topics-by-time'; +import { TopicsByTime } from '../model/topicsByTime'; // @ts-ignore import { Work } from '../model/work'; // @ts-ignore -import { WorkPage } from '../model/work-page'; +import { WorkPage } from '../model/workPage'; // @ts-ignore -import { WorksListResponse } from '../model/works-list-response'; +import { WorksListResponse } from '../model/worksListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { WorksServiceInterface } from './works.serviceInterface'; + + @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, - ) { - super(basePath, configuration); - } +export class WorksService extends BaseService { - /** - * Returns all works for an author. - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllAuthorWorks( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAllAuthorWorks( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllAuthorWorks( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllAuthorWorks( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getAllAuthorWorks.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Returns all works for an author. + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); + } - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'bearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/all`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** - * Returns a page of works for an author. - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - 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 responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_year', + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (type) { - type.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'type', + + /** + * Returns a page of works for an author. + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + * @param institutionId Filter by OpenAlex institution id. Can be repeated. + * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_year'); + }) + } + if (type) { + type.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'type'); + }) + } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'language'); + }) + } + if (institutionId) { + institutionId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_id'); + }) + } + if (topicId) { + topicId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_id'); + }) + } + + 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})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'language', + + /** + * 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 + } ); - }); } - if (institutionId) { - institutionId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_id', + + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param targetPublications Target number of publications used for the timeline. Complete years are always included. + * @param includeAll If true, all publications are used for the timeline. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxTopicsPerYear, 'max_topics_per_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + targetPublications, 'target_publications'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + includeAll, 'include_all'); + + let localVarHeaders = this.defaultHeaders; + + // 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})}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (topicId) { - topicId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_id', + + /** + * Returns one publication. + * @endpoint get /api/works/detail/{work_id} + * @param workId The OpenAlex work id, for example W2741809807. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWork(workId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWork(workId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWork(workId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWork(workId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (workId === null || workId === undefined) { + throw new Error('Required parameter workId was null or undefined when calling getWork.'); + } + + 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/detail/${this.configuration.encodeParam({name: "workId", value: workId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - let 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 })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns work counts per primary topic for an author. - * @endpoint get /api/works/{author_id}/primary-topic-counts - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // 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 - * @param authorId The author id, for example A5023888391. - * @param maxTopicsPerYear The maximum number of topics per year. - * @param targetPublications Target number of publications used for the timeline. Complete years are always included. - * @param includeAll If true, all publications are used for the timeline. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - maxTopicsPerYear, - 'max_topics_per_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - targetPublications, - 'target_publications', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - includeAll, - 'include_all', - ); - - let localVarHeaders = this.defaultHeaders; - - // 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 })}/topics-by-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns one publication. - * @endpoint get /api/works/detail/{work_id} - * @param workId The OpenAlex work id, for example W2741809807. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWork( - workId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWork( - workId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWork( - workId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWork( - workId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (workId === null || workId === undefined) { - throw new Error( - 'Required parameter workId was null or undefined when calling getWork.', - ); - } - - 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/detail/${this.configuration.encodeParam({ name: 'workId', value: workId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } } diff --git a/webapp/src/app/api/api/works.serviceInterface.ts b/webapp/src/app/api/api/works.serviceInterface.ts deleted file mode 100644 index 718c6192..00000000 --- a/webapp/src/app/api/api/works.serviceInterface.ts +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { HTTPValidationError } from '../model/models'; -import { TopicCount } from '../model/models'; -import { TopicsByTime } from '../model/models'; -import { Work } from '../model/models'; -import { WorkPage } from '../model/models'; -import { WorksListResponse } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface WorksServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Returns all works for an author. - * - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - */ - getAllAuthorWorks( - authorId: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns a page of works for an author. - * - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - */ - getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: 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. - * @param targetPublications Target number of publications used for the timeline. Complete years are always included. - * @param includeAll If true, all publications are used for the timeline. - */ - getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns one publication. - * - * @endpoint get /api/works/detail/{work_id} - * @param workId The OpenAlex work id, for example W2741809807. - */ - getWork(workId: string, extraHttpRequestParams?: any): Observable; -} diff --git a/webapp/src/app/api/configuration.ts b/webapp/src/app/api/configuration.ts index 664630b3..c39ce2d6 100644 --- a/webapp/src/app/api/configuration.ts +++ b/webapp/src/app/api/configuration.ts @@ -1,219 +1,193 @@ -import { - HttpHeaders, - HttpParams, - HttpParameterCodec, -} from '@angular/common/http'; +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; import { Param } from './param'; export interface ConfigurationParameters { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: { [key: string]: string }; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Override the default method for encoding path parameters in various - * styles. - *

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

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

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

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

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

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

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

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor({ - accessToken, - apiKeys, - basePath, - credentials, - encodeParam, - encoder, - password, - username, - withCredentials, - }: ConfigurationParameters = {}) { - if (apiKeys) { - this.apiKeys = apiKeys; - } - if (username !== undefined) { - this.username = username; - } - if (password !== undefined) { - this.password = password; - } - if (accessToken !== undefined) { - this.accessToken = accessToken; - } - if (basePath !== undefined) { - this.basePath = basePath; - } - if (withCredentials !== undefined) { - this.withCredentials = withCredentials; - } - if (encoder) { - this.encoder = encoder; - } - this.encodeParam = - encodeParam ?? ((param) => this.defaultEncodeParam(param)); - this.credentials = credentials ?? {}; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; - // init default bearer credential - if (!this.credentials['bearer']) { - this.credentials['bearer'] = () => { - return typeof this.accessToken === 'function' - ? this.accessToken() - : this.accessToken; - }; - } - } - - /** - * Select the correct content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param contentTypes - the array of content types that are available for selection - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderContentType(contentTypes: string[]): string | undefined { - if (contentTypes.length === 0) { - return undefined; + // init default bearer credential + if (!this.credentials['bearer']) { + this.credentials['bearer'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } - const type = contentTypes.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return contentTypes[0]; - } - return type; - } + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } - /** - * Select the correct accept content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param accepts - the array of content types that are available for selection. - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderAccept(accepts: string[]): string | undefined { - if (accepts.length === 0) { - return undefined; + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; } - const type = accepts.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return accepts[0]; + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; } - return type; - } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - '^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', - 'i', - ); - return ( - mime !== null && - (jsonMime.test(mime) || - mime.toLowerCase() === 'application/json-patch+json') - ); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } - public lookupCredential(key: string): string | undefined { - const value = this.credentials[key]; - return typeof value === 'function' ? value() : value; - } + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } - public addCredentialToHeaders( - credentialKey: string, - headerName: string, - headers: HttpHeaders, - prefix?: string, - ): HttpHeaders { - const value = this.lookupCredential(credentialKey); - return value ? headers.set(headerName, (prefix ?? '') + value) : headers; - } + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } - public addCredentialToQuery( - credentialKey: string, - paramName: string, - query: HttpParams, - ): HttpParams { - const value = this.lookupCredential(credentialKey); - return value ? query.set(paramName, value) : query; - } + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } - private defaultEncodeParam(param: Param): string { - // This implementation exists as fallback for missing configuration - // and for backwards compatibility to older typescript-angular generator versions. - // It only works for the 'simple' parameter style. - // Date-handling only works for the 'date-time' format. - // All other styles and Date-formats are probably handled incorrectly. - // - // But: if that's all you need (i.e.: the most common use-case): no need for customization! + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! - const value = - param.dataFormat === 'date-time' && param.value instanceof Date - ? (param.value as Date).toISOString() - : param.value; + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; - return encodeURIComponent(String(value)); - } + return encodeURIComponent(String(value)); + } } diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts index 889ef00d..138c4d5c 100644 --- a/webapp/src/app/api/encoder.ts +++ b/webapp/src/app/api/encoder.ts @@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http'; * Workaround for https://github.com/angular/angular/issues/18261 */ export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } } diff --git a/webapp/src/app/api/model/access-grant.ts b/webapp/src/app/api/model/access-grant.ts deleted file mode 100644 index a7a6381c..00000000 --- a/webapp/src/app/api/model/access-grant.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { AuthScope } from './auth-scope'; - -export interface AccessGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; - refresh_token: string; -} diff --git a/webapp/src/app/api/model/accessGrant.ts b/webapp/src/app/api/model/accessGrant.ts index 0aa29f6f..ad1f537a 100644 --- a/webapp/src/app/api/model/accessGrant.ts +++ b/webapp/src/app/api/model/accessGrant.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,12 @@ */ import { AuthScope } from './authScope'; -export interface AccessGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; - refresh_token: string; + +export interface AccessGrant { + token_type: string; + access_token: string; + expires_in: number; + scope: AuthScope; + refresh_token: string; } + diff --git a/webapp/src/app/api/model/auth-scope.ts b/webapp/src/app/api/model/auth-scope.ts deleted file mode 100644 index ed52c93d..00000000 --- a/webapp/src/app/api/model/auth-scope.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { AuthAccount } from './auth-account'; - -export interface AuthScope { - t: string; - a: AuthAccount; - d?: number | null; - r?: Array; -} diff --git a/webapp/src/app/api/model/authAccount.ts b/webapp/src/app/api/model/authAccount.ts index 179a3e67..0c76d8dc 100644 --- a/webapp/src/app/api/model/authAccount.ts +++ b/webapp/src/app/api/model/authAccount.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AuthAccount { - i: number; - l: string; - o: number; + +export interface AuthAccount { + i: number; + l: string; + o: number; } + diff --git a/webapp/src/app/api/model/authScope.ts b/webapp/src/app/api/model/authScope.ts index 3ccd752e..65ffa9b5 100644 --- a/webapp/src/app/api/model/authScope.ts +++ b/webapp/src/app/api/model/authScope.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { AuthAccount } from './authAccount'; -export interface AuthScope { - t: string; - a: AuthAccount; - d?: number | null; - r?: Array; + +export interface AuthScope { + t: string; + a: AuthAccount; + d?: number | null; + r?: Array; } + diff --git a/webapp/src/app/api/model/author-affiliations-inner.ts b/webapp/src/app/api/model/author-affiliations-inner.ts deleted file mode 100644 index d13f78c9..00000000 --- a/webapp/src/app/api/model/author-affiliations-inner.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { DehydratedInstitution } from './dehydrated-institution'; - -/** - * AuthorAffiliationsInner - */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; -} diff --git a/webapp/src/app/api/model/author-counts-by-year-inner.ts b/webapp/src/app/api/model/author-counts-by-year-inner.ts deleted file mode 100644 index 1fac5b45..00000000 --- a/webapp/src/app/api/model/author-counts-by-year-inner.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * AuthorCountsByYearInner - */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; -} diff --git a/webapp/src/app/api/model/author-ids.ts b/webapp/src/app/api/model/author-ids.ts deleted file mode 100644 index 0b079d33..00000000 --- a/webapp/src/app/api/model/author-ids.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * External identifiers: - */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; -} diff --git a/webapp/src/app/api/model/author-network-node.ts b/webapp/src/app/api/model/author-network-node.ts deleted file mode 100644 index 2e684c1c..00000000 --- a/webapp/src/app/api/model/author-network-node.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { CollaborationNetworkNodeType } from './collaboration-network-node-type'; - -export interface AuthorNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; -} -export namespace AuthorNetworkNode {} diff --git a/webapp/src/app/api/model/author-parsed-longest-name.ts b/webapp/src/app/api/model/author-parsed-longest-name.ts deleted file mode 100644 index f08df27d..00000000 --- a/webapp/src/app/api/model/author-parsed-longest-name.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The longest name parsed into its component parts. - */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; -} diff --git a/webapp/src/app/api/model/author-position-count.ts b/webapp/src/app/api/model/author-position-count.ts deleted file mode 100644 index 989d2c18..00000000 --- a/webapp/src/app/api/model/author-position-count.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface AuthorPositionCount { - first?: number; - middle?: number; - last?: number; - unknown?: number; -} diff --git a/webapp/src/app/api/model/author-summary-stats.ts b/webapp/src/app/api/model/author-summary-stats.ts deleted file mode 100644 index ede015ad..00000000 --- a/webapp/src/app/api/model/author-summary-stats.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Model2YrMeanCitedness } from './model2-yr-mean-citedness'; - -/** - * Citation metrics: - */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; -} diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index a9199cd9..9ba12273 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -1,39 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { AuthorAffiliationsInner } from './author-affiliations-inner'; -import { AuthorParsedLongestName } from './author-parsed-longest-name'; -import { DehydratedInstitution } from './dehydrated-institution'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorIds } from './author-ids'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { WorkTopic } from './work-topic'; +import { AuthorAffiliationsInner } from './authorAffiliationsInner'; +import { AuthorParsedLongestName } from './authorParsedLongestName'; +import { DehydratedInstitution } from './dehydratedInstitution'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorIds } from './authorIds'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { WorkTopic } from './workTopic'; + /** * A person who creates scholarly works */ -export interface Author { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Author { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/authorAffiliationsInner.ts b/webapp/src/app/api/model/authorAffiliationsInner.ts index d1e8f764..270443ff 100644 --- a/webapp/src/app/api/model/authorAffiliationsInner.ts +++ b/webapp/src/app/api/model/authorAffiliationsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,12 @@ */ import { DehydratedInstitution } from './dehydratedInstitution'; + /** * AuthorAffiliationsInner */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; +export interface AuthorAffiliationsInner { + institution?: DehydratedInstitution | null; + years?: Array | null; } + diff --git a/webapp/src/app/api/model/authorCountsByYearInner.ts b/webapp/src/app/api/model/authorCountsByYearInner.ts index 1fac5b45..d16c7c21 100644 --- a/webapp/src/app/api/model/authorCountsByYearInner.ts +++ b/webapp/src/app/api/model/authorCountsByYearInner.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * AuthorCountsByYearInner */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; +export interface AuthorCountsByYearInner { + year?: number | null; + works_count?: number | null; + cited_by_count?: number | null; } + diff --git a/webapp/src/app/api/model/authorIds.ts b/webapp/src/app/api/model/authorIds.ts index 0b079d33..9235a207 100644 --- a/webapp/src/app/api/model/authorIds.ts +++ b/webapp/src/app/api/model/authorIds.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; +export interface AuthorIds { + openalex?: string | null; + orcid?: string | null; + scopus?: string | null; } + diff --git a/webapp/src/app/api/model/authorNetworkNode.ts b/webapp/src/app/api/model/authorNetworkNode.ts index f67c7148..aee98d47 100644 --- a/webapp/src/app/api/model/authorNetworkNode.ts +++ b/webapp/src/app/api/model/authorNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,22 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface AuthorNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; + +export interface AuthorNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace AuthorNetworkNode {} +export namespace AuthorNetworkNode { +} + + diff --git a/webapp/src/app/api/model/authorParsedLongestName.ts b/webapp/src/app/api/model/authorParsedLongestName.ts index f08df27d..f49e04be 100644 --- a/webapp/src/app/api/model/authorParsedLongestName.ts +++ b/webapp/src/app/api/model/authorParsedLongestName.ts @@ -1,20 +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. */ + /** * The longest name parsed into its component parts. */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; +export interface AuthorParsedLongestName { + first?: string | null; + middle?: string | null; + last?: string | null; + suffix?: string | null; + nickname?: string | null; } + diff --git a/webapp/src/app/api/model/authorPositionCount.ts b/webapp/src/app/api/model/authorPositionCount.ts index 989d2c18..a02e3749 100644 --- a/webapp/src/app/api/model/authorPositionCount.ts +++ b/webapp/src/app/api/model/authorPositionCount.ts @@ -1,16 +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; + +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; } + diff --git a/webapp/src/app/api/model/authorSummaryStats.ts b/webapp/src/app/api/model/authorSummaryStats.ts index 63c35c31..1cfc0bdb 100644 --- a/webapp/src/app/api/model/authorSummaryStats.ts +++ b/webapp/src/app/api/model/authorSummaryStats.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; + /** * Citation metrics: */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; +export interface AuthorSummaryStats { + '2yr_mean_citedness'?: Model2YrMeanCitedness | null; + h_index?: number | null; + i10_index?: number | null; } + diff --git a/webapp/src/app/api/model/authors-filter-properties.ts b/webapp/src/app/api/model/authors-filter-properties.ts deleted file mode 100644 index 50795f2a..00000000 --- a/webapp/src/app/api/model/authors-filter-properties.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface AuthorsFilterProperties { - /** - * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. - */ - allowed_institutions?: Array; - /** - * The minimum number of collaborations required for an author to be included in the collaboration network. - */ - min_collaborations?: number; - /** - * The maximum number of collaborations allowed for an author to be included in the collaboration network. - */ - max_collaborations?: number; -} diff --git a/webapp/src/app/api/model/authors-list-response.ts b/webapp/src/app/api/model/authors-list-response.ts deleted file mode 100644 index 228618c7..00000000 --- a/webapp/src/app/api/model/authors-list-response.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Meta } from './meta'; -import { Author } from './author'; -import { GroupByResult } from './group-by-result'; - -/** - * AuthorsListResponse - */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} diff --git a/webapp/src/app/api/model/authorsFilterProperties.ts b/webapp/src/app/api/model/authorsFilterProperties.ts index 50795f2a..7312558f 100644 --- a/webapp/src/app/api/model/authorsFilterProperties.ts +++ b/webapp/src/app/api/model/authorsFilterProperties.ts @@ -1,24 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AuthorsFilterProperties { - /** - * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. - */ - allowed_institutions?: Array; - /** - * The minimum number of collaborations required for an author to be included in the collaboration network. - */ - min_collaborations?: number; - /** - * The maximum number of collaborations allowed for an author to be included in the collaboration network. - */ - max_collaborations?: number; + +export interface AuthorsFilterProperties { + /** + * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. + */ + allowed_institutions?: Array; + /** + * The minimum number of collaborations required for an author to be included in the collaboration network. + */ + min_collaborations?: number; + /** + * The maximum number of collaborations allowed for an author to be included in the collaboration network. + */ + max_collaborations?: number; } + diff --git a/webapp/src/app/api/model/authorsListResponse.ts b/webapp/src/app/api/model/authorsListResponse.ts index bb1a602c..d309ae43 100644 --- a/webapp/src/app/api/model/authorsListResponse.ts +++ b/webapp/src/app/api/model/authorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Author } from './author'; import { GroupByResult } from './groupByResult'; + /** * AuthorsListResponse */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface AuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index 224c6007..db3a0bf0 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -1,24 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedInstitution } from './dehydrated-institution'; -import { DehydratedAuthor } from './dehydrated-author'; +import { DehydratedInstitution } from './dehydratedInstitution'; +import { DehydratedAuthor } from './dehydratedAuthor'; + /** * Author and their affiliation for a work */ -export interface Authorship { - author_position?: string | null; - author?: DehydratedAuthor | null; - institutions?: Array | null; - countries?: Array | null; - is_corresponding?: boolean | null; - raw_author_name?: string | null; - raw_affiliation_strings?: Array | null; +export interface Authorship { + author_position?: string | null; + author?: DehydratedAuthor | null; + institutions?: Array | null; + countries?: Array | null; + is_corresponding?: boolean | null; + raw_author_name?: string | null; + raw_affiliation_strings?: Array | null; } + diff --git a/webapp/src/app/api/model/autocomplete-response-meta.ts b/webapp/src/app/api/model/autocomplete-response-meta.ts deleted file mode 100644 index 5bf94a57..00000000 --- a/webapp/src/app/api/model/autocomplete-response-meta.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * AutocompleteResponseMeta - */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; -} diff --git a/webapp/src/app/api/model/autocomplete-response-results-inner.ts b/webapp/src/app/api/model/autocomplete-response-results-inner.ts deleted file mode 100644 index 0fa956b7..00000000 --- a/webapp/src/app/api/model/autocomplete-response-results-inner.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * AutocompleteResponseResultsInner - */ -export interface AutocompleteResponseResultsInner { - id?: string | null; - display_name?: string | null; - hint?: string | null; - cited_by_count?: number | null; - works_count?: number | null; - entity_type?: string | null; - external_id?: string | null; -} diff --git a/webapp/src/app/api/model/autocomplete-response.ts b/webapp/src/app/api/model/autocomplete-response.ts deleted file mode 100644 index b4e91a1d..00000000 --- a/webapp/src/app/api/model/autocomplete-response.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { AutocompleteResponseMeta } from './autocomplete-response-meta'; -import { AutocompleteResponseResultsInner } from './autocomplete-response-results-inner'; - -/** - * AutocompleteResponse - */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; -} diff --git a/webapp/src/app/api/model/autocompleteResponse.ts b/webapp/src/app/api/model/autocompleteResponse.ts index 8b52b300..e220f57b 100644 --- a/webapp/src/app/api/model/autocompleteResponse.ts +++ b/webapp/src/app/api/model/autocompleteResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,10 +10,12 @@ import { AutocompleteResponseMeta } from './autocompleteResponseMeta'; import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner'; + /** * AutocompleteResponse */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; +export interface AutocompleteResponse { + meta?: AutocompleteResponseMeta | null; + results?: Array | null; } + diff --git a/webapp/src/app/api/model/autocompleteResponseMeta.ts b/webapp/src/app/api/model/autocompleteResponseMeta.ts index 5bf94a57..2e080d39 100644 --- a/webapp/src/app/api/model/autocompleteResponseMeta.ts +++ b/webapp/src/app/api/model/autocompleteResponseMeta.ts @@ -1,17 +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. */ + /** * AutocompleteResponseMeta */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; +export interface AutocompleteResponseMeta { + count?: number | null; + db_response_time_ms?: number | null; } + diff --git a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts index 0fa956b7..99ba71fe 100644 --- a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts +++ b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * AutocompleteResponseResultsInner */ -export interface AutocompleteResponseResultsInner { - id?: string | null; - display_name?: string | null; - hint?: string | null; - cited_by_count?: number | null; - works_count?: number | null; - entity_type?: string | null; - external_id?: string | null; +export interface AutocompleteResponseResultsInner { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; } + diff --git a/webapp/src/app/api/model/award.ts b/webapp/src/app/api/model/award.ts index a461c971..4e3b5cc9 100644 --- a/webapp/src/app/api/model/award.ts +++ b/webapp/src/app/api/model/award.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Award */ -export interface Award { - id?: string | null; - display_name?: string | null; - funder_award_id?: string | null; - funder_id?: string | null; - funder_display_name?: string | null; - doi?: string | null; +export interface Award { + id?: string | null; + display_name?: string | null; + funder_award_id?: string | null; + funder_id?: string | null; + funder_display_name?: string | null; + doi?: string | null; } + diff --git a/webapp/src/app/api/model/bundProject.ts b/webapp/src/app/api/model/bundProject.ts new file mode 100644 index 00000000..3463aa78 --- /dev/null +++ b/webapp/src/app/api/model/bundProject.ts @@ -0,0 +1,42 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface BundProject { + funding_code?: string | null; + department?: string | null; + department_fullname?: string | null; + referat?: string | null; + project_sponsor?: string | null; + project_sponsor_fullname?: string | null; + work_unit?: string | null; + recipient?: string | null; + municipal_code?: string | null; + municipality?: string | null; + place?: string | null; + state?: string | null; + country?: string | null; + implementing_agency?: string | null; + topic?: string | null; + performance_plan_system?: string | null; + performance_plan_system_text?: string | null; + funding_start?: string | null; + funding_end?: string | null; + grant_amount?: number | null; + funding_profile?: string | null; + joint_project?: string | null; + funding_type?: string | null; + publication_date?: string | null; + unix_timestamp?: number | null; + date?: string | null; + 'new'?: boolean | null; + duration?: string | null; +} + diff --git a/webapp/src/app/api/model/bundProjectPage.ts b/webapp/src/app/api/model/bundProjectPage.ts new file mode 100644 index 00000000..fc378141 --- /dev/null +++ b/webapp/src/app/api/model/bundProjectPage.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { BundProject } from './bundProject'; + + +export interface BundProjectPage { + /** + * The bund projects on this page. + */ + elements?: Array; + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of bund projects. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/categoryNested.ts b/webapp/src/app/api/model/categoryNested.ts new file mode 100644 index 00000000..8815022d --- /dev/null +++ b/webapp/src/app/api/model/categoryNested.ts @@ -0,0 +1,26 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DisplayCodeSplittedNested } from './displayCodeSplittedNested'; + + +export interface CategoryNested { + category?: string | null; + code?: string | null; + display_code?: string | null; + /** + * A tokenized hierarchy breakdown of the display code represented as an array of strings. + */ + display_code_splitted?: Array; + /** + * Granular, nested breakdowns of the split parts of the display code. + */ + display_code_splitted_nested?: Array; +} + diff --git a/webapp/src/app/api/model/collaboration-network-edge.ts b/webapp/src/app/api/model/collaboration-network-edge.ts deleted file mode 100644 index baffb178..00000000 --- a/webapp/src/app/api/model/collaboration-network-edge.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; -} diff --git a/webapp/src/app/api/model/collaboration-network-node-type.ts b/webapp/src/app/api/model/collaboration-network-node-type.ts deleted file mode 100644 index 20d462bd..00000000 --- a/webapp/src/app/api/model/collaboration-network-node-type.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export const CollaborationNetworkNodeType = { - author: 'author', - institution: 'institution', - work: 'work', -} as const; -export type CollaborationNetworkNodeType = - (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/collaboration-network.ts b/webapp/src/app/api/model/collaboration-network.ts deleted file mode 100644 index c923277d..00000000 --- a/webapp/src/app/api/model/collaboration-network.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { FilterInformation } from './filter-information'; -import { WorkNetworkNode } from './work-network-node'; -import { CollaborationNetworkEdge } from './collaboration-network-edge'; -import { InstitutionNetworkNode } from './institution-network-node'; -import { AuthorNetworkNode } from './author-network-node'; - -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The work nodes in the collaboration network. - */ - work_nodes: Array; - /** - * The author nodes in the collaboration network. - */ - author_nodes: Array; - /** - * The institution nodes in the collaboration network. - */ - institution_nodes: Array; - /** - * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I - */ - collaboration_edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; -} diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaborationNetwork.ts index a2fbdc5b..e439c061 100644 --- a/webapp/src/app/api/model/collaborationNetwork.ts +++ b/webapp/src/app/api/model/collaborationNetwork.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -13,29 +13,31 @@ import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; import { InstitutionNetworkNode } from './institutionNetworkNode'; import { AuthorNetworkNode } from './authorNetworkNode'; -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The work nodes in the collaboration network. - */ - work_nodes: Array; - /** - * The author nodes in the collaboration network. - */ - author_nodes: Array; - /** - * The institution nodes in the collaboration network. - */ - institution_nodes: Array; - /** - * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I - */ - collaboration_edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; + +export interface CollaborationNetwork { + /** + * The raw person ID of the person whose collaboration network this is. + */ + raw_person_id: string; + /** + * The work nodes in the collaboration network. + */ + work_nodes: Array; + /** + * The author nodes in the collaboration network. + */ + author_nodes: Array; + /** + * The institution nodes in the collaboration network. + */ + institution_nodes: Array; + /** + * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I + */ + collaboration_edges: Array; + /** + * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. + */ + filter_information: FilterInformation; } + diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaborationNetworkEdge.ts index baffb178..16fb5fc6 100644 --- a/webapp/src/app/api/model/collaborationNetworkEdge.ts +++ b/webapp/src/app/api/model/collaborationNetworkEdge.ts @@ -1,20 +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. */ -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; + +export interface CollaborationNetworkEdge { + /** + * The raw ID of the source node. + */ + raw_source_id: string; + /** + * The raw ID of the target node. + */ + raw_target_id: string; } + diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts index 3e673f35..752e35b0 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -1,17 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work', + Author: 'author', + Institution: 'institution', + Work: 'work' } as const; -export type CollaborationNetworkNodeType = - (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; +export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; + diff --git a/webapp/src/app/api/model/cost-usd.ts b/webapp/src/app/api/model/cost-usd.ts deleted file mode 100644 index 494cb094..00000000 --- a/webapp/src/app/api/model/cost-usd.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Cost of this request in USD - */ -export interface CostUsd {} diff --git a/webapp/src/app/api/model/costUsd.ts b/webapp/src/app/api/model/costUsd.ts index 494cb094..c7bcbee8 100644 --- a/webapp/src/app/api/model/costUsd.ts +++ b/webapp/src/app/api/model/costUsd.ts @@ -1,14 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Cost of this request in USD */ -export interface CostUsd {} +export interface CostUsd { +} + diff --git a/webapp/src/app/api/model/custom-author.ts b/webapp/src/app/api/model/custom-author.ts deleted file mode 100644 index d4a837ad..00000000 --- a/webapp/src/app/api/model/custom-author.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { AuthorAffiliationsInner } from './author-affiliations-inner'; -import { AuthorParsedLongestName } from './author-parsed-longest-name'; -import { DehydratedInstitution } from './dehydrated-institution'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorIds } from './author-ids'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { WorkTopic } from './work-topic'; - -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; -} diff --git a/webapp/src/app/api/model/custom-authors-list-response.ts b/webapp/src/app/api/model/custom-authors-list-response.ts deleted file mode 100644 index 72cb2f9d..00000000 --- a/webapp/src/app/api/model/custom-authors-list-response.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Meta } from './meta'; -import { CustomAuthor } from './custom-author'; -import { Author } from './author'; -import { GroupByResult } from './group-by-result'; - -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; - placeholder?: CustomAuthor | null; -} diff --git a/webapp/src/app/api/model/customAuthor.ts b/webapp/src/app/api/model/customAuthor.ts index 58943756..1117cd53 100644 --- a/webapp/src/app/api/model/customAuthor.ts +++ b/webapp/src/app/api/model/customAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -15,23 +15,25 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; + +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; } + diff --git a/webapp/src/app/api/model/customAuthorsListResponse.ts b/webapp/src/app/api/model/customAuthorsListResponse.ts index d1017811..f6eac14b 100644 --- a/webapp/src/app/api/model/customAuthorsListResponse.ts +++ b/webapp/src/app/api/model/customAuthorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,9 +12,11 @@ import { CustomAuthor } from './customAuthor'; import { Author } from './author'; import { GroupByResult } from './groupByResult'; -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; - placeholder?: CustomAuthor | null; + +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; + placeholder?: CustomAuthor | null; } + diff --git a/webapp/src/app/api/model/dehydrated-author.ts b/webapp/src/app/api/model/dehydrated-author.ts deleted file mode 100644 index 350718ef..00000000 --- a/webapp/src/app/api/model/dehydrated-author.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts - */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; -} diff --git a/webapp/src/app/api/model/dehydrated-funder.ts b/webapp/src/app/api/model/dehydrated-funder.ts deleted file mode 100644 index c4231c13..00000000 --- a/webapp/src/app/api/model/dehydrated-funder.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts - */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; -} diff --git a/webapp/src/app/api/model/dehydrated-institution.ts b/webapp/src/app/api/model/dehydrated-institution.ts deleted file mode 100644 index 956fc03e..00000000 --- a/webapp/src/app/api/model/dehydrated-institution.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts - */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; -} diff --git a/webapp/src/app/api/model/dehydrated-source.ts b/webapp/src/app/api/model/dehydrated-source.ts deleted file mode 100644 index b672b5dd..00000000 --- a/webapp/src/app/api/model/dehydrated-source.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts - */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; -} diff --git a/webapp/src/app/api/model/dehydratedAuthor.ts b/webapp/src/app/api/model/dehydratedAuthor.ts index 350718ef..4d3817f1 100644 --- a/webapp/src/app/api/model/dehydratedAuthor.ts +++ b/webapp/src/app/api/model/dehydratedAuthor.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface DehydratedAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } + diff --git a/webapp/src/app/api/model/dehydratedFunder.ts b/webapp/src/app/api/model/dehydratedFunder.ts index c4231c13..b134bbb1 100644 --- a/webapp/src/app/api/model/dehydratedFunder.ts +++ b/webapp/src/app/api/model/dehydratedFunder.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface DehydratedFunder { + id?: string | null; + display_name?: string | null; + ror?: string | null; } + diff --git a/webapp/src/app/api/model/dehydratedInstitution.ts b/webapp/src/app/api/model/dehydratedInstitution.ts index 956fc03e..7b6c9824 100644 --- a/webapp/src/app/api/model/dehydratedInstitution.ts +++ b/webapp/src/app/api/model/dehydratedInstitution.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; +export interface DehydratedInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; } + diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydratedSource.ts index b672b5dd..ae714846 100644 --- a/webapp/src/app/api/model/dehydratedSource.ts +++ b/webapp/src/app/api/model/dehydratedSource.ts @@ -1,26 +1,28 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; +export interface DehydratedSource { + id?: string | null; + display_name?: string | null; + issn_l?: string | null; + issn?: Array | null; + is_oa?: boolean | null; + is_in_doaj?: boolean | null; + is_core?: boolean | null; + host_organization?: string | null; + host_organization_name?: string | null; + host_organization_lineage?: Array | null; + type?: string | null; } + diff --git a/webapp/src/app/api/model/auth-account.ts b/webapp/src/app/api/model/displayCodeSplittedNested.ts similarity index 69% rename from webapp/src/app/api/model/auth-account.ts rename to webapp/src/app/api/model/displayCodeSplittedNested.ts index 179a3e67..ea2743bf 100644 --- a/webapp/src/app/api/model/auth-account.ts +++ b/webapp/src/app/api/model/displayCodeSplittedNested.ts @@ -1,15 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AuthAccount { - i: number; - l: string; - o: number; + +export interface DisplayCodeSplittedNested { + single_display_code?: string | null; } + diff --git a/webapp/src/app/api/model/euProject.ts b/webapp/src/app/api/model/euProject.ts new file mode 100644 index 00000000..9303df6c --- /dev/null +++ b/webapp/src/app/api/model/euProject.ts @@ -0,0 +1,51 @@ +/** + * Innovation Search Engine 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 { ProgrammeNested } from './programmeNested'; +import { KeywordNested } from './keywordNested'; +import { OrganizationNested } from './organizationNested'; +import { CategoryNested } from './categoryNested'; + + +export interface EuProject { + acronym?: string | null; + /** + * Structured lists of classification categories and taxonomy mappings assigned to the project. + */ + categories_nested?: Array; + doc_number?: string | null; + doi?: string | null; + ec_max_contribution?: string | null; + end_date?: string | null; + funding_end?: string | null; + funding_start?: string | null; + id?: string | null; + keywords?: string | null; + /** + * Strictly tokenized and isolated keywords nested for targeted search engine aggregations. + */ + keywords_nested?: Array; + link?: string | null; + objective?: string | null; + /** + * The full roster of academic, public, or private organizations participating in the project consortium. + */ + organization_nested?: Array; + /** + * The nested historical line of EU funding frameworks and structural grants supporting this project. + */ + programme_nested?: Array; + source?: string | null; + start_date?: string | null; + status?: string | null; + teaser?: string | null; + title?: string | null; + total_cost?: string | null; +} + diff --git a/webapp/src/app/api/model/euProjectPage.ts b/webapp/src/app/api/model/euProjectPage.ts new file mode 100644 index 00000000..81440c37 --- /dev/null +++ b/webapp/src/app/api/model/euProjectPage.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { EuProject } from './euProject'; + + +export interface EuProjectPage { + /** + * The EU projects on this page. + */ + elements?: Array; + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of EU projects. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/filter-information.ts b/webapp/src/app/api/model/filter-information.ts deleted file mode 100644 index 47c0ca27..00000000 --- a/webapp/src/app/api/model/filter-information.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { InstitutionInformation } from './institution-information'; -import { WorkTopicInformation } from './work-topic-information'; - -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; -} diff --git a/webapp/src/app/api/model/filter-properties.ts b/webapp/src/app/api/model/filter-properties.ts deleted file mode 100644 index 6b901b2e..00000000 --- a/webapp/src/app/api/model/filter-properties.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { WorksFilterProperties } from './works-filter-properties'; -import { AuthorsFilterProperties } from './authors-filter-properties'; - -export interface FilterProperties { - /** - * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. - */ - filter_by?: string; - works_filter_properties: WorksFilterProperties | null; - authors_filter_properties: AuthorsFilterProperties | null; -} diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts index 1c4af66d..b2078376 100644 --- a/webapp/src/app/api/model/filterInformation.ts +++ b/webapp/src/app/api/model/filterInformation.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,21 +10,23 @@ import { InstitutionInformation } from './institutionInformation'; import { WorkTopicInformation } from './workTopicInformation'; -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; + +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; } + diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts index 7caac0b6..608acab4 100644 --- a/webapp/src/app/api/model/filterProperties.ts +++ b/webapp/src/app/api/model/filterProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,11 +10,13 @@ import { WorksFilterProperties } from './worksFilterProperties'; import { AuthorsFilterProperties } from './authorsFilterProperties'; -export interface FilterProperties { - /** - * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. - */ - filter_by?: string; - works_filter_properties: WorksFilterProperties | null; - authors_filter_properties: AuthorsFilterProperties | null; + +export interface FilterProperties { + /** + * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. + */ + filter_by?: string; + works_filter_properties: WorksFilterProperties | null; + authors_filter_properties: AuthorsFilterProperties | null; } + diff --git a/webapp/src/app/api/model/funder-by-author.ts b/webapp/src/app/api/model/funder-by-author.ts deleted file mode 100644 index 50dc9bb9..00000000 --- a/webapp/src/app/api/model/funder-by-author.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { 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 }; - publication_titles?: { [key: string]: string }; -} diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts index 4fde5d86..247e5629 100644 --- a/webapp/src/app/api/model/funderByAuthor.ts +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,17 @@ */ import { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition'; import { AuthorPositionCount } from './authorPositionCount'; +import { PublicationDetailByFunder } from './publicationDetailByFunder'; -export interface FunderByAuthor { - funder_id?: string | null; - funder_name?: string | null; - publication_count: number; - author_position_count: AuthorPositionCount; - publication_ids: PublicationIdsByAuthorPosition; - publication_urls?: { [key: string]: string }; - publication_titles?: { [key: string]: string }; + +export interface FunderByAuthor { + funder_id?: string | null; + funder_name?: string | null; + publication_count: number; + author_position_count: AuthorPositionCount; + publication_ids: PublicationIdsByAuthorPosition; + publication_urls?: { [key: string]: string; }; + publication_titles?: { [key: string]: string; }; + publication_details?: { [key: string]: PublicationDetailByFunder; }; } + diff --git a/webapp/src/app/api/model/funders-by-author-response.ts b/webapp/src/app/api/model/funders-by-author-response.ts deleted file mode 100644 index 44d0ffbc..00000000 --- a/webapp/src/app/api/model/funders-by-author-response.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { 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/fundersByAuthorResponse.ts b/webapp/src/app/api/model/fundersByAuthorResponse.ts index d6e0e02f..1286429e 100644 --- a/webapp/src/app/api/model/fundersByAuthorResponse.ts +++ b/webapp/src/app/api/model/fundersByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { FunderByAuthor } from './funderByAuthor'; -export interface FundersByAuthorResponse { - author_id: string; - author_name?: string | null; - funder_count: number; - funders: Array; + +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; } + diff --git a/webapp/src/app/api/model/fwci.ts b/webapp/src/app/api/model/fwci.ts index bd7eea69..0c0cf8de 100644 --- a/webapp/src/app/api/model/fwci.ts +++ b/webapp/src/app/api/model/fwci.ts @@ -1,14 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Field-weighted Citation Impact, calculated as citations received / citations expected. */ -export interface Fwci {} +export interface Fwci { +} + diff --git a/webapp/src/app/api/model/group-by-result.ts b/webapp/src/app/api/model/group-by-result.ts deleted file mode 100644 index 98580663..00000000 --- a/webapp/src/app/api/model/group-by-result.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * GroupByResult - */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; -} diff --git a/webapp/src/app/api/model/groupByResult.ts b/webapp/src/app/api/model/groupByResult.ts index 98580663..68c51855 100644 --- a/webapp/src/app/api/model/groupByResult.ts +++ b/webapp/src/app/api/model/groupByResult.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * GroupByResult */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; +export interface GroupByResult { + key?: string | null; + key_display_name?: string | null; + count?: number | null; } + diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/hTTPValidationError.ts index c8e65c3e..f624be37 100644 --- a/webapp/src/app/api/model/hTTPValidationError.ts +++ b/webapp/src/app/api/model/hTTPValidationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,6 +9,8 @@ */ import { ValidationError } from './validationError'; -export interface HTTPValidationError { - detail?: Array; + +export interface HTTPValidationError { + detail?: Array; } + diff --git a/webapp/src/app/api/model/http-validation-error.ts b/webapp/src/app/api/model/http-validation-error.ts deleted file mode 100644 index c7691bc7..00000000 --- a/webapp/src/app/api/model/http-validation-error.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { ValidationError } from './validation-error'; - -export interface HTTPValidationError { - detail?: Array; -} diff --git a/webapp/src/app/api/model/identity-grant.ts b/webapp/src/app/api/model/identity-grant.ts deleted file mode 100644 index 264feeb0..00000000 --- a/webapp/src/app/api/model/identity-grant.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { AuthScope } from './auth-scope'; - -export interface IdentityGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; -} diff --git a/webapp/src/app/api/model/identityGrant.ts b/webapp/src/app/api/model/identityGrant.ts index 4bf172b8..9ec3fe50 100644 --- a/webapp/src/app/api/model/identityGrant.ts +++ b/webapp/src/app/api/model/identityGrant.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { AuthScope } from './authScope'; -export interface IdentityGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; + +export interface IdentityGrant { + token_type: string; + access_token: string; + expires_in: number; + scope: AuthScope; } + diff --git a/webapp/src/app/api/model/institution-geo.ts b/webapp/src/app/api/model/institution-geo.ts deleted file mode 100644 index b438d37c..00000000 --- a/webapp/src/app/api/model/institution-geo.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Latitude } from './latitude'; -import { Longitude } from './longitude'; - -/** - * Location information: - */ -export interface InstitutionGeo { - city?: string | null; - geonames_city_id?: string | null; - region?: string | null; - country_code?: string | null; - country?: string | null; - latitude?: Latitude | null; - longitude?: Longitude | null; -} diff --git a/webapp/src/app/api/model/institution-ids.ts b/webapp/src/app/api/model/institution-ids.ts deleted file mode 100644 index fd952098..00000000 --- a/webapp/src/app/api/model/institution-ids.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * External identifiers: - */ -export interface InstitutionIds { - openalex?: string | null; - ror?: string | null; - mag?: number | null; - grid?: string | null; - wikipedia?: string | null; - wikidata?: string | null; -} diff --git a/webapp/src/app/api/model/institution-information.ts b/webapp/src/app/api/model/institution-information.ts deleted file mode 100644 index 9e12986d..00000000 --- a/webapp/src/app/api/model/institution-information.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; -} diff --git a/webapp/src/app/api/model/institution-network-node.ts b/webapp/src/app/api/model/institution-network-node.ts deleted file mode 100644 index 981be8cf..00000000 --- a/webapp/src/app/api/model/institution-network-node.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { CollaborationNetworkNodeType } from './collaboration-network-node-type'; - -export interface InstitutionNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; -} -export namespace InstitutionNetworkNode {} diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts index 8a86878a..6b1a5778 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -1,39 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { InstitutionIds } from './institution-ids'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { InstitutionGeo } from './institution-geo'; +import { InstitutionIds } from './institutionIds'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { InstitutionGeo } from './institutionGeo'; + /** * A university, research organization, or other affiliation */ -export interface Institution { - id?: string | null; - ror?: string | null; - display_name?: string | null; - country_code?: string | null; - type?: string | null; - homepage_url?: string | null; - image_url?: string | null; - image_thumbnail_url?: string | null; - display_name_acronyms?: Array | null; - display_name_alternatives?: Array | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - geo?: InstitutionGeo | null; - lineage?: Array | null; - ids?: InstitutionIds | null; - counts_by_year?: Array | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/institutionGeo.ts b/webapp/src/app/api/model/institutionGeo.ts index b438d37c..949b73f4 100644 --- a/webapp/src/app/api/model/institutionGeo.ts +++ b/webapp/src/app/api/model/institutionGeo.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,15 +10,17 @@ import { Latitude } from './latitude'; import { Longitude } from './longitude'; + /** * Location information: */ -export interface InstitutionGeo { - city?: string | null; - geonames_city_id?: string | null; - region?: string | null; - country_code?: string | null; - country?: string | null; - latitude?: Latitude | null; - longitude?: Longitude | null; +export interface InstitutionGeo { + city?: string | null; + geonames_city_id?: string | null; + region?: string | null; + country_code?: string | null; + country?: string | null; + latitude?: Latitude | null; + longitude?: Longitude | null; } + diff --git a/webapp/src/app/api/model/institutionIds.ts b/webapp/src/app/api/model/institutionIds.ts index fd952098..93d801e1 100644 --- a/webapp/src/app/api/model/institutionIds.ts +++ b/webapp/src/app/api/model/institutionIds.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: */ -export interface InstitutionIds { - openalex?: string | null; - ror?: string | null; - mag?: number | null; - grid?: string | null; - wikipedia?: string | null; - wikidata?: string | null; +export interface InstitutionIds { + openalex?: string | null; + ror?: string | null; + mag?: number | null; + grid?: string | null; + wikipedia?: string | null; + wikidata?: string | null; } + diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts index 9e12986d..e287b0fa 100644 --- a/webapp/src/app/api/model/institutionInformation.ts +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -1,20 +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. */ -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; + +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; } + diff --git a/webapp/src/app/api/model/institutionNetworkNode.ts b/webapp/src/app/api/model/institutionNetworkNode.ts index 791645b7..a558a8cf 100644 --- a/webapp/src/app/api/model/institutionNetworkNode.ts +++ b/webapp/src/app/api/model/institutionNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,22 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface InstitutionNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; + +export interface InstitutionNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace InstitutionNetworkNode {} +export namespace InstitutionNetworkNode { +} + + diff --git a/webapp/src/app/api/model/institutions-list-response.ts b/webapp/src/app/api/model/institutions-list-response.ts deleted file mode 100644 index 15487606..00000000 --- a/webapp/src/app/api/model/institutions-list-response.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Meta } from './meta'; -import { Institution } from './institution'; -import { GroupByResult } from './group-by-result'; - -/** - * InstitutionsListResponse - */ -export interface InstitutionsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} diff --git a/webapp/src/app/api/model/institutionsListResponse.ts b/webapp/src/app/api/model/institutionsListResponse.ts index 0ac2c185..908d72fe 100644 --- a/webapp/src/app/api/model/institutionsListResponse.ts +++ b/webapp/src/app/api/model/institutionsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Institution } from './institution'; import { GroupByResult } from './groupByResult'; + /** * InstitutionsListResponse */ -export interface InstitutionsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface InstitutionsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/item-create.ts b/webapp/src/app/api/model/item-create.ts deleted file mode 100644 index 36920a12..00000000 --- a/webapp/src/app/api/model/item-create.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface ItemCreate { - /** - * The name of the item. - */ - name: string; - /** - * The description of the item. - */ - description: string; -} diff --git a/webapp/src/app/api/model/item-page.ts b/webapp/src/app/api/model/item-page.ts deleted file mode 100644 index 53a7140a..00000000 --- a/webapp/src/app/api/model/item-page.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Item } from './item'; - -export interface ItemPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page offset in elements. - */ - offset?: number; - /** - * The total number of elements. - */ - total?: number; - /** - * The page size in elements. - */ - size?: number; -} diff --git a/webapp/src/app/api/model/item.ts b/webapp/src/app/api/model/item.ts index 377f3a81..cc33194a 100644 --- a/webapp/src/app/api/model/item.ts +++ b/webapp/src/app/api/model/item.ts @@ -1,24 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Item { - /** - * The id of the entity. - */ - id: number; - /** - * The name of the item. - */ - name: string; - /** - * The description of the item. - */ - description: string; + +export interface Item { + /** + * The id of the entity. + */ + id: number; + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; } + diff --git a/webapp/src/app/api/model/itemCreate.ts b/webapp/src/app/api/model/itemCreate.ts index 36920a12..608d6910 100644 --- a/webapp/src/app/api/model/itemCreate.ts +++ b/webapp/src/app/api/model/itemCreate.ts @@ -1,20 +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. */ -export interface ItemCreate { - /** - * The name of the item. - */ - name: string; - /** - * The description of the item. - */ - description: string; + +export interface ItemCreate { + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; } + diff --git a/webapp/src/app/api/model/itemPage.ts b/webapp/src/app/api/model/itemPage.ts index 53a7140a..56595b8a 100644 --- a/webapp/src/app/api/model/itemPage.ts +++ b/webapp/src/app/api/model/itemPage.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,21 +9,23 @@ */ import { Item } from './item'; -export interface ItemPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page offset in elements. - */ - offset?: number; - /** - * The total number of elements. - */ - total?: number; - /** - * The page size in elements. - */ - size?: number; + +export interface ItemPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page offset in elements. + */ + offset?: number; + /** + * The total number of elements. + */ + total?: number; + /** + * The page size in elements. + */ + size?: number; } + diff --git a/webapp/src/app/api/model/model2-yr-mean-citedness.ts b/webapp/src/app/api/model/keywordNested.ts similarity index 74% rename from webapp/src/app/api/model/model2-yr-mean-citedness.ts rename to webapp/src/app/api/model/keywordNested.ts index d9c3d9df..52b088e8 100644 --- a/webapp/src/app/api/model/model2-yr-mean-citedness.ts +++ b/webapp/src/app/api/model/keywordNested.ts @@ -1,11 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Model2YrMeanCitedness {} + +export interface KeywordNested { + keyword?: string | null; +} + diff --git a/webapp/src/app/api/model/latitude.ts b/webapp/src/app/api/model/latitude.ts index 8fb58a9b..fe6b49aa 100644 --- a/webapp/src/app/api/model/latitude.ts +++ b/webapp/src/app/api/model/latitude.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Latitude {} + +export interface Latitude { +} + diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index ba587ef2..f207d751 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -1,25 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedSource } from './dehydrated-source'; +import { DehydratedSource } from './dehydratedSource'; + /** * Where a work is hosted */ -export interface Location { - is_oa?: boolean | null; - landing_page_url?: string | null; - pdf_url?: string | null; - source?: DehydratedSource | null; - license?: string | null; - license_id?: string | null; - version?: string | null; - is_accepted?: boolean | null; - is_published?: boolean | null; +export interface Location { + is_oa?: boolean | null; + landing_page_url?: string | null; + pdf_url?: string | null; + source?: DehydratedSource | null; + license?: string | null; + license_id?: string | null; + version?: string | null; + is_accepted?: boolean | null; + is_published?: boolean | null; } + diff --git a/webapp/src/app/api/model/longitude.ts b/webapp/src/app/api/model/longitude.ts index d222a6ff..b0d39fce 100644 --- a/webapp/src/app/api/model/longitude.ts +++ b/webapp/src/app/api/model/longitude.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Longitude {} + +export interface Longitude { +} + diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index 0457bafa..8481062a 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -1,23 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { CostUsd } from './cost-usd'; +import { CostUsd } from './costUsd'; + /** * Metadata about the query results */ -export interface Meta { - count?: number | null; - db_response_time_ms?: number | null; - page?: number | null; - per_page?: number | null; - next_cursor?: string | null; - groups_count?: number | null; - cost_usd?: CostUsd | null; +export interface Meta { + count?: number | null; + db_response_time_ms?: number | null; + page?: number | null; + per_page?: number | null; + next_cursor?: string | null; + groups_count?: number | null; + cost_usd?: CostUsd | null; } + diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2YrMeanCitedness.ts index d9c3d9df..67ec623c 100644 --- a/webapp/src/app/api/model/model2YrMeanCitedness.ts +++ b/webapp/src/app/api/model/model2YrMeanCitedness.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Model2YrMeanCitedness {} + +export interface Model2YrMeanCitedness { +} + diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index cd44ec17..7e188d4c 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -1,86 +1,96 @@ -export * from './access-grant'; -export * from './auth-account'; -export * from './auth-scope'; +export * from './accessGrant'; +export * from './authAccount'; +export * from './authScope'; export * from './author'; -export * from './author-affiliations-inner'; -export * from './author-counts-by-year-inner'; -export * from './author-ids'; -export * from './author-network-node'; -export * from './author-parsed-longest-name'; -export * from './author-position-count'; -export * from './author-summary-stats'; -export * from './authors-filter-properties'; -export * from './authors-list-response'; +export * from './authorAffiliationsInner'; +export * from './authorCountsByYearInner'; +export * from './authorIds'; +export * from './authorNetworkNode'; +export * from './authorParsedLongestName'; +export * from './authorPositionCount'; +export * from './authorSummaryStats'; +export * from './authorsFilterProperties'; +export * from './authorsListResponse'; export * from './authorship'; -export * from './autocomplete-response'; -export * from './autocomplete-response-meta'; -export * from './autocomplete-response-results-inner'; +export * from './autocompleteResponse'; +export * from './autocompleteResponseMeta'; +export * from './autocompleteResponseResultsInner'; export * from './award'; -export * from './collaboration-network'; -export * from './collaboration-network-edge'; -export * from './collaboration-network-node-type'; -export * from './cost-usd'; -export * from './custom-author'; -export * from './custom-authors-list-response'; -export * from './dehydrated-author'; -export * from './dehydrated-funder'; -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 './bundProject'; +export * from './bundProjectPage'; +export * from './categoryNested'; +export * from './collaborationNetwork'; +export * from './collaborationNetworkEdge'; +export * from './collaborationNetworkNodeType'; +export * from './costUsd'; +export * from './customAuthor'; +export * from './customAuthorsListResponse'; +export * from './dehydratedAuthor'; +export * from './dehydratedFunder'; +export * from './dehydratedInstitution'; +export * from './dehydratedSource'; +export * from './displayCodeSplittedNested'; +export * from './euProject'; +export * from './euProjectPage'; +export * from './filterInformation'; +export * from './filterProperties'; +export * from './funderByAuthor'; +export * from './fundersByAuthorResponse'; export * from './fwci'; -export * from './group-by-result'; -export * from './http-validation-error'; -export * from './identity-grant'; +export * from './groupByResult'; +export * from './hTTPValidationError'; +export * from './identityGrant'; export * from './institution'; -export * from './institution-geo'; -export * from './institution-ids'; -export * from './institution-information'; -export * from './institution-network-node'; -export * from './institutions-list-response'; +export * from './institutionGeo'; +export * from './institutionIds'; +export * from './institutionInformation'; +export * from './institutionNetworkNode'; +export * from './institutionsListResponse'; export * from './item'; -export * from './item-create'; -export * from './item-page'; +export * from './itemCreate'; +export * from './itemPage'; +export * from './keywordNested'; export * from './latitude'; export * from './location'; export * from './longitude'; 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 './model2YrMeanCitedness'; +export * from './openAccess'; +export * from './organizationNested'; +export * from './personBio'; +export * from './programmeNested'; +export * from './publicationDetailByFunder'; +export * from './publicationIdsByAuthorPosition'; +export * from './publicationsByAuthorResponse'; export * from './score'; export * from './topic'; -export * from './topic-count'; -export * from './topic-domain'; -export * from './topic-field'; -export * from './topic-ids'; -export * from './topic-subfield'; -export * from './topics-by-time'; -export * from './topics-by-year'; -export * from './topics-list-response'; -export * from './validation-error'; -export * from './validation-error-loc-inner'; +export * from './topicCount'; +export * from './topicDomain'; +export * from './topicField'; +export * from './topicIds'; +export * from './topicSubfield'; +export * from './topicsByTime'; +export * from './topicsByYear'; +export * from './topicsListResponse'; +export * from './validationError'; +export * from './validationErrorLocInner'; export * from './value'; export * from './work'; -export * from './work-biblio'; -export * from './work-citation-normalized-percentile'; -export * from './work-cited-by-percentile-year'; -export * from './work-counts-by-year-inner'; -export * from './work-has-content'; -export * from './work-ids'; -export * from './work-keyword'; -export * from './work-mesh-inner'; -export * from './work-network-node'; -export * from './work-page'; -export * from './work-sustainable-development-goals-inner'; -export * from './work-topic'; -export * from './work-topic-domain'; -export * from './work-topic-field'; -export * from './work-topic-information'; -export * from './work-topic-subfield'; -export * from './works-filter-properties'; -export * from './works-list-response'; +export * from './workBiblio'; +export * from './workCitationNormalizedPercentile'; +export * from './workCitedByPercentileYear'; +export * from './workCountsByYearInner'; +export * from './workHasContent'; +export * from './workIds'; +export * from './workKeyword'; +export * from './workMeshInner'; +export * from './workNetworkNode'; +export * from './workPage'; +export * from './workSustainableDevelopmentGoalsInner'; +export * from './workTopic'; +export * from './workTopicDomain'; +export * from './workTopicField'; +export * from './workTopicInformation'; +export * from './workTopicSubfield'; +export * from './worksFilterProperties'; +export * from './worksListResponse'; diff --git a/webapp/src/app/api/model/open-access.ts b/webapp/src/app/api/model/open-access.ts deleted file mode 100644 index 40d7b1d0..00000000 --- a/webapp/src/app/api/model/open-access.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Open access information - */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; -} diff --git a/webapp/src/app/api/model/openAccess.ts b/webapp/src/app/api/model/openAccess.ts index 40d7b1d0..32a4ddd9 100644 --- a/webapp/src/app/api/model/openAccess.ts +++ b/webapp/src/app/api/model/openAccess.ts @@ -1,19 +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. */ + /** * Open access information */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; +export interface OpenAccess { + is_oa?: boolean | null; + oa_status?: string | null; + oa_url?: string | null; + any_repository_has_fulltext?: boolean | null; } + diff --git a/webapp/src/app/api/model/organizationNested.ts b/webapp/src/app/api/model/organizationNested.ts new file mode 100644 index 00000000..fdfed27e --- /dev/null +++ b/webapp/src/app/api/model/organizationNested.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface OrganizationNested { + ec_contribution?: string | null; + id?: string | null; + name?: string | null; + net_ec_contribution?: string | null; + total_cost?: string | null; + organization_type?: string | null; +} + diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/personBio.ts index b060c9a9..f7291e6f 100644 --- a/webapp/src/app/api/model/personBio.ts +++ b/webapp/src/app/api/model/personBio.ts @@ -1,16 +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 PersonBio { - /** - * The generated biography. - */ - bio: string; + +export interface PersonBio { + /** + * The generated biography. + */ + bio: string; } + diff --git a/webapp/src/app/api/model/person-bio.ts b/webapp/src/app/api/model/programmeNested.ts similarity index 63% rename from webapp/src/app/api/model/person-bio.ts rename to webapp/src/app/api/model/programmeNested.ts index b060c9a9..f13b7312 100644 --- a/webapp/src/app/api/model/person-bio.ts +++ b/webapp/src/app/api/model/programmeNested.ts @@ -1,16 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PersonBio { - /** - * The generated biography. - */ - bio: string; + +export interface ProgrammeNested { + code?: string | null; + id?: string | null; + programme?: string | null; } + 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 deleted file mode 100644 index d549f8ed..00000000 --- a/webapp/src/app/api/model/publication-ids-by-author-position.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface PublicationIdsByAuthorPosition { - first?: Array; - middle?: Array; - last?: Array; - unknown?: Array; -} diff --git a/webapp/src/app/api/model/publicationDetailByFunder.ts b/webapp/src/app/api/model/publicationDetailByFunder.ts new file mode 100644 index 00000000..123ded7e --- /dev/null +++ b/webapp/src/app/api/model/publicationDetailByFunder.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. + */ + + +export interface PublicationDetailByFunder { + id: string; + title: string; + 'abstract'?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: string | null; + authors?: Array; + funder_names?: Array; + institutions?: Array; + countries?: Array; + topics?: Array; + keywords?: Array; + grant_labels?: Array; + counts_by_year?: Array; +} + diff --git a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts index d549f8ed..c35050ef 100644 --- a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts +++ b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts @@ -1,16 +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; + +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 deleted file mode 100644 index 35333880..00000000 --- a/webapp/src/app/api/model/publications-by-author-response.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -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/publicationsByAuthorResponse.ts b/webapp/src/app/api/model/publicationsByAuthorResponse.ts index 35333880..5176fe39 100644 --- a/webapp/src/app/api/model/publicationsByAuthorResponse.ts +++ b/webapp/src/app/api/model/publicationsByAuthorResponse.ts @@ -1,19 +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; + +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/score.ts b/webapp/src/app/api/model/score.ts index 5b0b5935..fac39735 100644 --- a/webapp/src/app/api/model/score.ts +++ b/webapp/src/app/api/model/score.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Score {} + +export interface Score { +} + diff --git a/webapp/src/app/api/model/topic-count.ts b/webapp/src/app/api/model/topic-count.ts deleted file mode 100644 index 559242d9..00000000 --- a/webapp/src/app/api/model/topic-count.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; -} diff --git a/webapp/src/app/api/model/topic-domain.ts b/webapp/src/app/api/model/topic-domain.ts deleted file mode 100644 index 573bef0d..00000000 --- a/webapp/src/app/api/model/topic-domain.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The domain (highest level) containing this topic: - */ -export interface TopicDomain { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/topic-field.ts b/webapp/src/app/api/model/topic-field.ts deleted file mode 100644 index cd7d08c8..00000000 --- a/webapp/src/app/api/model/topic-field.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The field (second level) containing this topic: - */ -export interface TopicField { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/topic-ids.ts b/webapp/src/app/api/model/topic-ids.ts deleted file mode 100644 index 22ca3343..00000000 --- a/webapp/src/app/api/model/topic-ids.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * External identifiers: - */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; -} diff --git a/webapp/src/app/api/model/topic-subfield.ts b/webapp/src/app/api/model/topic-subfield.ts deleted file mode 100644 index 79f3c9c7..00000000 --- a/webapp/src/app/api/model/topic-subfield.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The subfield (third level) containing this topic: - */ -export interface TopicSubfield { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/topic.ts b/webapp/src/app/api/model/topic.ts index 36f66189..9fc0ee63 100644 --- a/webapp/src/app/api/model/topic.ts +++ b/webapp/src/app/api/model/topic.ts @@ -1,32 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicDomain } from './topic-domain'; -import { TopicIds } from './topic-ids'; -import { TopicSubfield } from './topic-subfield'; -import { TopicField } from './topic-field'; +import { TopicDomain } from './topicDomain'; +import { TopicIds } from './topicIds'; +import { TopicSubfield } from './topicSubfield'; +import { TopicField } from './topicField'; + /** * A research topic automatically assigned to works */ -export interface Topic { - id?: string | null; - display_name?: string | null; - description?: string | null; - keywords?: Array | null; - subfield?: TopicSubfield | null; - field?: TopicField | null; - domain?: TopicDomain | null; - works_count?: number | null; - cited_by_count?: number | null; - ids?: TopicIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Topic { + id?: string | null; + display_name?: string | null; + description?: string | null; + keywords?: Array | null; + subfield?: TopicSubfield | null; + field?: TopicField | null; + domain?: TopicDomain | null; + works_count?: number | null; + cited_by_count?: number | null; + ids?: TopicIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts index 559242d9..520042ec 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topicCount.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; + +export interface TopicCount { + id?: string | null; + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; + description?: string | null; } + diff --git a/webapp/src/app/api/model/topicDomain.ts b/webapp/src/app/api/model/topicDomain.ts index 573bef0d..652b1bca 100644 --- a/webapp/src/app/api/model/topicDomain.ts +++ b/webapp/src/app/api/model/topicDomain.ts @@ -1,17 +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. */ + /** * The domain (highest level) containing this topic: */ -export interface TopicDomain { - id?: string | null; - display_name?: string | null; +export interface TopicDomain { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topicField.ts b/webapp/src/app/api/model/topicField.ts index cd7d08c8..c7351675 100644 --- a/webapp/src/app/api/model/topicField.ts +++ b/webapp/src/app/api/model/topicField.ts @@ -1,17 +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. */ + /** * The field (second level) containing this topic: */ -export interface TopicField { - id?: string | null; - display_name?: string | null; +export interface TopicField { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topicIds.ts b/webapp/src/app/api/model/topicIds.ts index 22ca3343..4aa6738f 100644 --- a/webapp/src/app/api/model/topicIds.ts +++ b/webapp/src/app/api/model/topicIds.ts @@ -1,17 +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. */ + /** * External identifiers: */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; +export interface TopicIds { + openalex?: string | null; + wikipedia?: string | null; } + diff --git a/webapp/src/app/api/model/topicSubfield.ts b/webapp/src/app/api/model/topicSubfield.ts index 79f3c9c7..53d37842 100644 --- a/webapp/src/app/api/model/topicSubfield.ts +++ b/webapp/src/app/api/model/topicSubfield.ts @@ -1,17 +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. */ + /** * The subfield (third level) containing this topic: */ -export interface TopicSubfield { - id?: string | null; - display_name?: string | null; +export interface TopicSubfield { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topics-by-time.ts b/webapp/src/app/api/model/topics-by-time.ts deleted file mode 100644 index 377ac395..00000000 --- a/webapp/src/app/api/model/topics-by-time.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { TopicsByYear } from './topicsByYear'; - -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; - /** - * True if the timeline contains only a limited subset of the author's publications. - */ - is_limited?: boolean; - /** - * The number of publications used to build the timeline. - */ - used_publications?: number; - /** - * The total number of publications found for this author. - */ - total_publications?: number; -} diff --git a/webapp/src/app/api/model/topics-by-year.ts b/webapp/src/app/api/model/topics-by-year.ts deleted file mode 100644 index 8aaafbf6..00000000 --- a/webapp/src/app/api/model/topics-by-year.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { TopicCount } from './topic-count'; - -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; -} diff --git a/webapp/src/app/api/model/topics-list-response.ts b/webapp/src/app/api/model/topics-list-response.ts deleted file mode 100644 index 54285ca1..00000000 --- a/webapp/src/app/api/model/topics-list-response.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Meta } from './meta'; -import { GroupByResult } from './group-by-result'; -import { Topic } from './topic'; - -/** - * TopicsListResponse - */ -export interface TopicsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 3242d9fc..8af7c9bb 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -1,33 +1,35 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicsByYear } from './topics-by-year'; +import { TopicsByYear } from './topicsByYear'; -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; - /** - * True if the timeline contains only a limited subset of the author's publications. - */ - is_limited?: boolean; - /** - * The number of publications used to build the timeline. - */ - used_publications?: number; - /** - * The total number of publications found for this author. - */ - total_publications?: number; + +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; + /** + * True if the timeline contains only a limited subset of the author\'s publications. + */ + is_limited?: boolean; + /** + * The number of publications used to build the timeline. + */ + used_publications?: number; + /** + * The total number of publications found for this author. + */ + total_publications?: number; } + diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts index bb2f1820..fded8da0 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { TopicCount } from './topicCount'; -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; + +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; } + diff --git a/webapp/src/app/api/model/topicsListResponse.ts b/webapp/src/app/api/model/topicsListResponse.ts index 058b45fd..43f21226 100644 --- a/webapp/src/app/api/model/topicsListResponse.ts +++ b/webapp/src/app/api/model/topicsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { GroupByResult } from './groupByResult'; import { Topic } from './topic'; + /** * TopicsListResponse */ -export interface TopicsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface TopicsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/validation-error-loc-inner.ts b/webapp/src/app/api/model/validation-error-loc-inner.ts deleted file mode 100644 index 3c1ffa29..00000000 --- a/webapp/src/app/api/model/validation-error-loc-inner.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface ValidationErrorLocInner {} diff --git a/webapp/src/app/api/model/validation-error.ts b/webapp/src/app/api/model/validation-error.ts deleted file mode 100644 index 87fed83b..00000000 --- a/webapp/src/app/api/model/validation-error.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { ValidationErrorLocInner } from './validation-error-loc-inner'; - -export interface ValidationError { - loc: Array; - msg: string; - type: string; -} diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validationError.ts index 18cd1b61..bdbd57ad 100644 --- a/webapp/src/app/api/model/validationError.ts +++ b/webapp/src/app/api/model/validationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,10 @@ */ import { ValidationErrorLocInner } from './validationErrorLocInner'; -export interface ValidationError { - loc: Array; - msg: string; - type: string; + +export interface ValidationError { + loc: Array; + msg: string; + type: string; } + diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validationErrorLocInner.ts index 3c1ffa29..d248a9b7 100644 --- a/webapp/src/app/api/model/validationErrorLocInner.ts +++ b/webapp/src/app/api/model/validationErrorLocInner.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface ValidationErrorLocInner {} + +export interface ValidationErrorLocInner { +} + diff --git a/webapp/src/app/api/model/value.ts b/webapp/src/app/api/model/value.ts index 016b21cb..a9fc79ba 100644 --- a/webapp/src/app/api/model/value.ts +++ b/webapp/src/app/api/model/value.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Value {} + +export interface Value { +} + diff --git a/webapp/src/app/api/model/work-biblio.ts b/webapp/src/app/api/model/work-biblio.ts deleted file mode 100644 index 65c0a34b..00000000 --- a/webapp/src/app/api/model/work-biblio.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. - */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; -} diff --git a/webapp/src/app/api/model/work-citation-normalized-percentile.ts b/webapp/src/app/api/model/work-citation-normalized-percentile.ts deleted file mode 100644 index 4a2bc6d4..00000000 --- a/webapp/src/app/api/model/work-citation-normalized-percentile.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Value } from './value'; - -/** - * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. - */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; -} diff --git a/webapp/src/app/api/model/work-cited-by-percentile-year.ts b/webapp/src/app/api/model/work-cited-by-percentile-year.ts deleted file mode 100644 index 7bcd3c85..00000000 --- a/webapp/src/app/api/model/work-cited-by-percentile-year.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Percentile rank compared to other works published in the same year. Contains `min` and `max`. - */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; -} diff --git a/webapp/src/app/api/model/work-counts-by-year-inner.ts b/webapp/src/app/api/model/work-counts-by-year-inner.ts deleted file mode 100644 index 496a11db..00000000 --- a/webapp/src/app/api/model/work-counts-by-year-inner.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * WorkCountsByYearInner - */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; -} diff --git a/webapp/src/app/api/model/work-has-content.ts b/webapp/src/app/api/model/work-has-content.ts deleted file mode 100644 index 76871238..00000000 --- a/webapp/src/app/api/model/work-has-content.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Information about downloadable full-text content: - */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; -} diff --git a/webapp/src/app/api/model/work-ids.ts b/webapp/src/app/api/model/work-ids.ts deleted file mode 100644 index fe562e40..00000000 --- a/webapp/src/app/api/model/work-ids.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. - */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; -} diff --git a/webapp/src/app/api/model/work-keyword.ts b/webapp/src/app/api/model/work-keyword.ts deleted file mode 100644 index 7270db25..00000000 --- a/webapp/src/app/api/model/work-keyword.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Score } from './score'; - -/** - * WorkKeyword - */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; -} diff --git a/webapp/src/app/api/model/work-mesh-inner.ts b/webapp/src/app/api/model/work-mesh-inner.ts deleted file mode 100644 index 36a0c569..00000000 --- a/webapp/src/app/api/model/work-mesh-inner.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * WorkMeshInner - */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; -} diff --git a/webapp/src/app/api/model/work-network-node.ts b/webapp/src/app/api/model/work-network-node.ts deleted file mode 100644 index 0bedef21..00000000 --- a/webapp/src/app/api/model/work-network-node.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { WorkTopicInformation } from './work-topic-information'; -import { CollaborationNetworkNodeType } from './collaboration-network-node-type'; - -export interface WorkNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; - publication_year: number | null; - work_topics_information: Set | null; -} -export namespace WorkNetworkNode {} diff --git a/webapp/src/app/api/model/work-page.ts b/webapp/src/app/api/model/work-page.ts deleted file mode 100644 index 285d2065..00000000 --- a/webapp/src/app/api/model/work-page.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Work } from './work'; - -export interface WorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; -} diff --git a/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts b/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts deleted file mode 100644 index 8bc67292..00000000 --- a/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Score } from './score'; - -/** - * WorkSustainableDevelopmentGoalsInner - */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; -} diff --git a/webapp/src/app/api/model/work-topic-domain.ts b/webapp/src/app/api/model/work-topic-domain.ts deleted file mode 100644 index 13b227df..00000000 --- a/webapp/src/app/api/model/work-topic-domain.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The parent [domain](/api-reference/domains) - */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/work-topic-field.ts b/webapp/src/app/api/model/work-topic-field.ts deleted file mode 100644 index 432b993e..00000000 --- a/webapp/src/app/api/model/work-topic-field.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The parent [field](/api-reference/fields) - */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/work-topic-information.ts b/webapp/src/app/api/model/work-topic-information.ts deleted file mode 100644 index 5dbbfc78..00000000 --- a/webapp/src/app/api/model/work-topic-information.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; -} diff --git a/webapp/src/app/api/model/work-topic-subfield.ts b/webapp/src/app/api/model/work-topic-subfield.ts deleted file mode 100644 index 49c1155b..00000000 --- a/webapp/src/app/api/model/work-topic-subfield.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * The parent [subfield](/api-reference/subfields) - */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; -} diff --git a/webapp/src/app/api/model/work-topic.ts b/webapp/src/app/api/model/work-topic.ts deleted file mode 100644 index 73bb7ad9..00000000 --- a/webapp/src/app/api/model/work-topic.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Score } from './score'; -import { WorkTopicDomain } from './work-topic-domain'; -import { WorkTopicSubfield } from './work-topic-subfield'; -import { WorkTopicField } from './work-topic-field'; - -/** - * WorkTopic - */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; -} diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index 746cc648..07d94a1c 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -1,69 +1,71 @@ /** * Innovation Search Engine 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 { DehydratedFunder } from './dehydrated-funder'; +import { DehydratedFunder } from './dehydratedFunder'; import { Authorship } from './authorship'; -import { OpenAccess } from './open-access'; -import { WorkIds } from './work-ids'; -import { WorkSustainableDevelopmentGoalsInner } from './work-sustainable-development-goals-inner'; -import { WorkTopic } from './work-topic'; -import { WorkCountsByYearInner } from './work-counts-by-year-inner'; -import { WorkKeyword } from './work-keyword'; -import { WorkCitationNormalizedPercentile } from './work-citation-normalized-percentile'; +import { OpenAccess } from './openAccess'; +import { WorkIds } from './workIds'; +import { WorkSustainableDevelopmentGoalsInner } from './workSustainableDevelopmentGoalsInner'; +import { WorkTopic } from './workTopic'; +import { WorkCountsByYearInner } from './workCountsByYearInner'; +import { WorkKeyword } from './workKeyword'; +import { WorkCitationNormalizedPercentile } from './workCitationNormalizedPercentile'; import { Award } from './award'; import { Fwci } from './fwci'; -import { WorkMeshInner } from './work-mesh-inner'; -import { WorkCitedByPercentileYear } from './work-cited-by-percentile-year'; -import { WorkHasContent } from './work-has-content'; +import { WorkMeshInner } from './workMeshInner'; +import { WorkCitedByPercentileYear } from './workCitedByPercentileYear'; +import { WorkHasContent } from './workHasContent'; import { Location } from './location'; -import { WorkBiblio } from './work-biblio'; +import { WorkBiblio } from './workBiblio'; + /** * A scholarly document (article, book, dataset, thesis, etc.) */ -export interface Work { - id?: string | null; - doi?: string | null; - title?: string | null; - display_name?: string | null; - publication_year?: number | null; - publication_date?: string | null; - type?: string | null; - language?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - is_paratext?: boolean | null; - primary_location?: Location | null; - locations?: Array | null; - best_oa_location?: Location | null; - open_access?: OpenAccess | null; - authorships?: Array | null; - ids?: WorkIds | null; - biblio?: WorkBiblio | null; - abstract_inverted_index?: object | null; - referenced_works?: Array | null; - referenced_works_count?: number | null; - related_works?: Array | null; - topics?: Array | null; - primary_topic?: WorkTopic | null; - keywords?: Array | null; - funders?: Array | null; - awards?: Array | null; - fwci?: Fwci | null; - citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; - cited_by_percentile_year?: WorkCitedByPercentileYear | null; - counts_by_year?: Array | null; - sustainable_development_goals?: Array | null; - mesh?: Array | null; - indexed_in?: Array | null; - has_content?: WorkHasContent | null; - content_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Work { + id?: string | null; + doi?: string | null; + title?: string | null; + display_name?: string | null; + publication_year?: number | null; + publication_date?: string | null; + type?: string | null; + language?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + is_paratext?: boolean | null; + primary_location?: Location | null; + locations?: Array | null; + best_oa_location?: Location | null; + open_access?: OpenAccess | null; + authorships?: Array | null; + ids?: WorkIds | null; + biblio?: WorkBiblio | null; + abstract_inverted_index?: object | null; + referenced_works?: Array | null; + referenced_works_count?: number | null; + related_works?: Array | null; + topics?: Array | null; + primary_topic?: WorkTopic | null; + keywords?: Array | null; + funders?: Array | null; + awards?: Array | null; + fwci?: Fwci | null; + citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; + cited_by_percentile_year?: WorkCitedByPercentileYear | null; + counts_by_year?: Array | null; + sustainable_development_goals?: Array | null; + mesh?: Array | null; + indexed_in?: Array | null; + has_content?: WorkHasContent | null; + content_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/workBiblio.ts b/webapp/src/app/api/model/workBiblio.ts index 65c0a34b..f6d7079b 100644 --- a/webapp/src/app/api/model/workBiblio.ts +++ b/webapp/src/app/api/model/workBiblio.ts @@ -1,19 +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. */ + /** * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; +export interface WorkBiblio { + volume?: string | null; + issue?: string | null; + first_page?: string | null; + last_page?: string | null; } + diff --git a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts index 4a2bc6d4..a587ddf6 100644 --- a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts +++ b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Value } from './value'; + /** * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; +export interface WorkCitationNormalizedPercentile { + value?: Value | null; + is_in_top_1_percent?: boolean | null; + is_in_top_10_percent?: boolean | null; } + diff --git a/webapp/src/app/api/model/workCitedByPercentileYear.ts b/webapp/src/app/api/model/workCitedByPercentileYear.ts index 7bcd3c85..5257eb3b 100644 --- a/webapp/src/app/api/model/workCitedByPercentileYear.ts +++ b/webapp/src/app/api/model/workCitedByPercentileYear.ts @@ -1,17 +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. */ + /** * Percentile rank compared to other works published in the same year. Contains `min` and `max`. */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; +export interface WorkCitedByPercentileYear { + min?: number | null; + max?: number | null; } + diff --git a/webapp/src/app/api/model/workCountsByYearInner.ts b/webapp/src/app/api/model/workCountsByYearInner.ts index 496a11db..76d97d77 100644 --- a/webapp/src/app/api/model/workCountsByYearInner.ts +++ b/webapp/src/app/api/model/workCountsByYearInner.ts @@ -1,17 +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. */ + /** * WorkCountsByYearInner */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; +export interface WorkCountsByYearInner { + year?: number | null; + cited_by_count?: number | null; } + diff --git a/webapp/src/app/api/model/workHasContent.ts b/webapp/src/app/api/model/workHasContent.ts index 76871238..44fbe446 100644 --- a/webapp/src/app/api/model/workHasContent.ts +++ b/webapp/src/app/api/model/workHasContent.ts @@ -1,17 +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. */ + /** * Information about downloadable full-text content: */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; +export interface WorkHasContent { + pdf?: boolean | null; + grobid_xml?: boolean | null; } + diff --git a/webapp/src/app/api/model/workIds.ts b/webapp/src/app/api/model/workIds.ts index fe562e40..e8315250 100644 --- a/webapp/src/app/api/model/workIds.ts +++ b/webapp/src/app/api/model/workIds.ts @@ -1,20 +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. */ + /** * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; +export interface WorkIds { + openalex?: string | null; + doi?: string | null; + mag?: number | null; + pmid?: string | null; + pmcid?: string | null; } + diff --git a/webapp/src/app/api/model/workKeyword.ts b/webapp/src/app/api/model/workKeyword.ts index 7270db25..c9c99afb 100644 --- a/webapp/src/app/api/model/workKeyword.ts +++ b/webapp/src/app/api/model/workKeyword.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Score } from './score'; + /** * WorkKeyword */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkKeyword { + id?: string | null; + display_name?: string | null; + score?: Score | null; } + diff --git a/webapp/src/app/api/model/workMeshInner.ts b/webapp/src/app/api/model/workMeshInner.ts index 36a0c569..40633524 100644 --- a/webapp/src/app/api/model/workMeshInner.ts +++ b/webapp/src/app/api/model/workMeshInner.ts @@ -1,20 +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. */ + /** * WorkMeshInner */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; +export interface WorkMeshInner { + descriptor_ui?: string | null; + descriptor_name?: string | null; + qualifier_ui?: string | null; + qualifier_name?: string | null; + is_major_topic?: boolean | null; } + diff --git a/webapp/src/app/api/model/workNetworkNode.ts b/webapp/src/app/api/model/workNetworkNode.ts index 445cd8ad..abc04a69 100644 --- a/webapp/src/app/api/model/workNetworkNode.ts +++ b/webapp/src/app/api/model/workNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,20 +10,24 @@ import { WorkTopicInformation } from './workTopicInformation'; import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface WorkNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; - publication_year: number | null; - work_topics_information: Set | null; + +export interface WorkNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; + publication_year: number | null; + work_topics_information: Set | null; } -export namespace WorkNetworkNode {} +export namespace WorkNetworkNode { +} + + diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts index 285d2065..8490c3ab 100644 --- a/webapp/src/app/api/model/workPage.ts +++ b/webapp/src/app/api/model/workPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,25 +9,27 @@ */ import { Work } from './work'; -export interface WorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; + +export interface WorkPage { + /** + * Total number of works matching the query + */ + total: number; + /** + * List of works on the current page + */ + elements: Array; + /** + * Offset of the current page + */ + offset: number; + /** + * Size of the current page + */ + size: number; + /** + * Indicates if the current page is the last page + */ + last_page: boolean; } + diff --git a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts index 8bc67292..c9ecd00f 100644 --- a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts +++ b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Score } from './score'; + /** * WorkSustainableDevelopmentGoalsInner */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkSustainableDevelopmentGoalsInner { + id?: string | null; + display_name?: string | null; + score?: Score | null; } + diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts index 4b326824..925ead4f 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/workTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,14 +12,16 @@ import { WorkTopicDomain } from './workTopicDomain'; import { WorkTopicSubfield } from './workTopicSubfield'; import { WorkTopicField } from './workTopicField'; + /** * WorkTopic */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; +export interface WorkTopic { + id?: string | null; + display_name?: string | null; + score?: Score | null; + subfield?: WorkTopicSubfield | null; + field?: WorkTopicField | null; + domain?: WorkTopicDomain | null; } + diff --git a/webapp/src/app/api/model/workTopicDomain.ts b/webapp/src/app/api/model/workTopicDomain.ts index 13b227df..1a9879d4 100644 --- a/webapp/src/app/api/model/workTopicDomain.ts +++ b/webapp/src/app/api/model/workTopicDomain.ts @@ -1,17 +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. */ + /** * The parent [domain](/api-reference/domains) */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; +export interface WorkTopicDomain { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/workTopicField.ts b/webapp/src/app/api/model/workTopicField.ts index 432b993e..1807cfc1 100644 --- a/webapp/src/app/api/model/workTopicField.ts +++ b/webapp/src/app/api/model/workTopicField.ts @@ -1,17 +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. */ + /** * The parent [field](/api-reference/fields) */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; +export interface WorkTopicField { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts index 5dbbfc78..ca3b9454 100644 --- a/webapp/src/app/api/model/workTopicInformation.ts +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -1,20 +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. */ -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; + +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; } + diff --git a/webapp/src/app/api/model/workTopicSubfield.ts b/webapp/src/app/api/model/workTopicSubfield.ts index 49c1155b..b6e7278a 100644 --- a/webapp/src/app/api/model/workTopicSubfield.ts +++ b/webapp/src/app/api/model/workTopicSubfield.ts @@ -1,17 +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. */ + /** * The parent [subfield](/api-reference/subfields) */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; +export interface WorkTopicSubfield { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/works-filter-properties.ts b/webapp/src/app/api/model/works-filter-properties.ts deleted file mode 100644 index fd25fd26..00000000 --- a/webapp/src/app/api/model/works-filter-properties.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface WorksFilterProperties { - /** - * The start publication year for the works to include in the collaboration network. - */ - start_year?: number; - /** - * The end publication year for the works to include in the collaboration network. - */ - end_year?: number; - /** - * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. - */ - allowed_topics?: Array; - /** - * The minimum number of contributors required for a work to be included in the collaboration network. - */ - min_contributors?: number; - /** - * The maximum number of contributors allowed for a work to be included in the collaboration network. - */ - max_contributors?: number; -} diff --git a/webapp/src/app/api/model/works-list-response.ts b/webapp/src/app/api/model/works-list-response.ts deleted file mode 100644 index 6c711607..00000000 --- a/webapp/src/app/api/model/works-list-response.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Meta } from './meta'; -import { Work } from './work'; -import { GroupByResult } from './group-by-result'; - -/** - * WorksListResponse - */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} diff --git a/webapp/src/app/api/model/worksFilterProperties.ts b/webapp/src/app/api/model/worksFilterProperties.ts index fd25fd26..bd6cc9a4 100644 --- a/webapp/src/app/api/model/worksFilterProperties.ts +++ b/webapp/src/app/api/model/worksFilterProperties.ts @@ -1,32 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface WorksFilterProperties { - /** - * The start publication year for the works to include in the collaboration network. - */ - start_year?: number; - /** - * The end publication year for the works to include in the collaboration network. - */ - end_year?: number; - /** - * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. - */ - allowed_topics?: Array; - /** - * The minimum number of contributors required for a work to be included in the collaboration network. - */ - min_contributors?: number; - /** - * The maximum number of contributors allowed for a work to be included in the collaboration network. - */ - max_contributors?: number; + +export interface WorksFilterProperties { + /** + * The start publication year for the works to include in the collaboration network. + */ + start_year?: number; + /** + * The end publication year for the works to include in the collaboration network. + */ + end_year?: number; + /** + * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. + */ + allowed_topics?: Array; + /** + * The minimum number of contributors required for a work to be included in the collaboration network. + */ + min_contributors?: number; + /** + * The maximum number of contributors allowed for a work to be included in the collaboration network. + */ + max_contributors?: number; } + diff --git a/webapp/src/app/api/model/worksListResponse.ts b/webapp/src/app/api/model/worksListResponse.ts index bc21a41b..a65d3849 100644 --- a/webapp/src/app/api/model/worksListResponse.ts +++ b/webapp/src/app/api/model/worksListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Work } from './work'; import { GroupByResult } from './groupByResult'; + /** * WorksListResponse */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface WorksListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts index 486c804e..78a2d20a 100644 --- a/webapp/src/app/api/param.ts +++ b/webapp/src/app/api/param.ts @@ -8,7 +8,8 @@ export type StandardParamStyle = | 'simple' | 'spaceDelimited' | 'pipeDelimited' - | 'deepObject'; + | 'deepObject' + ; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -24,12 +25,13 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | 'integer' - | 'number' - | 'boolean' - | 'string' - | 'object' - | 'array'; + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; /** * Standard {@link DataType}s plus your own types/classes. @@ -40,15 +42,16 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | 'int32' - | 'int64' - | 'float' - | 'double' - | 'byte' - | 'binary' - | 'date' - | 'date-time' - | 'password'; + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; export type DataFormat = StandardDataFormat | string; @@ -59,7 +62,7 @@ export interface Param { name: string; value: unknown; in: ParamLocation; - style: ParamStyle; + style: ParamStyle, explode: boolean; dataType: DataType; dataFormat: DataFormat | undefined; diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts index 960132f8..19c762ac 100644 --- a/webapp/src/app/api/provide-api.ts +++ b/webapp/src/app/api/provide-api.ts @@ -1,17 +1,15 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; import { Configuration, ConfigurationParameters } from './configuration'; import { BASE_PATH } from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi( - configOrBasePath: string | ConfigurationParameters, -): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === 'string' - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts index 2277a9cc..6fe58549 100644 --- a/webapp/src/app/api/variables.ts +++ b/webapp/src/app/api/variables.ts @@ -2,8 +2,8 @@ import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { - csv: ',', - tsv: ' ', - ssv: ' ', - pipes: '|', -}; + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 23a85220..558480d3 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -2,6 +2,9 @@ import { Routes } from '@angular/router'; import { userGuard } from './shared/guards/user.guard'; import { collaborationNetworkResolver } from './resolvers/collaboration-network.resolver'; import { personListResolver } from './resolvers/person-list.resolver'; +import { institutionResolver } from './resolvers/institution.resolver'; +import { bundProjectsResolver } from './resolvers/bund-projects.resolver'; +import { euProjectsResolver } from './resolvers/eu-projects.resolver'; export const routes: Routes = [ { @@ -93,7 +96,7 @@ export const routes: Routes = [ resolve: { collaborationNetwork: collaborationNetworkResolver, }, - runGuardsAndResolvers: (to, from) => { + runGuardsAndResolvers: (from, to) => { // No need to re-run for different table view or search term const keys = [ 'filter_by', @@ -108,7 +111,7 @@ export const routes: Routes = [ ]; return keys.some( - (key) => to.queryParamMap.get(key) !== from.queryParamMap.get(key), + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), ); }, }, @@ -129,12 +132,24 @@ export const routes: Routes = [ ], }, { - path: 'institution/:id', + path: 'institution/:institutionId', canActivate: [userGuard], loadComponent: () => import('./modules/institution/institution.component').then( (mod) => mod.InstitutionComponent, ), + resolve: { + institution: institutionResolver, + bundProjectPage: bundProjectsResolver, + euProjectPage: euProjectsResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, }, { path: '**', diff --git a/webapp/src/app/directives/debounce.directive.ts b/webapp/src/app/directives/debounce.directive.ts new file mode 100644 index 00000000..15b56c1a --- /dev/null +++ b/webapp/src/app/directives/debounce.directive.ts @@ -0,0 +1,30 @@ +import { Directive, input, model, numberAttribute } from '@angular/core'; + +@Directive({ + selector: 'input[debounceTime]', + host: { + '[value]': 'debouncedValue()', + '(input)': 'handleInput($event)', + }, +}) +export class DebounceDirective { + #debounceTimer?: ReturnType; + + readonly debounceTime = input(0, { transform: numberAttribute }); + readonly debouncedValue = model(''); + + handleInput(event: Event): void { + const value = (event.target as HTMLInputElement).value; + + clearTimeout(this.#debounceTimer); + + if (!value || !this.debounceTime()) { + this.debouncedValue.set(value); + return; + } + + this.#debounceTimer = setTimeout(() => { + this.debouncedValue.set(value); + }, this.debounceTime()); + } +} diff --git a/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.html b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.html new file mode 100644 index 00000000..c2f8fcfc --- /dev/null +++ b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
Thema + {{ element.topic }} + Förderbeginn + {{ element.funding_start | date: 'dd.MM.yyyy' }} + Förderende + {{ element.funding_end | date: 'dd.MM.yyyy' }} + Förderbeträge + {{ element.grant_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + Förderer + {{ element.department }} +
+@if (dataSource.filteredData.length === 0) { +

Keine Projekte gefunden.

+} diff --git a/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.scss b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.scss new file mode 100644 index 00000000..c6f1fc09 --- /dev/null +++ b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.scss @@ -0,0 +1,3 @@ +.mat-column-grant_amount { + text-align: right; +} \ No newline at end of file diff --git a/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.ts b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.ts new file mode 100644 index 00000000..f7724dd6 --- /dev/null +++ b/webapp/src/app/modules/institution-projects-bund/institution-projects-bund.component.ts @@ -0,0 +1,109 @@ +import { + AfterViewInit, + Component, + computed, + effect, + input, + ViewChild, +} from '@angular/core'; +import { BundProject, BundProjectPage } from '../../api'; +import { MatTableDataSource, MatTableModule } from '@angular/material/table'; +import { MatSort, MatSortModule, Sort } from '@angular/material/sort'; +import { CurrencyPipe, DatePipe } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; +import { toSignal } from '@angular/core/rxjs-interop'; + +type BundProjectRow = { + topic: string; + funding_start: Date; + funding_end: Date; + grant_amount: number; + department: string; +}; + +@Component({ + selector: 'app-institution-projects-bund', + imports: [MatTableModule, MatSortModule, CurrencyPipe, DatePipe], + templateUrl: './institution-projects-bund.component.html', + styleUrl: './institution-projects-bund.component.scss', +}) +export class InstitutionProjectsBundComponent implements AfterViewInit { + bundProjectPage = input.required(); + + displayedColumns: string[] = [ + 'topic', + 'funding_start', + 'funding_end', + 'grant_amount', + 'department', + ]; + + dataSource = new MatTableDataSource(); + + trackBy = (index: number, item: BundProjectRow) => index; + + @ViewChild(MatSort) sort!: MatSort; + + readonly queryParams = toSignal(this.activatedRoute.queryParamMap, { + initialValue: null, + }); + + readonly sortBy = computed(() => { + return this.queryParams()?.get('sort_bys') ?? 'topic'; + }); + + readonly sortDirection = computed(() => { + return this.queryParams()?.get('sort_direction') ?? 'asc'; + }); + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) { + effect(() => { + const bundProjectPage = this.bundProjectPage(); + if (!bundProjectPage) { + return; + } + this.dataSource.data = + bundProjectPage.elements?.map(this.transformToRow.bind(this)) || []; + }); + effect(() => { + const sortBy = this.sortBy(); + const sortDirection = this.sortDirection(); + this.router.navigate([], { + queryParams: { page: 1, size: 10 }, + queryParamsHandling: 'merge', + }); + }); + } + + transformToRow(project: BundProject): BundProjectRow { + return { + topic: project.topic || '', + funding_start: project.funding_start + ? new Date(project.funding_start) + : new Date(0), + funding_end: project.funding_end + ? new Date(project.funding_end) + : new Date(0), + grant_amount: project.grant_amount || 0, + department: project.department_fullname || '', + }; + } + + ngAfterViewInit() { + this.dataSource.sort = this.sort; + } + + parseGermanNumber(value: string): number { + return Number(value.replaceAll('.', '').replace(',', '.')); + } + + handleSortChange(event: Sort): void { + this.router.navigate([], { + queryParams: { sort_by: event.active, sort_direction: event.direction }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.html b/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.html new file mode 100644 index 00000000..c567c125 --- /dev/null +++ b/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + +
Thema + {{ element.topic }} + Förderbeginn + {{ element.funding_start | date: 'dd.MM.yyyy' }} + Förderende + {{ element.funding_end | date: 'dd.MM.yyyy' }} + Förderbeträge + {{ element.grant_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} +
+@if (dataSource.filteredData.length === 0) { +

Keine Projekte gefunden.

+} diff --git a/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.scss b/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.ts b/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.ts new file mode 100644 index 00000000..dcef606d --- /dev/null +++ b/webapp/src/app/modules/institution-projects-eu/institution-projects-eu.component.ts @@ -0,0 +1,104 @@ +import { CurrencyPipe, DatePipe } from '@angular/common'; +import { + AfterViewInit, + Component, + computed, + effect, + input, + ViewChild, +} from '@angular/core'; +import { MatSort, MatSortModule, Sort } from '@angular/material/sort'; +import { MatTableDataSource, MatTableModule } from '@angular/material/table'; +import { ActivatedRoute, Router } from '@angular/router'; +import { EuProject, EuProjectPage } from '../../api'; +import { toSignal } from '@angular/core/rxjs-interop'; + +type EuProjectRow = { + topic: string; + funding_start: Date; + funding_end: Date; + grant_amount: number; +}; + +@Component({ + selector: 'app-institution-projects-eu', + imports: [MatTableModule, MatSortModule, CurrencyPipe, DatePipe], + templateUrl: './institution-projects-eu.component.html', + styleUrl: './institution-projects-eu.component.scss', +}) +export class InstitutionProjectsEuComponent implements AfterViewInit { + euProjectPage = input.required(); + + displayedColumns: string[] = [ + 'topic', + 'funding_start', + 'funding_end', + 'grant_amount', + ]; + + dataSource = new MatTableDataSource(); + + trackBy = (index: number, item: EuProjectRow) => index; + + @ViewChild(MatSort) sort!: MatSort; + + readonly queryParams = toSignal(this.activatedRoute.queryParamMap, { + initialValue: null, + }); + + readonly sortBy = computed(() => { + return this.queryParams()?.get('sort_bys') ?? 'topic'; + }); + + readonly sortDirection = computed(() => { + return this.queryParams()?.get('sort_direction') ?? 'asc'; + }); + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) { + effect(() => { + const euProjectPage = this.euProjectPage(); + if (!euProjectPage) { + return; + } + this.dataSource.data = + euProjectPage.elements?.map(this.transformToRow.bind(this)) || []; + }); + effect(() => { + const sortBy = this.sortBy(); + const sortDirection = this.sortDirection(); + this.router.navigate([], { + queryParams: { page: 1, size: 10 }, + queryParamsHandling: 'merge', + }); + }); + } + + transformToRow(project: EuProject): EuProjectRow { + return { + topic: project.title || '', + funding_start: project.start_date + ? new Date(project.start_date) + : new Date(0), + funding_end: project.end_date ? new Date(project.end_date) : new Date(0), + grant_amount: Number(project.total_cost) || 0, + }; + } + + ngAfterViewInit() { + this.dataSource.sort = this.sort; + } + + parseGermanNumber(value: string): number { + return Number(value.replaceAll('.', '').replace(',', '.')); + } + + handleSortChange(event: Sort): void { + this.router.navigate([], { + queryParams: { sort_by: event.active, sort_direction: event.direction }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/institution/institution.component.html b/webapp/src/app/modules/institution/institution.component.html index 06cbe4a2..00384cbc 100644 --- a/webapp/src/app/modules/institution/institution.component.html +++ b/webapp/src/app/modules/institution/institution.component.html @@ -1 +1,35 @@ -

institution works!

+
+

{{ institution.display_name }}

+ + Projekte + + + Suche nach Themen oder Förderern + + + + + + + + + + @if (!institution.country_code || institution.country_code === 'DE') { + + } + + + + +
diff --git a/webapp/src/app/modules/institution/institution.component.scss b/webapp/src/app/modules/institution/institution.component.scss index e69de29b..ae66a6b3 100644 --- a/webapp/src/app/modules/institution/institution.component.scss +++ b/webapp/src/app/modules/institution/institution.component.scss @@ -0,0 +1,3 @@ +.content { + padding: 16px; +} \ No newline at end of file diff --git a/webapp/src/app/modules/institution/institution.component.ts b/webapp/src/app/modules/institution/institution.component.ts index 2e11507e..7c732aa4 100644 --- a/webapp/src/app/modules/institution/institution.component.ts +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -1,9 +1,120 @@ -import { Component } from '@angular/core'; +import { Component, computed, effect, OnInit, signal } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { BundProjectPage, EuProjectPage, Institution } from '../../api'; +import { MatCardModule } from '@angular/material/card'; +import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs'; +import { InstitutionProjectsBundComponent } from '../institution-projects-bund/institution-projects-bund.component'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatIconModule } from '@angular/material/icon'; +import { DebounceDirective } from '../../directives/debounce.directive'; +import { InstitutionProjectsEuComponent } from '../institution-projects-eu/institution-projects-eu.component'; @Component({ selector: 'app-institution', - imports: [], + imports: [ + MatCardModule, + MatTabsModule, + InstitutionProjectsBundComponent, + MatPaginatorModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + DebounceDirective, + InstitutionProjectsEuComponent, + ], templateUrl: './institution.component.html', styleUrl: './institution.component.scss', }) -export class InstitutionComponent {} +export class InstitutionComponent implements OnInit { + institution!: Institution; + bundProjectPage!: BundProjectPage; + euProjectPage!: EuProjectPage; + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) {} + + readonly queryParams = toSignal(this.activatedRoute.queryParamMap, { + initialValue: null, + }); + + searchDebounceTime: number = 300; + searchTerm = signal(''); + + readonly displayedProjects = computed(() => { + return this.queryParams()?.get('project_tab') ?? 'eu'; + }); + + readonly page = computed(() => { + const pageParam = this.queryParams()?.get('page'); + const page = pageParam ? Number.parseInt(pageParam, 10) : 0; + return Number.isNaN(page) ? 0 : page; + }); + + readonly selectedPage = computed(() => { + if (this.displayedProjects() === 'eu') { + return this.euProjectPage; + } else { + return this.bundProjectPage; + } + }); + + readonly pageTotal = computed(() => { + return this.selectedPage()?.total ?? 0; + }); + + readonly pageSize = computed(() => { + return this.selectedPage()?.size ?? 10; + }); + + readonly pageIndex = computed(() => { + return this.selectedPage()?.page ?? 0; + }); + + ngOnInit(): void { + this.activatedRoute.data.subscribe( + ({ institution, bundProjectPage, euProjectPage }) => { + console.log('Resolved institution:', institution); + this.institution = institution; + this.bundProjectPage = bundProjectPage; + this.euProjectPage = euProjectPage; + }, + ); + } + + readonly tabIndex = computed(() => { + switch (this.displayedProjects()) { + case 'eu': + return 0; + case 'bund': + return 1; + case 'dfg': + return 2; + default: + return 0; + } + }); + + selectedTabChange(event: MatTabChangeEvent): void { + const tab = ['eu', 'bund', 'dfg'][event.index]; + this.router.navigate([], { + queryParams: { project_tab: tab }, + queryParamsHandling: 'merge', + }); + } + + handlePageChange(event: PageEvent): void { + this.router.navigate([], { + queryParams: { page: event.pageIndex, size: event.pageSize }, + queryParamsHandling: 'merge', + }); + } + + handleSearchTermChange(event: any): void { + this.searchTerm.set(event.target.value); + } +} diff --git a/webapp/src/app/resolvers/bund-projects.resolver.ts b/webapp/src/app/resolvers/bund-projects.resolver.ts new file mode 100644 index 00000000..a7e6e54c --- /dev/null +++ b/webapp/src/app/resolvers/bund-projects.resolver.ts @@ -0,0 +1,27 @@ +import { ResolveFn } from '@angular/router'; +import { BundProjectPage, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const bundProjectsResolver: ResolveFn = ( + route, + state, +) => { + console.log('bundProjectsResolver called with route:', route); + const page = route.queryParamMap.get('page') ?? '1'; + const size = route.queryParamMap.get('size') ?? '10'; + const institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + throw new Error('Institution ID is required to load projects'); + } + + const sortBy = route.queryParamMap.get('sort_by') ?? 'topic'; + const sortDirection = route.queryParamMap.get('sort_direction') ?? 'asc'; + + return inject(ProjectsService).getBundProjects( + institutionId, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; diff --git a/webapp/src/app/resolvers/eu-projects.resolver.ts b/webapp/src/app/resolvers/eu-projects.resolver.ts new file mode 100644 index 00000000..de175f78 --- /dev/null +++ b/webapp/src/app/resolvers/eu-projects.resolver.ts @@ -0,0 +1,23 @@ +import { ResolveFn } from '@angular/router'; +import { EuProjectPage, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const euProjectsResolver: ResolveFn = (route, state) => { + const page = route.queryParamMap.get('page') ?? '1'; + const size = route.queryParamMap.get('size') ?? '10'; + const institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + throw new Error('Institution ID is required to load projects'); + } + + const sortBy = route.queryParamMap.get('sort_by') ?? 'topic'; + const sortDirection = route.queryParamMap.get('sort_direction') ?? 'asc'; + + return inject(ProjectsService).getEuProjects( + institutionId, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; diff --git a/webapp/src/app/resolvers/institution.resolver.ts b/webapp/src/app/resolvers/institution.resolver.ts new file mode 100644 index 00000000..12fcdc10 --- /dev/null +++ b/webapp/src/app/resolvers/institution.resolver.ts @@ -0,0 +1,17 @@ +import { ResolveFn } from '@angular/router'; +import { Institution, InstitutionsService } from '../api'; +import { inject } from '@angular/core'; + +export const institutionResolver: ResolveFn = ( + route, + state, +) => { + const institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + throw new Error( + 'Institution ID is required to resolve institution details', + ); + } + + return inject(InstitutionsService).getInstitutionById(institutionId); +};