From 74cdc43e4a5a8fdcc05929b1c63ee9cc5670abb8 Mon Sep 17 00:00:00 2001 From: Jyrki Keisala Date: Thu, 16 May 2024 08:22:39 +0300 Subject: [PATCH] refactor(ui): Regenerate query client OpenAPI query client library update to v1 (PR #157) introduced major changes to the structure and functionality of the query client. Moreover, PR #181 introduced a fix to OpenAPI generation of nullable values, which brought major changes to the Swagger JSON. This commit regenerates the query client from scratch to adapt to these changes. The command used for regenerating is: pnpm codegen Signed-off-by: Jyrki Keisala --- ui/src/api/queries/common.ts | 169 + ui/src/api/queries/index.ts | 1719 +-------- ui/src/api/queries/prefetch.ts | 253 ++ ui/src/api/queries/queries.ts | 572 +++ ui/src/api/queries/suspense.ts | 253 ++ ui/src/api/requests/core/ApiError.ts | 5 +- ui/src/api/requests/core/ApiRequestOptions.ts | 13 +- ui/src/api/requests/core/ApiResult.ts | 9 +- ui/src/api/requests/core/CancelablePromise.ts | 81 +- ui/src/api/requests/core/OpenAPI.ts | 55 +- ui/src/api/requests/core/request.ts | 201 +- ui/src/api/requests/index.ts | 44 +- .../models/CreateInfrastructureService.ts | 12 - .../api/requests/models/CreateOrganization.ts | 8 - ui/src/api/requests/models/CreateOrtRun.ts | 141 - ui/src/api/requests/models/CreateProduct.ts | 8 - .../api/requests/models/CreateRepository.ts | 18 - ui/src/api/requests/models/CreateSecret.ts | 9 - .../requests/models/InfrastructureService.ts | 12 - ui/src/api/requests/models/Liveness.ts | 7 - ui/src/api/requests/models/Organization.ts | 9 - ui/src/api/requests/models/OrtRun.ts | 471 --- ui/src/api/requests/models/Product.ts | 9 - ui/src/api/requests/models/Repository.ts | 19 - ui/src/api/requests/models/Secret.ts | 8 - .../models/UpdateInfrastructureService.ts | 11 - .../api/requests/models/UpdateOrganization.ts | 8 - ui/src/api/requests/models/UpdateProduct.ts | 8 - .../api/requests/models/UpdateRepository.ts | 18 - ui/src/api/requests/models/UpdateSecret.ts | 9 - ...ver_api_v1_model_InfrastructureService_.ts | 20 - ...is_ortserver_api_v1_model_Organization_.ts | 17 - ...s_ortserver_api_v1_model_OrtRunSummary_.ts | 62 - ...poapsis_ortserver_api_v1_model_Product_.ts | 17 - ...psis_ortserver_api_v1_model_Repository_.ts | 17 - ...apoapsis_ortserver_api_v1_model_Secret_.ts | 16 - ui/src/api/requests/schemas.gen.ts | 3199 +++++++++++++++++ ui/src/api/requests/services.gen.ts | 1120 ++++++ ui/src/api/requests/services/HealthService.ts | 22 - .../services/InfrastructureServicesService.ts | 117 - ui/src/api/requests/services/LogsService.ts | 39 - .../requests/services/OrganizationsService.ts | 127 - .../api/requests/services/ProductsService.ts | 133 - .../api/requests/services/ReportsService.ts | 59 - .../requests/services/RepositoriesService.ts | 221 -- .../api/requests/services/SecretsService.ts | 397 -- ui/src/api/requests/types.gen.ts | 2489 +++++++++++++ 47 files changed, 8276 insertions(+), 3955 deletions(-) create mode 100644 ui/src/api/queries/common.ts create mode 100644 ui/src/api/queries/prefetch.ts create mode 100644 ui/src/api/queries/queries.ts create mode 100644 ui/src/api/queries/suspense.ts delete mode 100644 ui/src/api/requests/models/CreateInfrastructureService.ts delete mode 100644 ui/src/api/requests/models/CreateOrganization.ts delete mode 100644 ui/src/api/requests/models/CreateOrtRun.ts delete mode 100644 ui/src/api/requests/models/CreateProduct.ts delete mode 100644 ui/src/api/requests/models/CreateRepository.ts delete mode 100644 ui/src/api/requests/models/CreateSecret.ts delete mode 100644 ui/src/api/requests/models/InfrastructureService.ts delete mode 100644 ui/src/api/requests/models/Liveness.ts delete mode 100644 ui/src/api/requests/models/Organization.ts delete mode 100644 ui/src/api/requests/models/OrtRun.ts delete mode 100644 ui/src/api/requests/models/Product.ts delete mode 100644 ui/src/api/requests/models/Repository.ts delete mode 100644 ui/src/api/requests/models/Secret.ts delete mode 100644 ui/src/api/requests/models/UpdateInfrastructureService.ts delete mode 100644 ui/src/api/requests/models/UpdateOrganization.ts delete mode 100644 ui/src/api/requests/models/UpdateProduct.ts delete mode 100644 ui/src/api/requests/models/UpdateRepository.ts delete mode 100644 ui/src/api/requests/models/UpdateSecret.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_.ts delete mode 100644 ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_.ts create mode 100644 ui/src/api/requests/schemas.gen.ts create mode 100644 ui/src/api/requests/services.gen.ts delete mode 100644 ui/src/api/requests/services/HealthService.ts delete mode 100644 ui/src/api/requests/services/InfrastructureServicesService.ts delete mode 100644 ui/src/api/requests/services/LogsService.ts delete mode 100644 ui/src/api/requests/services/OrganizationsService.ts delete mode 100644 ui/src/api/requests/services/ProductsService.ts delete mode 100644 ui/src/api/requests/services/ReportsService.ts delete mode 100644 ui/src/api/requests/services/RepositoriesService.ts delete mode 100644 ui/src/api/requests/services/SecretsService.ts create mode 100644 ui/src/api/requests/types.gen.ts diff --git a/ui/src/api/queries/common.ts b/ui/src/api/queries/common.ts new file mode 100644 index 000000000..e8fde7907 --- /dev/null +++ b/ui/src/api/queries/common.ts @@ -0,0 +1,169 @@ +// generated with @7nohe/openapi-react-query-codegen@1.3.0 + +import { UseQueryResult } from "@tanstack/react-query"; +import { HealthService, InfrastructureServicesService, LogsService, OrganizationsService, ProductsService, ReportsService, RepositoriesService, SecretsService } from "../requests/services.gen"; +export type HealthServiceGetLivenessDefaultResponse = Awaited>; +export type HealthServiceGetLivenessQueryResult = UseQueryResult; +export const useHealthServiceGetLivenessKey = "HealthServiceGetLiveness"; +export const UseHealthServiceGetLivenessKeyFn = () => [useHealthServiceGetLivenessKey]; +export type ReportsServiceGetReportByRunIdAndTokenDefaultResponse = Awaited>; +export type ReportsServiceGetReportByRunIdAndTokenQueryResult = UseQueryResult; +export const useReportsServiceGetReportByRunIdAndTokenKey = "ReportsServiceGetReportByRunIdAndToken"; +export const UseReportsServiceGetReportByRunIdAndTokenKeyFn = ({ runId, token }: { + runId?: number; + token?: string; +} = {}, queryKey?: Array) => [useReportsServiceGetReportByRunIdAndTokenKey, ...(queryKey ?? [{ runId, token }])]; +export type ReportsServiceGetReportByRunIdAndFileNameDefaultResponse = Awaited>; +export type ReportsServiceGetReportByRunIdAndFileNameQueryResult = UseQueryResult; +export const useReportsServiceGetReportByRunIdAndFileNameKey = "ReportsServiceGetReportByRunIdAndFileName"; +export const UseReportsServiceGetReportByRunIdAndFileNameKeyFn = ({ fileName, runId }: { + fileName?: string; + runId?: number; +} = {}, queryKey?: Array) => [useReportsServiceGetReportByRunIdAndFileNameKey, ...(queryKey ?? [{ fileName, runId }])]; +export type OrganizationsServiceGetOrganizationsDefaultResponse = Awaited>; +export type OrganizationsServiceGetOrganizationsQueryResult = UseQueryResult; +export const useOrganizationsServiceGetOrganizationsKey = "OrganizationsServiceGetOrganizations"; +export const UseOrganizationsServiceGetOrganizationsKeyFn = ({ limit, offset, sort }: { + limit?: number; + offset?: number; + sort?: string; +} = {}, queryKey?: Array) => [useOrganizationsServiceGetOrganizationsKey, ...(queryKey ?? [{ limit, offset, sort }])]; +export type OrganizationsServiceGetOrganizationByIdDefaultResponse = Awaited>; +export type OrganizationsServiceGetOrganizationByIdQueryResult = UseQueryResult; +export const useOrganizationsServiceGetOrganizationByIdKey = "OrganizationsServiceGetOrganizationById"; +export const UseOrganizationsServiceGetOrganizationByIdKeyFn = ({ organizationId }: { + organizationId?: number; +} = {}, queryKey?: Array) => [useOrganizationsServiceGetOrganizationByIdKey, ...(queryKey ?? [{ organizationId }])]; +export type ProductsServiceGetOrganizationProductsDefaultResponse = Awaited>; +export type ProductsServiceGetOrganizationProductsQueryResult = UseQueryResult; +export const useProductsServiceGetOrganizationProductsKey = "ProductsServiceGetOrganizationProducts"; +export const UseProductsServiceGetOrganizationProductsKeyFn = ({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useProductsServiceGetOrganizationProductsKey, ...(queryKey ?? [{ limit, offset, organizationId, sort }])]; +export type ProductsServiceGetProductByIdDefaultResponse = Awaited>; +export type ProductsServiceGetProductByIdQueryResult = UseQueryResult; +export const useProductsServiceGetProductByIdKey = "ProductsServiceGetProductById"; +export const UseProductsServiceGetProductByIdKeyFn = ({ productId }: { + productId?: number; +} = {}, queryKey?: Array) => [useProductsServiceGetProductByIdKey, ...(queryKey ?? [{ productId }])]; +export type SecretsServiceGetSecretsByOrganizationIdDefaultResponse = Awaited>; +export type SecretsServiceGetSecretsByOrganizationIdQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretsByOrganizationIdKey = "SecretsServiceGetSecretsByOrganizationId"; +export const UseSecretsServiceGetSecretsByOrganizationIdKeyFn = ({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretsByOrganizationIdKey, ...(queryKey ?? [{ limit, offset, organizationId, sort }])]; +export type SecretsServiceGetSecretByOrganizationIdAndNameDefaultResponse = Awaited>; +export type SecretsServiceGetSecretByOrganizationIdAndNameQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretByOrganizationIdAndNameKey = "SecretsServiceGetSecretByOrganizationIdAndName"; +export const UseSecretsServiceGetSecretByOrganizationIdAndNameKeyFn = ({ organizationId, secretName }: { + organizationId?: number; + secretName?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretByOrganizationIdAndNameKey, ...(queryKey ?? [{ organizationId, secretName }])]; +export type SecretsServiceGetSecretsByProductIdDefaultResponse = Awaited>; +export type SecretsServiceGetSecretsByProductIdQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretsByProductIdKey = "SecretsServiceGetSecretsByProductId"; +export const UseSecretsServiceGetSecretsByProductIdKeyFn = ({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretsByProductIdKey, ...(queryKey ?? [{ limit, offset, productId, sort }])]; +export type SecretsServiceGetSecretByProductIdAndNameDefaultResponse = Awaited>; +export type SecretsServiceGetSecretByProductIdAndNameQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretByProductIdAndNameKey = "SecretsServiceGetSecretByProductIdAndName"; +export const UseSecretsServiceGetSecretByProductIdAndNameKeyFn = ({ productId, secretName }: { + productId?: number; + secretName?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretByProductIdAndNameKey, ...(queryKey ?? [{ productId, secretName }])]; +export type SecretsServiceGetSecretsByRepositoryIdDefaultResponse = Awaited>; +export type SecretsServiceGetSecretsByRepositoryIdQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretsByRepositoryIdKey = "SecretsServiceGetSecretsByRepositoryId"; +export const UseSecretsServiceGetSecretsByRepositoryIdKeyFn = ({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretsByRepositoryIdKey, ...(queryKey ?? [{ limit, offset, repositoryId, sort }])]; +export type SecretsServiceGetSecretByRepositoryIdAndNameDefaultResponse = Awaited>; +export type SecretsServiceGetSecretByRepositoryIdAndNameQueryResult = UseQueryResult; +export const useSecretsServiceGetSecretByRepositoryIdAndNameKey = "SecretsServiceGetSecretByRepositoryIdAndName"; +export const UseSecretsServiceGetSecretByRepositoryIdAndNameKeyFn = ({ repositoryId, secretName }: { + repositoryId?: number; + secretName?: string; +} = {}, queryKey?: Array) => [useSecretsServiceGetSecretByRepositoryIdAndNameKey, ...(queryKey ?? [{ repositoryId, secretName }])]; +export type InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdDefaultResponse = Awaited>; +export type InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdQueryResult = UseQueryResult; +export const useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKey = "InfrastructureServicesServiceGetInfrastructureServicesByOrganizationId"; +export const UseInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKeyFn = ({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKey, ...(queryKey ?? [{ limit, offset, organizationId, sort }])]; +export type RepositoriesServiceGetRepositoriesByProductIdDefaultResponse = Awaited>; +export type RepositoriesServiceGetRepositoriesByProductIdQueryResult = UseQueryResult; +export const useRepositoriesServiceGetRepositoriesByProductIdKey = "RepositoriesServiceGetRepositoriesByProductId"; +export const UseRepositoriesServiceGetRepositoriesByProductIdKeyFn = ({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useRepositoriesServiceGetRepositoriesByProductIdKey, ...(queryKey ?? [{ limit, offset, productId, sort }])]; +export type RepositoriesServiceGetRepositoryByIdDefaultResponse = Awaited>; +export type RepositoriesServiceGetRepositoryByIdQueryResult = UseQueryResult; +export const useRepositoriesServiceGetRepositoryByIdKey = "RepositoriesServiceGetRepositoryById"; +export const UseRepositoriesServiceGetRepositoryByIdKeyFn = ({ repositoryId }: { + repositoryId?: number; +} = {}, queryKey?: Array) => [useRepositoriesServiceGetRepositoryByIdKey, ...(queryKey ?? [{ repositoryId }])]; +export type RepositoriesServiceGetOrtRunsDefaultResponse = Awaited>; +export type RepositoriesServiceGetOrtRunsQueryResult = UseQueryResult; +export const useRepositoriesServiceGetOrtRunsKey = "RepositoriesServiceGetOrtRuns"; +export const UseRepositoriesServiceGetOrtRunsKeyFn = ({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: Array) => [useRepositoriesServiceGetOrtRunsKey, ...(queryKey ?? [{ limit, offset, repositoryId, sort }])]; +export type RepositoriesServiceGetOrtRunByIndexDefaultResponse = Awaited>; +export type RepositoriesServiceGetOrtRunByIndexQueryResult = UseQueryResult; +export const useRepositoriesServiceGetOrtRunByIndexKey = "RepositoriesServiceGetOrtRunByIndex"; +export const UseRepositoriesServiceGetOrtRunByIndexKeyFn = ({ ortRunIndex, repositoryId }: { + ortRunIndex?: number; + repositoryId?: number; +} = {}, queryKey?: Array) => [useRepositoriesServiceGetOrtRunByIndexKey, ...(queryKey ?? [{ ortRunIndex, repositoryId }])]; +export type LogsServiceGetLogsByRunIdDefaultResponse = Awaited>; +export type LogsServiceGetLogsByRunIdQueryResult = UseQueryResult; +export const useLogsServiceGetLogsByRunIdKey = "LogsServiceGetLogsByRunId"; +export const UseLogsServiceGetLogsByRunIdKeyFn = ({ level, runId, steps }: { + level?: string; + runId?: number; + steps?: string; +} = {}, queryKey?: Array) => [useLogsServiceGetLogsByRunIdKey, ...(queryKey ?? [{ level, runId, steps }])]; +export type OrganizationsServicePostOrganizationsMutationResult = Awaited>; +export type ProductsServicePostProductMutationResult = Awaited>; +export type SecretsServicePostSecretForOrganizationMutationResult = Awaited>; +export type SecretsServicePostSecretForProductMutationResult = Awaited>; +export type SecretsServicePostSecretForRepositoryMutationResult = Awaited>; +export type InfrastructureServicesServicePostInfrastructureServiceForOrganizationMutationResult = Awaited>; +export type RepositoriesServiceCreateRepositoryMutationResult = Awaited>; +export type RepositoriesServicePostOrtRunMutationResult = Awaited>; +export type OrganizationsServicePatchOrganizationByIdMutationResult = Awaited>; +export type ProductsServicePatchProductByIdMutationResult = Awaited>; +export type SecretsServicePatchSecretByOrganizationIdAndNameMutationResult = Awaited>; +export type SecretsServicePatchSecretByProductIdIdAndNameMutationResult = Awaited>; +export type SecretsServicePatchSecretByRepositoryIdIdAndNameMutationResult = Awaited>; +export type InfrastructureServicesServicePatchInfrastructureServiceForOrganizationIdAndNameMutationResult = Awaited>; +export type RepositoriesServicePatchRepositoryByIdMutationResult = Awaited>; +export type OrganizationsServiceDeleteOrganizationByIdMutationResult = Awaited>; +export type ProductsServiceDeleteProductByIdMutationResult = Awaited>; +export type SecretsServiceDeleteSecretByOrganizationIdAndNameMutationResult = Awaited>; +export type SecretsServiceDeleteSecretByProductIdAndNameMutationResult = Awaited>; +export type SecretsServiceDeleteSecretByRepositoryIdAndNameMutationResult = Awaited>; +export type InfrastructureServicesServiceDeleteInfrastructureServiceForOrganizationIdAndNameMutationResult = Awaited>; +export type RepositoriesServiceDeleteRepositoryByIdMutationResult = Awaited>; diff --git a/ui/src/api/queries/index.ts b/ui/src/api/queries/index.ts index f4f260caf..efbdffc6f 100644 --- a/ui/src/api/queries/index.ts +++ b/ui/src/api/queries/index.ts @@ -1,1715 +1,4 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -// @ts-nocheck -// generated with @7nohe/openapi-react-query-codegen@0.5.3 -import { - useQuery, - useMutation, - UseQueryResult, - UseQueryOptions, - UseMutationOptions, - UseMutationResult, -} from '@tanstack/react-query'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_'; -import { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ } from '../requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_'; -import { UpdateSecret } from '../requests/models/UpdateSecret'; -import { UpdateRepository } from '../requests/models/UpdateRepository'; -import { UpdateProduct } from '../requests/models/UpdateProduct'; -import { UpdateOrganization } from '../requests/models/UpdateOrganization'; -import { UpdateInfrastructureService } from '../requests/models/UpdateInfrastructureService'; -import { Secret } from '../requests/models/Secret'; -import { Repository } from '../requests/models/Repository'; -import { Product } from '../requests/models/Product'; -import { OrtRun } from '../requests/models/OrtRun'; -import { Organization } from '../requests/models/Organization'; -import { Liveness } from '../requests/models/Liveness'; -import { InfrastructureService } from '../requests/models/InfrastructureService'; -import { CreateSecret } from '../requests/models/CreateSecret'; -import { CreateRepository } from '../requests/models/CreateRepository'; -import { CreateProduct } from '../requests/models/CreateProduct'; -import { CreateOrtRun } from '../requests/models/CreateOrtRun'; -import { CreateOrganization } from '../requests/models/CreateOrganization'; -import { CreateInfrastructureService } from '../requests/models/CreateInfrastructureService'; -import { SecretsService } from '../requests/services/SecretsService'; -import { RepositoriesService } from '../requests/services/RepositoriesService'; -import { ReportsService } from '../requests/services/ReportsService'; -import { ProductsService } from '../requests/services/ProductsService'; -import { OrganizationsService } from '../requests/services/OrganizationsService'; -import { LogsService } from '../requests/services/LogsService'; -import { InfrastructureServicesService } from '../requests/services/InfrastructureServicesService'; -import { HealthService } from '../requests/services/HealthService'; -export type SecretsServiceGetSecretsByOrganizationIdDefaultResponse = Awaited< - ReturnType ->; -export type SecretsServiceGetSecretsByOrganizationIdQueryResult< - TData = SecretsServiceGetSecretsByOrganizationIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretsByOrganizationIdKey = - 'SecretsServiceGetSecretsByOrganizationId'; -/** - * Get all secrets of an organization. - */ -export const useSecretsServiceGetSecretsByOrganizationId = < - TData = SecretsServiceGetSecretsByOrganizationIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - organizationId, - limit, - offset, - sort, - }: { - organizationId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretsByOrganizationIdKey, - ...(queryKey ?? [{ organizationId, limit, offset, sort }]), - ], - queryFn: () => - SecretsService.getSecretsByOrganizationId( - organizationId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type SecretsServicePostSecretForOrganizationMutationResult = Awaited< - ReturnType ->; -/** - * Create a secret for an organization. - */ -export const useSecretsServicePostSecretForOrganization = < - TData = SecretsServicePostSecretForOrganizationMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >({ - mutationFn: ({ requestBody }) => - SecretsService.postSecretForOrganization( - requestBody - ) as unknown as Promise, - ...options, - }); -export type SecretsServiceGetSecretByOrganizationIdAndNameDefaultResponse = - Awaited>; -export type SecretsServiceGetSecretByOrganizationIdAndNameQueryResult< - TData = SecretsServiceGetSecretByOrganizationIdAndNameDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretByOrganizationIdAndNameKey = - 'SecretsServiceGetSecretByOrganizationIdAndName'; -/** - * Get details of a secret of an organization. - */ -export const useSecretsServiceGetSecretByOrganizationIdAndName = < - TData = SecretsServiceGetSecretByOrganizationIdAndNameDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - organizationId, - secretName, - }: { - organizationId?: number; - secretName?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretByOrganizationIdAndNameKey, - ...(queryKey ?? [{ organizationId, secretName }]), - ], - queryFn: () => - SecretsService.getSecretByOrganizationIdAndName( - organizationId, - secretName - ) as TData, - ...options, - }); -export type SecretsServiceDeleteSecretByOrganizationIdAndNameMutationResult = - Awaited< - ReturnType - >; -/** - * Delete a secret from an organization. - */ -export const useSecretsServiceDeleteSecretByOrganizationIdAndName = < - TData = SecretsServiceDeleteSecretByOrganizationIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - secretName?: string; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - organizationId?: number; - secretName?: string; - }, - TContext - >({ - mutationFn: ({ organizationId, secretName }) => - SecretsService.deleteSecretByOrganizationIdAndName( - organizationId, - secretName - ) as unknown as Promise, - ...options, - }); -export type SecretsServicePatchSecretByOrganizationIdAndNameMutationResult = - Awaited>; -/** - * Update a secret of an organization. - */ -export const useSecretsServicePatchSecretByOrganizationIdAndName = < - TData = SecretsServicePatchSecretByOrganizationIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - organizationId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >({ - mutationFn: ({ organizationId, secretName, requestBody }) => - SecretsService.patchSecretByOrganizationIdAndName( - organizationId, - secretName, - requestBody - ) as unknown as Promise, - ...options, - }); -export type SecretsServiceGetSecretsByProductIdDefaultResponse = Awaited< - ReturnType ->; -export type SecretsServiceGetSecretsByProductIdQueryResult< - TData = SecretsServiceGetSecretsByProductIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretsByProductIdKey = - 'SecretsServiceGetSecretsByProductId'; -/** - * Get all secrets of a specific product. - */ -export const useSecretsServiceGetSecretsByProductId = < - TData = SecretsServiceGetSecretsByProductIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - productId, - limit, - offset, - sort, - }: { - productId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretsByProductIdKey, - ...(queryKey ?? [{ productId, limit, offset, sort }]), - ], - queryFn: () => - SecretsService.getSecretsByProductId( - productId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type SecretsServicePostSecretForProductMutationResult = Awaited< - ReturnType ->; -/** - * Create a secret for a product. - */ -export const useSecretsServicePostSecretForProduct = < - TData = SecretsServicePostSecretForProductMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >({ - mutationFn: ({ requestBody }) => - SecretsService.postSecretForProduct( - requestBody - ) as unknown as Promise, - ...options, - }); -export type SecretsServiceGetSecretByProductIdAndNameDefaultResponse = Awaited< - ReturnType ->; -export type SecretsServiceGetSecretByProductIdAndNameQueryResult< - TData = SecretsServiceGetSecretByProductIdAndNameDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretByProductIdAndNameKey = - 'SecretsServiceGetSecretByProductIdAndName'; -/** - * Get details of a secret of a product. - */ -export const useSecretsServiceGetSecretByProductIdAndName = < - TData = SecretsServiceGetSecretByProductIdAndNameDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - productId, - secretName, - }: { - productId?: number; - secretName?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretByProductIdAndNameKey, - ...(queryKey ?? [{ productId, secretName }]), - ], - queryFn: () => - SecretsService.getSecretByProductIdAndName( - productId, - secretName - ) as TData, - ...options, - }); -export type SecretsServiceDeleteSecretByProductIdAndNameMutationResult = - Awaited>; -/** - * Delete a secret from a product. - */ -export const useSecretsServiceDeleteSecretByProductIdAndName = < - TData = SecretsServiceDeleteSecretByProductIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - productId?: number; - secretName?: string; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - productId?: number; - secretName?: string; - }, - TContext - >({ - mutationFn: ({ productId, secretName }) => - SecretsService.deleteSecretByProductIdAndName( - productId, - secretName - ) as unknown as Promise, - ...options, - }); -export type SecretsServicePatchSecretByProductIdIdAndNameMutationResult = - Awaited>; -/** - * Update a secret of a product. - */ -export const useSecretsServicePatchSecretByProductIdIdAndName = < - TData = SecretsServicePatchSecretByProductIdIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - productId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - productId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >({ - mutationFn: ({ productId, secretName, requestBody }) => - SecretsService.patchSecretByProductIdIdAndName( - productId, - secretName, - requestBody - ) as unknown as Promise, - ...options, - }); -export type SecretsServiceGetSecretsByRepositoryIdDefaultResponse = Awaited< - ReturnType ->; -export type SecretsServiceGetSecretsByRepositoryIdQueryResult< - TData = SecretsServiceGetSecretsByRepositoryIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretsByRepositoryIdKey = - 'SecretsServiceGetSecretsByRepositoryId'; -/** - * Get all secrets of a repository. - */ -export const useSecretsServiceGetSecretsByRepositoryId = < - TData = SecretsServiceGetSecretsByRepositoryIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - repositoryId, - limit, - offset, - sort, - }: { - repositoryId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretsByRepositoryIdKey, - ...(queryKey ?? [{ repositoryId, limit, offset, sort }]), - ], - queryFn: () => - SecretsService.getSecretsByRepositoryId( - repositoryId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type SecretsServicePostSecretForRepositoryMutationResult = Awaited< - ReturnType ->; -/** - * Create a secret for a repository. - */ -export const useSecretsServicePostSecretForRepository = < - TData = SecretsServicePostSecretForRepositoryMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - requestBody?: CreateSecret; - }, - TContext - >({ - mutationFn: ({ requestBody }) => - SecretsService.postSecretForRepository( - requestBody - ) as unknown as Promise, - ...options, - }); -export type SecretsServiceGetSecretByRepositoryIdAndNameDefaultResponse = - Awaited>; -export type SecretsServiceGetSecretByRepositoryIdAndNameQueryResult< - TData = SecretsServiceGetSecretByRepositoryIdAndNameDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useSecretsServiceGetSecretByRepositoryIdAndNameKey = - 'SecretsServiceGetSecretByRepositoryIdAndName'; -/** - * Get details of a secret of a repository. - */ -export const useSecretsServiceGetSecretByRepositoryIdAndName = < - TData = SecretsServiceGetSecretByRepositoryIdAndNameDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - repositoryId, - secretName, - }: { - repositoryId?: number; - secretName?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useSecretsServiceGetSecretByRepositoryIdAndNameKey, - ...(queryKey ?? [{ repositoryId, secretName }]), - ], - queryFn: () => - SecretsService.getSecretByRepositoryIdAndName( - repositoryId, - secretName - ) as TData, - ...options, - }); -export type SecretsServiceDeleteSecretByRepositoryIdAndNameMutationResult = - Awaited>; -/** - * Delete a secret from a repository. - */ -export const useSecretsServiceDeleteSecretByRepositoryIdAndName = < - TData = SecretsServiceDeleteSecretByRepositoryIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - repositoryId?: number; - secretName?: string; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - repositoryId?: number; - secretName?: string; - }, - TContext - >({ - mutationFn: ({ repositoryId, secretName }) => - SecretsService.deleteSecretByRepositoryIdAndName( - repositoryId, - secretName - ) as unknown as Promise, - ...options, - }); -export type SecretsServicePatchSecretByRepositoryIdIdAndNameMutationResult = - Awaited>; -/** - * Update a secret of a repository. - */ -export const useSecretsServicePatchSecretByRepositoryIdIdAndName = < - TData = SecretsServicePatchSecretByRepositoryIdIdAndNameMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - repositoryIdId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - repositoryIdId?: number; - secretName?: string; - requestBody?: UpdateSecret; - }, - TContext - >({ - mutationFn: ({ repositoryIdId, secretName, requestBody }) => - SecretsService.patchSecretByRepositoryIdIdAndName( - repositoryIdId, - secretName, - requestBody - ) as unknown as Promise, - ...options, - }); -export type RepositoriesServiceGetRepositoriesByProductIdDefaultResponse = - Awaited>; -export type RepositoriesServiceGetRepositoriesByProductIdQueryResult< - TData = RepositoriesServiceGetRepositoriesByProductIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useRepositoriesServiceGetRepositoriesByProductIdKey = - 'RepositoriesServiceGetRepositoriesByProductId'; -/** - * Get all repositories of a product. - */ -export const useRepositoriesServiceGetRepositoriesByProductId = < - TData = RepositoriesServiceGetRepositoriesByProductIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - productId, - limit, - offset, - sort, - }: { - productId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useRepositoriesServiceGetRepositoriesByProductIdKey, - ...(queryKey ?? [{ productId, limit, offset, sort }]), - ], - queryFn: () => - RepositoriesService.getRepositoriesByProductId( - productId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type RepositoriesServiceCreateRepositoryMutationResult = Awaited< - ReturnType ->; -/** - * Create a repository for a product. - */ -export const useRepositoriesServiceCreateRepository = < - TData = RepositoriesServiceCreateRepositoryMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - productId?: number; - requestBody?: CreateRepository; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - productId?: number; - requestBody?: CreateRepository; - }, - TContext - >({ - mutationFn: ({ productId, requestBody }) => - RepositoriesService.createRepository( - productId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type RepositoriesServiceGetRepositoryByIdDefaultResponse = Awaited< - ReturnType ->; -export type RepositoriesServiceGetRepositoryByIdQueryResult< - TData = RepositoriesServiceGetRepositoryByIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useRepositoriesServiceGetRepositoryByIdKey = - 'RepositoriesServiceGetRepositoryById'; -/** - * Get details of a repository. - */ -export const useRepositoriesServiceGetRepositoryById = < - TData = RepositoriesServiceGetRepositoryByIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - repositoryId, - }: { - repositoryId?: number; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useRepositoriesServiceGetRepositoryByIdKey, - ...(queryKey ?? [{ repositoryId }]), - ], - queryFn: () => RepositoriesService.getRepositoryById(repositoryId) as TData, - ...options, - }); -export type RepositoriesServiceDeleteRepositoryByIdMutationResult = Awaited< - ReturnType ->; -/** - * Delete a repository. - */ -export const useRepositoriesServiceDeleteRepositoryById = < - TData = RepositoriesServiceDeleteRepositoryByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - repositoryId?: number; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - repositoryId?: number; - }, - TContext - >({ - mutationFn: ({ repositoryId }) => - RepositoriesService.deleteRepositoryById( - repositoryId - ) as unknown as Promise, - ...options, - }); -export type RepositoriesServicePatchRepositoryByIdMutationResult = Awaited< - ReturnType ->; -/** - * Update a repository. - */ -export const useRepositoriesServicePatchRepositoryById = < - TData = RepositoriesServicePatchRepositoryByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - repositoryId?: number; - requestBody?: UpdateRepository; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - repositoryId?: number; - requestBody?: UpdateRepository; - }, - TContext - >({ - mutationFn: ({ repositoryId, requestBody }) => - RepositoriesService.patchRepositoryById( - repositoryId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type RepositoriesServiceGetOrtRunsDefaultResponse = Awaited< - ReturnType ->; -export type RepositoriesServiceGetOrtRunsQueryResult< - TData = RepositoriesServiceGetOrtRunsDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useRepositoriesServiceGetOrtRunsKey = - 'RepositoriesServiceGetOrtRuns'; -/** - * Get all ORT runs of a repository. - */ -export const useRepositoriesServiceGetOrtRuns = < - TData = RepositoriesServiceGetOrtRunsDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - repositoryId, - limit, - offset, - sort, - }: { - repositoryId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useRepositoriesServiceGetOrtRunsKey, - ...(queryKey ?? [{ repositoryId, limit, offset, sort }]), - ], - queryFn: () => - RepositoriesService.getOrtRuns( - repositoryId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type RepositoriesServicePostOrtRunMutationResult = Awaited< - ReturnType ->; -/** - * Create an ORT run for a repository. - */ -export const useRepositoriesServicePostOrtRun = < - TData = RepositoriesServicePostOrtRunMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - repositoryId?: number; - requestBody?: CreateOrtRun; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - repositoryId?: number; - requestBody?: CreateOrtRun; - }, - TContext - >({ - mutationFn: ({ repositoryId, requestBody }) => - RepositoriesService.postOrtRun( - repositoryId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type RepositoriesServiceGetOrtRunByIndexDefaultResponse = Awaited< - ReturnType ->; -export type RepositoriesServiceGetOrtRunByIndexQueryResult< - TData = RepositoriesServiceGetOrtRunByIndexDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useRepositoriesServiceGetOrtRunByIndexKey = - 'RepositoriesServiceGetOrtRunByIndex'; -/** - * Get details of an ORT run of a repository. - */ -export const useRepositoriesServiceGetOrtRunByIndex = < - TData = RepositoriesServiceGetOrtRunByIndexDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - repositoryId, - ortRunIndex, - }: { - repositoryId?: number; - ortRunIndex?: number; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useRepositoriesServiceGetOrtRunByIndexKey, - ...(queryKey ?? [{ repositoryId, ortRunIndex }]), - ], - queryFn: () => - RepositoriesService.getOrtRunByIndex(repositoryId, ortRunIndex) as TData, - ...options, - }); -export type ReportsServiceGetReportByRunIdAndTokenDefaultResponse = Awaited< - ReturnType ->; -export type ReportsServiceGetReportByRunIdAndTokenQueryResult< - TData = ReportsServiceGetReportByRunIdAndTokenDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useReportsServiceGetReportByRunIdAndTokenKey = - 'ReportsServiceGetReportByRunIdAndToken'; -/** - * Download a report of an ORT run using a token. This endpoint does not require authentication. - */ -export const useReportsServiceGetReportByRunIdAndToken = < - TData = ReportsServiceGetReportByRunIdAndTokenDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - runId, - token, - }: { - runId?: number; - token?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useReportsServiceGetReportByRunIdAndTokenKey, - ...(queryKey ?? [{ runId, token }]), - ], - queryFn: () => - ReportsService.getReportByRunIdAndToken(runId, token) as TData, - ...options, - }); -export type ReportsServiceGetReportByRunIdAndFileNameDefaultResponse = Awaited< - ReturnType ->; -export type ReportsServiceGetReportByRunIdAndFileNameQueryResult< - TData = ReportsServiceGetReportByRunIdAndFileNameDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useReportsServiceGetReportByRunIdAndFileNameKey = - 'ReportsServiceGetReportByRunIdAndFileName'; -/** - * Download a report of an ORT run. - */ -export const useReportsServiceGetReportByRunIdAndFileName = < - TData = ReportsServiceGetReportByRunIdAndFileNameDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - runId, - fileName, - }: { - runId?: number; - fileName?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useReportsServiceGetReportByRunIdAndFileNameKey, - ...(queryKey ?? [{ runId, fileName }]), - ], - queryFn: () => - ReportsService.getReportByRunIdAndFileName(runId, fileName) as TData, - ...options, - }); -export type ProductsServiceGetOrganizationProductsDefaultResponse = Awaited< - ReturnType ->; -export type ProductsServiceGetOrganizationProductsQueryResult< - TData = ProductsServiceGetOrganizationProductsDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useProductsServiceGetOrganizationProductsKey = - 'ProductsServiceGetOrganizationProducts'; -/** - * Get all products of an organization. - */ -export const useProductsServiceGetOrganizationProducts = < - TData = ProductsServiceGetOrganizationProductsDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - organizationId, - limit, - offset, - sort, - }: { - organizationId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useProductsServiceGetOrganizationProductsKey, - ...(queryKey ?? [{ organizationId, limit, offset, sort }]), - ], - queryFn: () => - ProductsService.getOrganizationProducts( - organizationId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type ProductsServicePostProductMutationResult = Awaited< - ReturnType ->; -/** - * Create a product for an organization. - */ -export const useProductsServicePostProduct = < - TData = ProductsServicePostProductMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - requestBody?: CreateProduct; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - organizationId?: number; - requestBody?: CreateProduct; - }, - TContext - >({ - mutationFn: ({ organizationId, requestBody }) => - ProductsService.postProduct( - organizationId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type ProductsServiceGetProductByIdDefaultResponse = Awaited< - ReturnType ->; -export type ProductsServiceGetProductByIdQueryResult< - TData = ProductsServiceGetProductByIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useProductsServiceGetProductByIdKey = - 'ProductsServiceGetProductById'; -/** - * Get details of a product. - */ -export const useProductsServiceGetProductById = < - TData = ProductsServiceGetProductByIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - productId, - }: { - productId?: number; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useProductsServiceGetProductByIdKey, - ...(queryKey ?? [{ productId }]), - ], - queryFn: () => ProductsService.getProductById(productId) as TData, - ...options, - }); -export type ProductsServiceDeleteProductByIdMutationResult = Awaited< - ReturnType ->; -/** - * Delete a product. - */ -export const useProductsServiceDeleteProductById = < - TData = ProductsServiceDeleteProductByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - productId?: number; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - productId?: number; - }, - TContext - >({ - mutationFn: ({ productId }) => - ProductsService.deleteProductById(productId) as unknown as Promise, - ...options, - }); -export type ProductsServicePatchProductByIdMutationResult = Awaited< - ReturnType ->; -/** - * Update a product. - */ -export const useProductsServicePatchProductById = < - TData = ProductsServicePatchProductByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - productId?: number; - requestBody?: UpdateProduct; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - productId?: number; - requestBody?: UpdateProduct; - }, - TContext - >({ - mutationFn: ({ productId, requestBody }) => - ProductsService.patchProductById( - productId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type OrganizationsServiceGetOrganizationsDefaultResponse = Awaited< - ReturnType ->; -export type OrganizationsServiceGetOrganizationsQueryResult< - TData = OrganizationsServiceGetOrganizationsDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useOrganizationsServiceGetOrganizationsKey = - 'OrganizationsServiceGetOrganizations'; -/** - * Get all organizations. - */ -export const useOrganizationsServiceGetOrganizations = < - TData = OrganizationsServiceGetOrganizationsDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - limit, - offset, - sort, - }: { - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useOrganizationsServiceGetOrganizationsKey, - ...(queryKey ?? [{ limit, offset, sort }]), - ], - queryFn: () => - OrganizationsService.getOrganizations(limit, offset, sort) as TData, - ...options, - }); -export type OrganizationsServicePostOrganizationsMutationResult = Awaited< - ReturnType ->; -/** - * Create an organization. - */ -export const useOrganizationsServicePostOrganizations = < - TData = OrganizationsServicePostOrganizationsMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - requestBody?: CreateOrganization; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - requestBody?: CreateOrganization; - }, - TContext - >({ - mutationFn: ({ requestBody }) => - OrganizationsService.postOrganizations( - requestBody - ) as unknown as Promise, - ...options, - }); -export type OrganizationsServiceGetOrganizationByIdDefaultResponse = Awaited< - ReturnType ->; -export type OrganizationsServiceGetOrganizationByIdQueryResult< - TData = OrganizationsServiceGetOrganizationByIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useOrganizationsServiceGetOrganizationByIdKey = - 'OrganizationsServiceGetOrganizationById'; -/** - * Get details of an organization. - */ -export const useOrganizationsServiceGetOrganizationById = < - TData = OrganizationsServiceGetOrganizationByIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - organizationId, - }: { - organizationId?: number; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useOrganizationsServiceGetOrganizationByIdKey, - ...(queryKey ?? [{ organizationId }]), - ], - queryFn: () => - OrganizationsService.getOrganizationById(organizationId) as TData, - ...options, - }); -export type OrganizationsServiceDeleteOrganizationByIdMutationResult = Awaited< - ReturnType ->; -/** - * Delete an organization. - */ -export const useOrganizationsServiceDeleteOrganizationById = < - TData = OrganizationsServiceDeleteOrganizationByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - organizationId?: number; - }, - TContext - >({ - mutationFn: ({ organizationId }) => - OrganizationsService.deleteOrganizationById( - organizationId - ) as unknown as Promise, - ...options, - }); -export type OrganizationsServicePatchOrganizationByIdMutationResult = Awaited< - ReturnType ->; -/** - * Update an organization. - */ -export const useOrganizationsServicePatchOrganizationById = < - TData = OrganizationsServicePatchOrganizationByIdMutationResult, - TError = unknown, - TContext = unknown, ->( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - requestBody?: UpdateOrganization; - }, - TContext - >, - 'mutationFn' - > -) => - useMutation< - TData, - TError, - { - organizationId?: number; - requestBody?: UpdateOrganization; - }, - TContext - >({ - mutationFn: ({ organizationId, requestBody }) => - OrganizationsService.patchOrganizationById( - organizationId, - requestBody - ) as unknown as Promise, - ...options, - }); -export type LogsServiceGetLogsByRunIdDefaultResponse = Awaited< - ReturnType ->; -export type LogsServiceGetLogsByRunIdQueryResult< - TData = LogsServiceGetLogsByRunIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useLogsServiceGetLogsByRunIdKey = 'LogsServiceGetLogsByRunId'; -/** - * Download an archive with selected logs of an ORT run. - */ -export const useLogsServiceGetLogsByRunId = < - TData = LogsServiceGetLogsByRunIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - { - runId, - level, - steps, - }: { - runId?: number; - level?: string; - steps?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [ - useLogsServiceGetLogsByRunIdKey, - ...(queryKey ?? [{ runId, level, steps }]), - ], - queryFn: () => LogsService.getLogsByRunId(runId, level, steps) as TData, - ...options, - }); -export type InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdDefaultResponse = - Awaited< - ReturnType< - typeof InfrastructureServicesService.getInfrastructureServicesByOrganizationId - > - >; -export type InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdQueryResult< - TData = InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKey = - 'InfrastructureServicesServiceGetInfrastructureServicesByOrganizationId'; -/** - * List all infrastructure services of an organization. - */ -export const useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationId = - < - TData = InfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], - >( - { - organizationId, - limit, - offset, - sort, - }: { - organizationId?: number; - limit?: number; - offset?: number; - sort?: string; - }, - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > - ) => - useQuery({ - queryKey: [ - useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKey, - ...(queryKey ?? [{ organizationId, limit, offset, sort }]), - ], - queryFn: () => - InfrastructureServicesService.getInfrastructureServicesByOrganizationId( - organizationId, - limit, - offset, - sort - ) as TData, - ...options, - }); -export type InfrastructureServicesServicePostInfrastructureServiceForOrganizationMutationResult = - Awaited< - ReturnType< - typeof InfrastructureServicesService.postInfrastructureServiceForOrganization - > - >; -/** - * Create an infrastructure service for an organization. - */ -export const useInfrastructureServicesServicePostInfrastructureServiceForOrganization = - < - TData = InfrastructureServicesServicePostInfrastructureServiceForOrganizationMutationResult, - TError = unknown, - TContext = unknown, - >( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - requestBody?: CreateInfrastructureService; - }, - TContext - >, - 'mutationFn' - > - ) => - useMutation< - TData, - TError, - { - requestBody?: CreateInfrastructureService; - }, - TContext - >({ - mutationFn: ({ requestBody }) => - InfrastructureServicesService.postInfrastructureServiceForOrganization( - requestBody - ) as unknown as Promise, - ...options, - }); -export type InfrastructureServicesServiceDeleteInfrastructureServiceForOrganizationIdAndNameMutationResult = - Awaited< - ReturnType< - typeof InfrastructureServicesService.deleteInfrastructureServiceForOrganizationIdAndName - > - >; -/** - * Delete an infrastructure service from an organization. - */ -export const useInfrastructureServicesServiceDeleteInfrastructureServiceForOrganizationIdAndName = - < - TData = InfrastructureServicesServiceDeleteInfrastructureServiceForOrganizationIdAndNameMutationResult, - TError = unknown, - TContext = unknown, - >( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - serviceName?: string; - }, - TContext - >, - 'mutationFn' - > - ) => - useMutation< - TData, - TError, - { - organizationId?: number; - serviceName?: string; - }, - TContext - >({ - mutationFn: ({ organizationId, serviceName }) => - InfrastructureServicesService.deleteInfrastructureServiceForOrganizationIdAndName( - organizationId, - serviceName - ) as unknown as Promise, - ...options, - }); -export type InfrastructureServicesServicePatchInfrastructureServiceForOrganizationIdAndNameMutationResult = - Awaited< - ReturnType< - typeof InfrastructureServicesService.patchInfrastructureServiceForOrganizationIdAndName - > - >; -/** - * Update an infrastructure service for an organization. - */ -export const useInfrastructureServicesServicePatchInfrastructureServiceForOrganizationIdAndName = - < - TData = InfrastructureServicesServicePatchInfrastructureServiceForOrganizationIdAndNameMutationResult, - TError = unknown, - TContext = unknown, - >( - options?: Omit< - UseMutationOptions< - TData, - TError, - { - organizationId?: number; - serviceName?: string; - requestBody?: UpdateInfrastructureService; - }, - TContext - >, - 'mutationFn' - > - ) => - useMutation< - TData, - TError, - { - organizationId?: number; - serviceName?: string; - requestBody?: UpdateInfrastructureService; - }, - TContext - >({ - mutationFn: ({ organizationId, serviceName, requestBody }) => - InfrastructureServicesService.patchInfrastructureServiceForOrganizationIdAndName( - organizationId, - serviceName, - requestBody - ) as unknown as Promise, - ...options, - }); -export type HealthServiceGetLivenessDefaultResponse = Awaited< - ReturnType ->; -export type HealthServiceGetLivenessQueryResult< - TData = HealthServiceGetLivenessDefaultResponse, - TError = unknown, -> = UseQueryResult; -export const useHealthServiceGetLivenessKey = 'HealthServiceGetLiveness'; -/** - * Get the health of the ORT server. - */ -export const useHealthServiceGetLiveness = < - TData = HealthServiceGetLivenessDefaultResponse, - TError = unknown, - TQueryKey extends Array = unknown[], ->( - queryKey?: TQueryKey, - options?: Omit< - UseQueryOptions, - 'queryKey' | 'queryFn' | 'initialData' - > -) => - useQuery({ - queryKey: [useHealthServiceGetLivenessKey, ...(queryKey ?? [])], - queryFn: () => HealthService.getLiveness() as TData, - ...options, - }); +// generated with @7nohe/openapi-react-query-codegen@1.3.0 + +export * from "./common"; +export * from "./queries"; diff --git a/ui/src/api/queries/prefetch.ts b/ui/src/api/queries/prefetch.ts new file mode 100644 index 000000000..d1cd93318 --- /dev/null +++ b/ui/src/api/queries/prefetch.ts @@ -0,0 +1,253 @@ +// generated with @7nohe/openapi-react-query-codegen@1.3.0 + +import { type QueryClient } from "@tanstack/react-query"; +import { HealthService, InfrastructureServicesService, LogsService, OrganizationsService, ProductsService, ReportsService, RepositoriesService, SecretsService } from "../requests/services.gen"; +import * as Common from "./common"; +/** +* Get the health of the ORT server. +* @returns Liveness Success +* @throws ApiError +*/ +export const prefetchUseHealthServiceGetLiveness = (queryClient: QueryClient) => queryClient.prefetchQuery({ queryKey: [Common.useHealthServiceGetLivenessKey, []], queryFn: () => HealthService.getLiveness() }); +/** +* Download a report of an ORT run using a token. This endpoint does not require authentication. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.token The token providing access to the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const prefetchUseReportsServiceGetReportByRunIdAndToken = (queryClient: QueryClient, { runId, token }: { + runId?: number; + token?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useReportsServiceGetReportByRunIdAndTokenKey, [{ runId, token }]], queryFn: () => ReportsService.getReportByRunIdAndToken({ runId, token }) }); +/** +* Download a report of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.fileName The name of the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const prefetchUseReportsServiceGetReportByRunIdAndFileName = (queryClient: QueryClient, { fileName, runId }: { + fileName?: string; + runId?: number; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useReportsServiceGetReportByRunIdAndFileNameKey, [{ fileName, runId }]], queryFn: () => ReportsService.getReportByRunIdAndFileName({ fileName, runId }) }); +/** +* Get all organizations. +* @param data The data for the request. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ Success +* @throws ApiError +*/ +export const prefetchUseOrganizationsServiceGetOrganizations = (queryClient: QueryClient, { limit, offset, sort }: { + limit?: number; + offset?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useOrganizationsServiceGetOrganizationsKey, [{ limit, offset, sort }]], queryFn: () => OrganizationsService.getOrganizations({ limit, offset, sort }) }); +/** +* Get details of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @returns Organization Success +* @throws ApiError +*/ +export const prefetchUseOrganizationsServiceGetOrganizationById = (queryClient: QueryClient, { organizationId }: { + organizationId?: number; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useOrganizationsServiceGetOrganizationByIdKey, [{ organizationId }]], queryFn: () => OrganizationsService.getOrganizationById({ organizationId }) }); +/** +* Get all products of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ Success +* @throws ApiError +*/ +export const prefetchUseProductsServiceGetOrganizationProducts = (queryClient: QueryClient, { limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useProductsServiceGetOrganizationProductsKey, [{ limit, offset, organizationId, sort }]], queryFn: () => ProductsService.getOrganizationProducts({ limit, offset, organizationId, sort }) }); +/** +* Get details of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @returns Product Success +* @throws ApiError +*/ +export const prefetchUseProductsServiceGetProductById = (queryClient: QueryClient, { productId }: { + productId?: number; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useProductsServiceGetProductByIdKey, [{ productId }]], queryFn: () => ProductsService.getProductById({ productId }) }); +/** +* Get all secrets of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretsByOrganizationId = (queryClient: QueryClient, { limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretsByOrganizationIdKey, [{ limit, offset, organizationId, sort }]], queryFn: () => SecretsService.getSecretsByOrganizationId({ limit, offset, organizationId, sort }) }); +/** +* Get details of a secret of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretByOrganizationIdAndName = (queryClient: QueryClient, { organizationId, secretName }: { + organizationId?: number; + secretName?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretByOrganizationIdAndNameKey, [{ organizationId, secretName }]], queryFn: () => SecretsService.getSecretByOrganizationIdAndName({ organizationId, secretName }) }); +/** +* Get all secrets of a specific product. +* @param data The data for the request. +* @param data.productId The ID of a product. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretsByProductId = (queryClient: QueryClient, { limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretsByProductIdKey, [{ limit, offset, productId, sort }]], queryFn: () => SecretsService.getSecretsByProductId({ limit, offset, productId, sort }) }); +/** +* Get details of a secret of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretByProductIdAndName = (queryClient: QueryClient, { productId, secretName }: { + productId?: number; + secretName?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretByProductIdAndNameKey, [{ productId, secretName }]], queryFn: () => SecretsService.getSecretByProductIdAndName({ productId, secretName }) }); +/** +* Get all secrets of a repository. +* @param data The data for the request. +* @param data.repositoryId The ID of a repository. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretsByRepositoryId = (queryClient: QueryClient, { limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretsByRepositoryIdKey, [{ limit, offset, repositoryId, sort }]], queryFn: () => SecretsService.getSecretsByRepositoryId({ limit, offset, repositoryId, sort }) }); +/** +* Get details of a secret of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const prefetchUseSecretsServiceGetSecretByRepositoryIdAndName = (queryClient: QueryClient, { repositoryId, secretName }: { + repositoryId?: number; + secretName?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useSecretsServiceGetSecretByRepositoryIdAndNameKey, [{ repositoryId, secretName }]], queryFn: () => SecretsService.getSecretByRepositoryIdAndName({ repositoryId, secretName }) }); +/** +* List all infrastructure services of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ Success +* @throws ApiError +*/ +export const prefetchUseInfrastructureServicesServiceGetInfrastructureServicesByOrganizationId = (queryClient: QueryClient, { limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKey, [{ limit, offset, organizationId, sort }]], queryFn: () => InfrastructureServicesService.getInfrastructureServicesByOrganizationId({ limit, offset, organizationId, sort }) }); +/** +* Get all repositories of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ Success +* @throws ApiError +*/ +export const prefetchUseRepositoriesServiceGetRepositoriesByProductId = (queryClient: QueryClient, { limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useRepositoriesServiceGetRepositoriesByProductIdKey, [{ limit, offset, productId, sort }]], queryFn: () => RepositoriesService.getRepositoriesByProductId({ limit, offset, productId, sort }) }); +/** +* Get details of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @returns Repository Success +* @throws ApiError +*/ +export const prefetchUseRepositoriesServiceGetRepositoryById = (queryClient: QueryClient, { repositoryId }: { + repositoryId?: number; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useRepositoriesServiceGetRepositoryByIdKey, [{ repositoryId }]], queryFn: () => RepositoriesService.getRepositoryById({ repositoryId }) }); +/** +* Get all ORT runs of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ Success +* @throws ApiError +*/ +export const prefetchUseRepositoriesServiceGetOrtRuns = (queryClient: QueryClient, { limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useRepositoriesServiceGetOrtRunsKey, [{ limit, offset, repositoryId, sort }]], queryFn: () => RepositoriesService.getOrtRuns({ limit, offset, repositoryId, sort }) }); +/** +* Get details of an ORT run of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.ortRunIndex The index of an ORT run. +* @returns OrtRun Success +* @throws ApiError +*/ +export const prefetchUseRepositoriesServiceGetOrtRunByIndex = (queryClient: QueryClient, { ortRunIndex, repositoryId }: { + ortRunIndex?: number; + repositoryId?: number; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useRepositoriesServiceGetOrtRunByIndexKey, [{ ortRunIndex, repositoryId }]], queryFn: () => RepositoriesService.getOrtRunByIndex({ ortRunIndex, repositoryId }) }); +/** +* Download an archive with selected logs of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.level The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. +* @param data.steps Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. +* @returns unknown Success. The response body contains a Zip archive with the selected log files. +* @throws ApiError +*/ +export const prefetchUseLogsServiceGetLogsByRunId = (queryClient: QueryClient, { level, runId, steps }: { + level?: string; + runId?: number; + steps?: string; +} = {}) => queryClient.prefetchQuery({ queryKey: [Common.useLogsServiceGetLogsByRunIdKey, [{ level, runId, steps }]], queryFn: () => LogsService.getLogsByRunId({ level, runId, steps }) }); diff --git a/ui/src/api/queries/queries.ts b/ui/src/api/queries/queries.ts new file mode 100644 index 000000000..d493670ff --- /dev/null +++ b/ui/src/api/queries/queries.ts @@ -0,0 +1,572 @@ +// generated with @7nohe/openapi-react-query-codegen@1.3.0 + +import { UseMutationOptions, UseQueryOptions, useMutation, useQuery } from "@tanstack/react-query"; +import { HealthService, InfrastructureServicesService, LogsService, OrganizationsService, ProductsService, ReportsService, RepositoriesService, SecretsService } from "../requests/services.gen"; +import { CreateInfrastructureService, CreateOrganization, CreateOrtRun, CreateProduct, CreateRepository, CreateSecret, UpdateInfrastructureService, UpdateOrganization, UpdateProduct, UpdateRepository, UpdateSecret } from "../requests/types.gen"; +import * as Common from "./common"; +/** +* Get the health of the ORT server. +* @returns Liveness Success +* @throws ApiError +*/ +export const useHealthServiceGetLiveness = = unknown[]>(queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options }); +/** +* Download a report of an ORT run using a token. This endpoint does not require authentication. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.token The token providing access to the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const useReportsServiceGetReportByRunIdAndToken = = unknown[]>({ runId, token }: { + runId?: number; + token?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseReportsServiceGetReportByRunIdAndTokenKeyFn({ runId, token }, queryKey), queryFn: () => ReportsService.getReportByRunIdAndToken({ runId, token }) as TData, ...options }); +/** +* Download a report of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.fileName The name of the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const useReportsServiceGetReportByRunIdAndFileName = = unknown[]>({ fileName, runId }: { + fileName?: string; + runId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseReportsServiceGetReportByRunIdAndFileNameKeyFn({ fileName, runId }, queryKey), queryFn: () => ReportsService.getReportByRunIdAndFileName({ fileName, runId }) as TData, ...options }); +/** +* Get all organizations. +* @param data The data for the request. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ Success +* @throws ApiError +*/ +export const useOrganizationsServiceGetOrganizations = = unknown[]>({ limit, offset, sort }: { + limit?: number; + offset?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseOrganizationsServiceGetOrganizationsKeyFn({ limit, offset, sort }, queryKey), queryFn: () => OrganizationsService.getOrganizations({ limit, offset, sort }) as TData, ...options }); +/** +* Get details of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @returns Organization Success +* @throws ApiError +*/ +export const useOrganizationsServiceGetOrganizationById = = unknown[]>({ organizationId }: { + organizationId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseOrganizationsServiceGetOrganizationByIdKeyFn({ organizationId }, queryKey), queryFn: () => OrganizationsService.getOrganizationById({ organizationId }) as TData, ...options }); +/** +* Get all products of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ Success +* @throws ApiError +*/ +export const useProductsServiceGetOrganizationProducts = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseProductsServiceGetOrganizationProductsKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => ProductsService.getOrganizationProducts({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get details of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @returns Product Success +* @throws ApiError +*/ +export const useProductsServiceGetProductById = = unknown[]>({ productId }: { + productId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseProductsServiceGetProductByIdKeyFn({ productId }, queryKey), queryFn: () => ProductsService.getProductById({ productId }) as TData, ...options }); +/** +* Get all secrets of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByOrganizationId = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretsByOrganizationIdKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByOrganizationId({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get details of a secret of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByOrganizationIdAndName = = unknown[]>({ organizationId, secretName }: { + organizationId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretByOrganizationIdAndNameKeyFn({ organizationId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByOrganizationIdAndName({ organizationId, secretName }) as TData, ...options }); +/** +* Get all secrets of a specific product. +* @param data The data for the request. +* @param data.productId The ID of a product. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByProductId = = unknown[]>({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretsByProductIdKeyFn({ limit, offset, productId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByProductId({ limit, offset, productId, sort }) as TData, ...options }); +/** +* Get details of a secret of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByProductIdAndName = = unknown[]>({ productId, secretName }: { + productId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretByProductIdAndNameKeyFn({ productId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByProductIdAndName({ productId, secretName }) as TData, ...options }); +/** +* Get all secrets of a repository. +* @param data The data for the request. +* @param data.repositoryId The ID of a repository. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByRepositoryId = = unknown[]>({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretsByRepositoryIdKeyFn({ limit, offset, repositoryId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByRepositoryId({ limit, offset, repositoryId, sort }) as TData, ...options }); +/** +* Get details of a secret of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByRepositoryIdAndName = = unknown[]>({ repositoryId, secretName }: { + repositoryId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseSecretsServiceGetSecretByRepositoryIdAndNameKeyFn({ repositoryId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByRepositoryIdAndName({ repositoryId, secretName }) as TData, ...options }); +/** +* List all infrastructure services of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ Success +* @throws ApiError +*/ +export const useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationId = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => InfrastructureServicesService.getInfrastructureServicesByOrganizationId({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get all repositories of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetRepositoriesByProductId = = unknown[]>({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseRepositoriesServiceGetRepositoriesByProductIdKeyFn({ limit, offset, productId, sort }, queryKey), queryFn: () => RepositoriesService.getRepositoriesByProductId({ limit, offset, productId, sort }) as TData, ...options }); +/** +* Get details of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @returns Repository Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetRepositoryById = = unknown[]>({ repositoryId }: { + repositoryId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseRepositoriesServiceGetRepositoryByIdKeyFn({ repositoryId }, queryKey), queryFn: () => RepositoriesService.getRepositoryById({ repositoryId }) as TData, ...options }); +/** +* Get all ORT runs of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetOrtRuns = = unknown[]>({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseRepositoriesServiceGetOrtRunsKeyFn({ limit, offset, repositoryId, sort }, queryKey), queryFn: () => RepositoriesService.getOrtRuns({ limit, offset, repositoryId, sort }) as TData, ...options }); +/** +* Get details of an ORT run of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.ortRunIndex The index of an ORT run. +* @returns OrtRun Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetOrtRunByIndex = = unknown[]>({ ortRunIndex, repositoryId }: { + ortRunIndex?: number; + repositoryId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseRepositoriesServiceGetOrtRunByIndexKeyFn({ ortRunIndex, repositoryId }, queryKey), queryFn: () => RepositoriesService.getOrtRunByIndex({ ortRunIndex, repositoryId }) as TData, ...options }); +/** +* Download an archive with selected logs of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.level The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. +* @param data.steps Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. +* @returns unknown Success. The response body contains a Zip archive with the selected log files. +* @throws ApiError +*/ +export const useLogsServiceGetLogsByRunId = = unknown[]>({ level, runId, steps }: { + level?: string; + runId?: number; + steps?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseLogsServiceGetLogsByRunIdKeyFn({ level, runId, steps }, queryKey), queryFn: () => LogsService.getLogsByRunId({ level, runId, steps }) as TData, ...options }); +/** +* Create an organization. +* @param data The data for the request. +* @param data.requestBody +* @returns Organization Success +* @throws ApiError +*/ +export const useOrganizationsServicePostOrganizations = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ requestBody }) => OrganizationsService.postOrganizations({ requestBody }) as unknown as Promise, ...options }); +/** +* Create a product for an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.requestBody +* @returns Product Success +* @throws ApiError +*/ +export const useProductsServicePostProduct = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, requestBody }) => ProductsService.postProduct({ organizationId, requestBody }) as unknown as Promise, ...options }); +/** +* Create a secret for an organization. +* @param data The data for the request. +* @param data.requestBody +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePostSecretForOrganization = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ requestBody }) => SecretsService.postSecretForOrganization({ requestBody }) as unknown as Promise, ...options }); +/** +* Create a secret for a product. +* @param data The data for the request. +* @param data.requestBody +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePostSecretForProduct = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ requestBody }) => SecretsService.postSecretForProduct({ requestBody }) as unknown as Promise, ...options }); +/** +* Create a secret for a repository. +* @param data The data for the request. +* @param data.requestBody +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePostSecretForRepository = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ requestBody }) => SecretsService.postSecretForRepository({ requestBody }) as unknown as Promise, ...options }); +/** +* Create an infrastructure service for an organization. +* @param data The data for the request. +* @param data.requestBody +* @returns InfrastructureService Success +* @throws ApiError +*/ +export const useInfrastructureServicesServicePostInfrastructureServiceForOrganization = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ requestBody }) => InfrastructureServicesService.postInfrastructureServiceForOrganization({ requestBody }) as unknown as Promise, ...options }); +/** +* Create a repository for a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.requestBody +* @returns Repository Success +* @throws ApiError +*/ +export const useRepositoriesServiceCreateRepository = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ productId, requestBody }) => RepositoriesService.createRepository({ productId, requestBody }) as unknown as Promise, ...options }); +/** +* Create an ORT run for a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.requestBody +* @returns OrtRun Success +* @throws ApiError +*/ +export const useRepositoriesServicePostOrtRun = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ repositoryId, requestBody }) => RepositoriesService.postOrtRun({ repositoryId, requestBody }) as unknown as Promise, ...options }); +/** +* Update an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Organization Success +* @throws ApiError +*/ +export const useOrganizationsServicePatchOrganizationById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, requestBody }) => OrganizationsService.patchOrganizationById({ organizationId, requestBody }) as unknown as Promise, ...options }); +/** +* Update a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Product Success +* @throws ApiError +*/ +export const useProductsServicePatchProductById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ productId, requestBody }) => ProductsService.patchProductById({ productId, requestBody }) as unknown as Promise, ...options }); +/** +* Update a secret of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.secretName The secret's name. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePatchSecretByOrganizationIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, requestBody, secretName }) => SecretsService.patchSecretByOrganizationIdAndName({ organizationId, requestBody, secretName }) as unknown as Promise, ...options }); +/** +* Update a secret of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.secretName The secret's name. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePatchSecretByProductIdIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ productId, requestBody, secretName }) => SecretsService.patchSecretByProductIdIdAndName({ productId, requestBody, secretName }) as unknown as Promise, ...options }); +/** +* Update a secret of a repository. +* @param data The data for the request. +* @param data.repositoryIdId The repository's ID. +* @param data.secretName The secret's name. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServicePatchSecretByRepositoryIdIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ repositoryIdId, requestBody, secretName }) => SecretsService.patchSecretByRepositoryIdIdAndName({ repositoryIdId, requestBody, secretName }) as unknown as Promise, ...options }); +/** +* Update an infrastructure service for an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.serviceName The name of the infrastructure service. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns InfrastructureService Success +* @throws ApiError +*/ +export const useInfrastructureServicesServicePatchInfrastructureServiceForOrganizationIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, requestBody, serviceName }) => InfrastructureServicesService.patchInfrastructureServiceForOrganizationIdAndName({ organizationId, requestBody, serviceName }) as unknown as Promise, ...options }); +/** +* Update a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. +* @returns Repository Success +* @throws ApiError +*/ +export const useRepositoriesServicePatchRepositoryById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ repositoryId, requestBody }) => RepositoriesService.patchRepositoryById({ repositoryId, requestBody }) as unknown as Promise, ...options }); +/** +* Delete an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @returns void Success +* @throws ApiError +*/ +export const useOrganizationsServiceDeleteOrganizationById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId }) => OrganizationsService.deleteOrganizationById({ organizationId }) as unknown as Promise, ...options }); +/** +* Delete a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @returns void Success +* @throws ApiError +*/ +export const useProductsServiceDeleteProductById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ productId }) => ProductsService.deleteProductById({ productId }) as unknown as Promise, ...options }); +/** +* Delete a secret from an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.secretName The secret's name. +* @returns void Success +* @throws ApiError +*/ +export const useSecretsServiceDeleteSecretByOrganizationIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, secretName }) => SecretsService.deleteSecretByOrganizationIdAndName({ organizationId, secretName }) as unknown as Promise, ...options }); +/** +* Delete a secret from a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.secretName The secret's name. +* @returns void Success +* @throws ApiError +*/ +export const useSecretsServiceDeleteSecretByProductIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ productId, secretName }) => SecretsService.deleteSecretByProductIdAndName({ productId, secretName }) as unknown as Promise, ...options }); +/** +* Delete a secret from a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.secretName The secret's name. +* @returns void Success +* @throws ApiError +*/ +export const useSecretsServiceDeleteSecretByRepositoryIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ repositoryId, secretName }) => SecretsService.deleteSecretByRepositoryIdAndName({ repositoryId, secretName }) as unknown as Promise, ...options }); +/** +* Delete an infrastructure service from an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.serviceName The name of the infrastructure service. +* @returns void Success +* @throws ApiError +*/ +export const useInfrastructureServicesServiceDeleteInfrastructureServiceForOrganizationIdAndName = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ organizationId, serviceName }) => InfrastructureServicesService.deleteInfrastructureServiceForOrganizationIdAndName({ organizationId, serviceName }) as unknown as Promise, ...options }); +/** +* Delete a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @returns void Success +* @throws ApiError +*/ +export const useRepositoriesServiceDeleteRepositoryById = (options?: Omit, "mutationFn">) => useMutation({ mutationFn: ({ repositoryId }) => RepositoriesService.deleteRepositoryById({ repositoryId }) as unknown as Promise, ...options }); diff --git a/ui/src/api/queries/suspense.ts b/ui/src/api/queries/suspense.ts new file mode 100644 index 000000000..b12080321 --- /dev/null +++ b/ui/src/api/queries/suspense.ts @@ -0,0 +1,253 @@ +// generated with @7nohe/openapi-react-query-codegen@1.3.0 + +import { UseQueryOptions, useSuspenseQuery } from "@tanstack/react-query"; +import { HealthService, InfrastructureServicesService, LogsService, OrganizationsService, ProductsService, ReportsService, RepositoriesService, SecretsService } from "../requests/services.gen"; +import * as Common from "./common"; +/** +* Get the health of the ORT server. +* @returns Liveness Success +* @throws ApiError +*/ +export const useHealthServiceGetLivenessSuspense = = unknown[]>(queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseHealthServiceGetLivenessKeyFn(), queryFn: () => HealthService.getLiveness() as TData, ...options }); +/** +* Download a report of an ORT run using a token. This endpoint does not require authentication. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.token The token providing access to the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const useReportsServiceGetReportByRunIdAndTokenSuspense = = unknown[]>({ runId, token }: { + runId?: number; + token?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseReportsServiceGetReportByRunIdAndTokenKeyFn({ runId, token }, queryKey), queryFn: () => ReportsService.getReportByRunIdAndToken({ runId, token }) as TData, ...options }); +/** +* Download a report of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.fileName The name of the report file to be downloaded. +* @returns string Success. The response body contains the requested report file. +* @throws ApiError +*/ +export const useReportsServiceGetReportByRunIdAndFileNameSuspense = = unknown[]>({ fileName, runId }: { + fileName?: string; + runId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseReportsServiceGetReportByRunIdAndFileNameKeyFn({ fileName, runId }, queryKey), queryFn: () => ReportsService.getReportByRunIdAndFileName({ fileName, runId }) as TData, ...options }); +/** +* Get all organizations. +* @param data The data for the request. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ Success +* @throws ApiError +*/ +export const useOrganizationsServiceGetOrganizationsSuspense = = unknown[]>({ limit, offset, sort }: { + limit?: number; + offset?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseOrganizationsServiceGetOrganizationsKeyFn({ limit, offset, sort }, queryKey), queryFn: () => OrganizationsService.getOrganizations({ limit, offset, sort }) as TData, ...options }); +/** +* Get details of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @returns Organization Success +* @throws ApiError +*/ +export const useOrganizationsServiceGetOrganizationByIdSuspense = = unknown[]>({ organizationId }: { + organizationId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseOrganizationsServiceGetOrganizationByIdKeyFn({ organizationId }, queryKey), queryFn: () => OrganizationsService.getOrganizationById({ organizationId }) as TData, ...options }); +/** +* Get all products of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ Success +* @throws ApiError +*/ +export const useProductsServiceGetOrganizationProductsSuspense = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseProductsServiceGetOrganizationProductsKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => ProductsService.getOrganizationProducts({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get details of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @returns Product Success +* @throws ApiError +*/ +export const useProductsServiceGetProductByIdSuspense = = unknown[]>({ productId }: { + productId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseProductsServiceGetProductByIdKeyFn({ productId }, queryKey), queryFn: () => ProductsService.getProductById({ productId }) as TData, ...options }); +/** +* Get all secrets of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByOrganizationIdSuspense = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretsByOrganizationIdKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByOrganizationId({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get details of a secret of an organization. +* @param data The data for the request. +* @param data.organizationId The organization's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByOrganizationIdAndNameSuspense = = unknown[]>({ organizationId, secretName }: { + organizationId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretByOrganizationIdAndNameKeyFn({ organizationId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByOrganizationIdAndName({ organizationId, secretName }) as TData, ...options }); +/** +* Get all secrets of a specific product. +* @param data The data for the request. +* @param data.productId The ID of a product. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByProductIdSuspense = = unknown[]>({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretsByProductIdKeyFn({ limit, offset, productId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByProductId({ limit, offset, productId, sort }) as TData, ...options }); +/** +* Get details of a secret of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByProductIdAndNameSuspense = = unknown[]>({ productId, secretName }: { + productId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretByProductIdAndNameKeyFn({ productId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByProductIdAndName({ productId, secretName }) as TData, ...options }); +/** +* Get all secrets of a repository. +* @param data The data for the request. +* @param data.repositoryId The ID of a repository. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretsByRepositoryIdSuspense = = unknown[]>({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretsByRepositoryIdKeyFn({ limit, offset, repositoryId, sort }, queryKey), queryFn: () => SecretsService.getSecretsByRepositoryId({ limit, offset, repositoryId, sort }) as TData, ...options }); +/** +* Get details of a secret of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.secretName The secret's name. +* @returns Secret Success +* @throws ApiError +*/ +export const useSecretsServiceGetSecretByRepositoryIdAndNameSuspense = = unknown[]>({ repositoryId, secretName }: { + repositoryId?: number; + secretName?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseSecretsServiceGetSecretByRepositoryIdAndNameKeyFn({ repositoryId, secretName }, queryKey), queryFn: () => SecretsService.getSecretByRepositoryIdAndName({ repositoryId, secretName }) as TData, ...options }); +/** +* List all infrastructure services of an organization. +* @param data The data for the request. +* @param data.organizationId The ID of an organization. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ Success +* @throws ApiError +*/ +export const useInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdSuspense = = unknown[]>({ limit, offset, organizationId, sort }: { + limit?: number; + offset?: number; + organizationId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseInfrastructureServicesServiceGetInfrastructureServicesByOrganizationIdKeyFn({ limit, offset, organizationId, sort }, queryKey), queryFn: () => InfrastructureServicesService.getInfrastructureServicesByOrganizationId({ limit, offset, organizationId, sort }) as TData, ...options }); +/** +* Get all repositories of a product. +* @param data The data for the request. +* @param data.productId The product's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetRepositoriesByProductIdSuspense = = unknown[]>({ limit, offset, productId, sort }: { + limit?: number; + offset?: number; + productId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseRepositoriesServiceGetRepositoriesByProductIdKeyFn({ limit, offset, productId, sort }, queryKey), queryFn: () => RepositoriesService.getRepositoriesByProductId({ limit, offset, productId, sort }) as TData, ...options }); +/** +* Get details of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @returns Repository Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetRepositoryByIdSuspense = = unknown[]>({ repositoryId }: { + repositoryId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseRepositoriesServiceGetRepositoryByIdKeyFn({ repositoryId }, queryKey), queryFn: () => RepositoriesService.getRepositoryById({ repositoryId }) as TData, ...options }); +/** +* Get all ORT runs of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. +* @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. +* @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. +* @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetOrtRunsSuspense = = unknown[]>({ limit, offset, repositoryId, sort }: { + limit?: number; + offset?: number; + repositoryId?: number; + sort?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseRepositoriesServiceGetOrtRunsKeyFn({ limit, offset, repositoryId, sort }, queryKey), queryFn: () => RepositoriesService.getOrtRuns({ limit, offset, repositoryId, sort }) as TData, ...options }); +/** +* Get details of an ORT run of a repository. +* @param data The data for the request. +* @param data.repositoryId The repository's ID. +* @param data.ortRunIndex The index of an ORT run. +* @returns OrtRun Success +* @throws ApiError +*/ +export const useRepositoriesServiceGetOrtRunByIndexSuspense = = unknown[]>({ ortRunIndex, repositoryId }: { + ortRunIndex?: number; + repositoryId?: number; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseRepositoriesServiceGetOrtRunByIndexKeyFn({ ortRunIndex, repositoryId }, queryKey), queryFn: () => RepositoriesService.getOrtRunByIndex({ ortRunIndex, repositoryId }) as TData, ...options }); +/** +* Download an archive with selected logs of an ORT run. +* @param data The data for the request. +* @param data.runId The ID of the ORT run. +* @param data.level The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. +* @param data.steps Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. +* @returns unknown Success. The response body contains a Zip archive with the selected log files. +* @throws ApiError +*/ +export const useLogsServiceGetLogsByRunIdSuspense = = unknown[]>({ level, runId, steps }: { + level?: string; + runId?: number; + steps?: string; +} = {}, queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseLogsServiceGetLogsByRunIdKeyFn({ level, runId, steps }, queryKey), queryFn: () => LogsService.getLogsByRunId({ level, runId, steps }) as TData, ...options }); diff --git a/ui/src/api/requests/core/ApiError.ts b/ui/src/api/requests/core/ApiError.ts index e5ddc07ac..4d9d290d8 100644 --- a/ui/src/api/requests/core/ApiError.ts +++ b/ui/src/api/requests/core/ApiError.ts @@ -1,6 +1,3 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from './ApiRequestOptions'; import type { ApiResult } from './ApiResult'; @@ -8,7 +5,7 @@ export class ApiError extends Error { public readonly url: string; public readonly status: number; public readonly statusText: string; - public readonly body: any; + public readonly body: unknown; public readonly request: ApiRequestOptions; constructor( diff --git a/ui/src/api/requests/core/ApiRequestOptions.ts b/ui/src/api/requests/core/ApiRequestOptions.ts index 271818364..cb2727aff 100644 --- a/ui/src/api/requests/core/ApiRequestOptions.ts +++ b/ui/src/api/requests/core/ApiRequestOptions.ts @@ -1,6 +1,3 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type ApiRequestOptions = { readonly method: | 'GET' @@ -11,11 +8,11 @@ export type ApiRequestOptions = { | 'HEAD' | 'PATCH'; readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; + readonly path?: Record; + readonly cookies?: Record; + readonly headers?: Record; + readonly query?: Record; + readonly formData?: Record; readonly body?: any; readonly mediaType?: string; readonly responseHeader?: string; diff --git a/ui/src/api/requests/core/ApiResult.ts b/ui/src/api/requests/core/ApiResult.ts index 91f60ae08..05040ba81 100644 --- a/ui/src/api/requests/core/ApiResult.ts +++ b/ui/src/api/requests/core/ApiResult.ts @@ -1,10 +1,7 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; +export type ApiResult = { + readonly body: TData; readonly ok: boolean; readonly status: number; readonly statusText: string; - readonly body: any; + readonly url: string; }; diff --git a/ui/src/api/requests/core/CancelablePromise.ts b/ui/src/api/requests/core/CancelablePromise.ts index 9bafcd3f3..040e6efda 100644 --- a/ui/src/api/requests/core/CancelablePromise.ts +++ b/ui/src/api/requests/core/CancelablePromise.ts @@ -1,6 +1,3 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export class CancelError extends Error { constructor(message: string) { super(message); @@ -21,62 +18,62 @@ export interface OnCancel { } export class CancelablePromise implements Promise { - #isResolved: boolean; - #isRejected: boolean; - #isCancelled: boolean; - readonly #cancelHandlers: (() => void)[]; - readonly #promise: Promise; - #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: any) => void; + private _isResolved: boolean; + private _isRejected: boolean; + private _isCancelled: boolean; + readonly cancelHandlers: (() => void)[]; + readonly promise: Promise; + private _resolve?: (value: T | PromiseLike) => void; + private _reject?: (reason?: unknown) => void; constructor( executor: ( resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, + reject: (reason?: unknown) => void, onCancel: OnCancel ) => void ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; + this._isResolved = false; + this._isRejected = false; + this._isCancelled = false; + this.cancelHandlers = []; + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isResolved = true; - this.#resolve?.(value); + this._isResolved = true; + if (this._resolve) this._resolve(value); }; - const onReject = (reason?: any): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isRejected = true; - this.#reject?.(reason); + this._isRejected = true; + if (this._reject) this._reject(reason); }; const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#cancelHandlers.push(cancelHandler); + this.cancelHandlers.push(cancelHandler); }; Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this.#isResolved, + get: (): boolean => this._isResolved, }); Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this.#isRejected, + get: (): boolean => this._isRejected, }); Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this.#isCancelled, + get: (): boolean => this._isCancelled, }); return executor(onResolve, onReject, onCancel as OnCancel); @@ -89,29 +86,29 @@ export class CancelablePromise implements Promise { public then( onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null ): Promise { - return this.#promise.then(onFulfilled, onRejected); + return this.promise.then(onFulfilled, onRejected); } public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null ): Promise { - return this.#promise.catch(onRejected); + return this.promise.catch(onRejected); } public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); + return this.promise.finally(onFinally); } public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { + if (this._isResolved || this._isRejected || this._isCancelled) { return; } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { + this._isCancelled = true; + if (this.cancelHandlers.length) { try { - for (const cancelHandler of this.#cancelHandlers) { + for (const cancelHandler of this.cancelHandlers) { cancelHandler(); } } catch (error) { @@ -119,11 +116,11 @@ export class CancelablePromise implements Promise { return; } } - this.#cancelHandlers.length = 0; - this.#reject?.(new CancelError('Request aborted')); + this.cancelHandlers.length = 0; + if (this._reject) this._reject(new CancelError('Request aborted')); } public get isCancelled(): boolean { - return this.#isCancelled; + return this._isCancelled; } } diff --git a/ui/src/api/requests/core/OpenAPI.ts b/ui/src/api/requests/core/OpenAPI.ts index fe51cb373..027fe2159 100644 --- a/ui/src/api/requests/core/OpenAPI.ts +++ b/ui/src/api/requests/core/OpenAPI.ts @@ -1,31 +1,56 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from './ApiRequestOptions'; -type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware) { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; + } + } + + use(fn: Middleware) { + this._fns = [...this._fns, fn]; + } +} export type OpenAPIConfig = { BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; VERSION: string; WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver; - USERNAME?: string | Resolver; - PASSWORD?: string | Resolver; - HEADERS?: Headers | Resolver; - ENCODE_PATH?: (path: string) => string; + interceptors: { + request: Interceptors; + response: Interceptors; + }; }; export const OpenAPI: OpenAPIConfig = { BASE: 'http://localhost:8080', - VERSION: '1.0.0-SNAPSHOT+1918.sha.4aaf8e7', - WITH_CREDENTIALS: false, CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, TOKEN: undefined, USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, + VERSION: '0.1.0-SNAPSHOT+001.sha.523cacc', + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, }; diff --git a/ui/src/api/requests/core/request.ts b/ui/src/api/requests/core/request.ts index 19030c54e..208ff2d09 100644 --- a/ui/src/api/requests/core/request.ts +++ b/ui/src/api/requests/core/request.ts @@ -1,6 +1,3 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import { ApiError } from './ApiError'; import type { ApiRequestOptions } from './ApiRequestOptions'; import type { ApiResult } from './ApiResult'; @@ -8,38 +5,23 @@ import { CancelablePromise } from './CancelablePromise'; import type { OnCancel } from './CancelablePromise'; import type { OpenAPIConfig } from './OpenAPI'; -const isDefined = ( - value: T | null | undefined -): value is Exclude => { - return value !== undefined && value !== null; -}; - -const isString = (value: any): value is string => { +export const isString = (value: unknown): value is string => { return typeof value === 'string'; }; -const isStringWithValue = (value: any): value is string => { +export const isStringWithValue = (value: unknown): value is string => { return isString(value) && value !== ''; }; -const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob; }; -const isFormData = (value: any): value is FormData => { +export const isFormData = (value: unknown): value is FormData => { return value instanceof FormData; }; -const base64 = (str: string): string => { +export const base64 = (str: string): string => { try { return btoa(str); } catch (err) { @@ -48,38 +30,32 @@ const base64 = (str: string): string => { } }; -const getQueryString = (params: Record): string => { +export const getQueryString = (params: Record): string => { const qs: string[] = []; - const append = (key: string, value: any) => { + const append = (key: string, value: unknown) => { qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); }; - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach((v) => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; } - }; - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); + if (value instanceof Date) { + append(key, value.toISOString()); + } else if (Array.isArray(value)) { + value.forEach((v) => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; - if (qs.length > 0) { - return `?${qs.join('&')}`; - } + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - return ''; + return qs.length ? `?${qs.join('&')}` : ''; }; const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { @@ -94,18 +70,17 @@ const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { return substring; }); - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; }; -const getFormData = (options: ApiRequestOptions): FormData | undefined => { +export const getFormData = ( + options: ApiRequestOptions +): FormData | undefined => { if (options.formData) { const formData = new FormData(); - const process = (key: string, value: any) => { + const process = (key: string, value: unknown) => { if (isString(value) || isBlob(value)) { formData.append(key, value); } else { @@ -114,7 +89,7 @@ const getFormData = (options: ApiRequestOptions): FormData | undefined => { }; Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) + .filter(([, value]) => value !== undefined && value !== null) .forEach(([key, value]) => { if (Array.isArray(value)) { value.forEach((v) => process(key, v)); @@ -130,7 +105,7 @@ const getFormData = (options: ApiRequestOptions): FormData | undefined => { type Resolver = (options: ApiRequestOptions) => Promise; -const resolve = async ( +export const resolve = async ( options: ApiRequestOptions, resolver?: T | Resolver ): Promise => { @@ -140,21 +115,23 @@ const resolve = async ( return resolver; }; -const getHeaders = async ( +export const getHeaders = async ( config: OpenAPIConfig, options: ApiRequestOptions ): Promise => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); + const [token, username, password, additionalHeaders] = await Promise.all([ + resolve(options, config.TOKEN), + resolve(options, config.USERNAME), + resolve(options, config.PASSWORD), + resolve(options, config.HEADERS), + ]); const headers = Object.entries({ Accept: 'application/json', ...additionalHeaders, ...options.headers, }) - .filter(([_, value]) => isDefined(value)) + .filter(([, value]) => value !== undefined && value !== null) .reduce( (headers, [key, value]) => ({ ...headers, @@ -172,7 +149,7 @@ const getHeaders = async ( headers['Authorization'] = `Basic ${credentials}`; } - if (options.body) { + if (options.body !== undefined) { if (options.mediaType) { headers['Content-Type'] = options.mediaType; } else if (isBlob(options.body)) { @@ -187,9 +164,12 @@ const getHeaders = async ( return new Headers(headers); }; -const getRequestBody = (options: ApiRequestOptions): any => { +export const getRequestBody = (options: ApiRequestOptions): unknown => { if (options.body !== undefined) { - if (options.mediaType?.includes('/json')) { + if ( + options.mediaType?.includes('application/json') || + options.mediaType?.includes('+json') + ) { return JSON.stringify(options.body); } else if ( isString(options.body) || @@ -215,7 +195,7 @@ export const sendRequest = async ( ): Promise => { const controller = new AbortController(); - const request: RequestInit = { + let request: RequestInit = { headers, body: body ?? formData, method: options.method, @@ -226,12 +206,16 @@ export const sendRequest = async ( request.credentials = config.CREDENTIALS; } + for (const fn of config.interceptors.request._fns) { + request = await fn(request); + } + onCancel(() => controller.abort()); return await fetch(url, request); }; -const getResponseHeader = ( +export const getResponseHeader = ( response: Response, responseHeader?: string ): string | undefined => { @@ -244,18 +228,29 @@ const getResponseHeader = ( return undefined; }; -const getResponseBody = async (response: Response): Promise => { +export const getResponseBody = async (response: Response): Promise => { if (response.status !== 204) { try { const contentType = response.headers.get('Content-Type'); if (contentType) { - const jsonTypes = ['application/json', 'application/problem+json']; - const isJSON = jsonTypes.some((type) => - contentType.toLowerCase().startsWith(type) - ); - if (isJSON) { + const binaryTypes = [ + 'application/octet-stream', + 'application/pdf', + 'application/zip', + 'audio/', + 'image/', + 'video/', + ]; + if ( + contentType.includes('application/json') || + contentType.includes('+json') + ) { return await response.json(); - } else { + } else if (binaryTypes.some((type) => contentType.includes(type))) { + return await response.blob(); + } else if (contentType.includes('multipart/form-data')) { + return await response.formData(); + } else if (contentType.includes('text/')) { return await response.text(); } } @@ -266,18 +261,51 @@ const getResponseBody = async (response: Response): Promise => { return undefined; }; -const catchErrorCodes = ( +export const catchErrorCodes = ( options: ApiRequestOptions, result: ApiResult ): void => { const errors: Record = { 400: 'Bad Request', 401: 'Unauthorized', + 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', 500: 'Internal Server Error', + 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', ...options.errors, }; @@ -287,7 +315,21 @@ const catchErrorCodes = ( } if (!result.ok) { - throw new ApiError(options, result, 'Generic Error'); + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError( + options, + result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); } }; @@ -310,7 +352,7 @@ export const request = ( const headers = await getHeaders(config, options); if (!onCancel.isCancelled) { - const response = await sendRequest( + let response = await sendRequest( config, options, url, @@ -319,6 +361,11 @@ export const request = ( headers, onCancel ); + + for (const fn of config.interceptors.response._fns) { + response = await fn(response); + } + const responseBody = await getResponseBody(response); const responseHeader = getResponseHeader( response, diff --git a/ui/src/api/requests/index.ts b/ui/src/api/requests/index.ts index 091148658..9234d3c84 100644 --- a/ui/src/api/requests/index.ts +++ b/ui/src/api/requests/index.ts @@ -1,41 +1,7 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ +// This file is auto-generated by @hey-api/openapi-ts export { ApiError } from './core/ApiError'; export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI } from './core/OpenAPI'; -export type { OpenAPIConfig } from './core/OpenAPI'; - -export type { CreateInfrastructureService } from './models/CreateInfrastructureService'; -export type { CreateOrganization } from './models/CreateOrganization'; -export type { CreateOrtRun } from './models/CreateOrtRun'; -export type { CreateProduct } from './models/CreateProduct'; -export { CreateRepository } from './models/CreateRepository'; -export type { CreateSecret } from './models/CreateSecret'; -export type { InfrastructureService } from './models/InfrastructureService'; -export type { Liveness } from './models/Liveness'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_'; -export type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ } from './models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_'; -export type { Organization } from './models/Organization'; -export { OrtRun } from './models/OrtRun'; -export type { Product } from './models/Product'; -export { Repository } from './models/Repository'; -export type { Secret } from './models/Secret'; -export type { UpdateInfrastructureService } from './models/UpdateInfrastructureService'; -export type { UpdateOrganization } from './models/UpdateOrganization'; -export type { UpdateProduct } from './models/UpdateProduct'; -export { UpdateRepository } from './models/UpdateRepository'; -export type { UpdateSecret } from './models/UpdateSecret'; - -export { HealthService } from './services/HealthService'; -export { InfrastructureServicesService } from './services/InfrastructureServicesService'; -export { LogsService } from './services/LogsService'; -export { OrganizationsService } from './services/OrganizationsService'; -export { ProductsService } from './services/ProductsService'; -export { ReportsService } from './services/ReportsService'; -export { RepositoriesService } from './services/RepositoriesService'; -export { SecretsService } from './services/SecretsService'; +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './schemas.gen'; +export * from './services.gen'; +export * from './types.gen'; diff --git a/ui/src/api/requests/models/CreateInfrastructureService.ts b/ui/src/api/requests/models/CreateInfrastructureService.ts deleted file mode 100644 index 45cbf3900..000000000 --- a/ui/src/api/requests/models/CreateInfrastructureService.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateInfrastructureService = { - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; -}; diff --git a/ui/src/api/requests/models/CreateOrganization.ts b/ui/src/api/requests/models/CreateOrganization.ts deleted file mode 100644 index fe951360f..000000000 --- a/ui/src/api/requests/models/CreateOrganization.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateOrganization = { - name: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/CreateOrtRun.ts b/ui/src/api/requests/models/CreateOrtRun.ts deleted file mode 100644 index d879b0ea8..000000000 --- a/ui/src/api/requests/models/CreateOrtRun.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateOrtRun = { - revision: string; - path?: Record; - jobConfigs: { - analyzer?: { - allowDynamicVersions?: boolean; - disabledPackageManagers?: Record; - enabledPackageManagers?: Record; - environmentConfig?: { - infrastructureServices: Array<{ - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; - }>; - environmentDefinitions?: Record>>; - environmentVariables?: Array<{ - name: string; - secretName: string; - }>; - strict?: boolean; - }; - packageCurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - packageManagerOptions?: Record< - string, - { - mustRunAfter?: Record; - options?: Record; - } - >; - repositoryConfigPath?: Record; - skipExcluded?: Record; - }; - advisor?: { - advisors?: Array; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - scanner?: { - createMissingArchives?: Record; - detectedLicenseMappings?: Record; - ignorePatterns?: Record; - projectScanners?: Record; - scanners?: Record; - skipConcluded?: Record; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - evaluator?: { - copyrightGarbageFile?: Record; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - ruleSet?: Record; - }; - reporter?: { - copyrightGarbageFile?: Record; - formats?: Array; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - assetFiles?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - assetDirectories?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - nameMappings?: Record< - string, - { - namePrefix: string; - } - >; - }; - notifier?: { - notifierRules?: Record; - resolutionsFile?: Record; - mail?: { - recipientAddresses?: Record; - mailServerConfiguration?: { - hostName: string; - port: number; - username: string; - password: string; - useSsl: boolean; - fromAddress: string; - }; - }; - }; - parameters?: Record; - }; - labels?: Record; - jobConfigContext?: Record; -}; diff --git a/ui/src/api/requests/models/CreateProduct.ts b/ui/src/api/requests/models/CreateProduct.ts deleted file mode 100644 index f40d60132..000000000 --- a/ui/src/api/requests/models/CreateProduct.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateProduct = { - name: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/CreateRepository.ts b/ui/src/api/requests/models/CreateRepository.ts deleted file mode 100644 index caa792f0e..000000000 --- a/ui/src/api/requests/models/CreateRepository.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateRepository = { - type: CreateRepository.type; - url: string; -}; - -export namespace CreateRepository { - export enum type { - GIT = 'GIT', - GIT_REPO = 'GIT_REPO', - MERCURIAL = 'MERCURIAL', - SUBVERSION = 'SUBVERSION', - CVS = 'CVS', - } -} diff --git a/ui/src/api/requests/models/CreateSecret.ts b/ui/src/api/requests/models/CreateSecret.ts deleted file mode 100644 index 7dd6eb4e3..000000000 --- a/ui/src/api/requests/models/CreateSecret.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type CreateSecret = { - name: string; - value: string; - description: Record; -}; diff --git a/ui/src/api/requests/models/InfrastructureService.ts b/ui/src/api/requests/models/InfrastructureService.ts deleted file mode 100644 index 37f32872c..000000000 --- a/ui/src/api/requests/models/InfrastructureService.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type InfrastructureService = { - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; -}; diff --git a/ui/src/api/requests/models/Liveness.ts b/ui/src/api/requests/models/Liveness.ts deleted file mode 100644 index 0591bf5fd..000000000 --- a/ui/src/api/requests/models/Liveness.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Liveness = { - message: string; -}; diff --git a/ui/src/api/requests/models/Organization.ts b/ui/src/api/requests/models/Organization.ts deleted file mode 100644 index 570145c0d..000000000 --- a/ui/src/api/requests/models/Organization.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Organization = { - id: number; - name: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/OrtRun.ts b/ui/src/api/requests/models/OrtRun.ts deleted file mode 100644 index 46eaf4924..000000000 --- a/ui/src/api/requests/models/OrtRun.ts +++ /dev/null @@ -1,471 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type OrtRun = { - id: number; - index: number; - repositoryId: number; - revision: string; - path?: Record; - createdAt: string; - finishedAt?: Record; - jobConfigs: { - analyzer?: { - allowDynamicVersions?: boolean; - disabledPackageManagers?: Record; - enabledPackageManagers?: Record; - environmentConfig?: { - infrastructureServices: Array<{ - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; - }>; - environmentDefinitions?: Record>>; - environmentVariables?: Array<{ - name: string; - secretName: string; - }>; - strict?: boolean; - }; - packageCurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - packageManagerOptions?: Record< - string, - { - mustRunAfter?: Record; - options?: Record; - } - >; - repositoryConfigPath?: Record; - skipExcluded?: Record; - }; - advisor?: { - advisors?: Array; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - scanner?: { - createMissingArchives?: Record; - detectedLicenseMappings?: Record; - ignorePatterns?: Record; - projectScanners?: Record; - scanners?: Record; - skipConcluded?: Record; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - evaluator?: { - copyrightGarbageFile?: Record; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - ruleSet?: Record; - }; - reporter?: { - copyrightGarbageFile?: Record; - formats?: Array; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - assetFiles?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - assetDirectories?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - nameMappings?: Record< - string, - { - namePrefix: string; - } - >; - }; - notifier?: { - notifierRules?: Record; - resolutionsFile?: Record; - mail?: { - recipientAddresses?: Record; - mailServerConfiguration?: { - hostName: string; - port: number; - username: string; - password: string; - useSsl: boolean; - fromAddress: string; - }; - }; - }; - parameters?: Record; - }; - resolvedJobConfigs?: { - analyzer?: { - allowDynamicVersions?: boolean; - disabledPackageManagers?: Record; - enabledPackageManagers?: Record; - environmentConfig?: { - infrastructureServices: Array<{ - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; - }>; - environmentDefinitions?: Record>>; - environmentVariables?: Array<{ - name: string; - secretName: string; - }>; - strict?: boolean; - }; - packageCurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - packageManagerOptions?: Record< - string, - { - mustRunAfter?: Record; - options?: Record; - } - >; - repositoryConfigPath?: Record; - skipExcluded?: Record; - }; - advisor?: { - advisors?: Array; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - scanner?: { - createMissingArchives?: Record; - detectedLicenseMappings?: Record; - ignorePatterns?: Record; - projectScanners?: Record; - scanners?: Record; - skipConcluded?: Record; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - evaluator?: { - copyrightGarbageFile?: Record; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - ruleSet?: Record; - }; - reporter?: { - copyrightGarbageFile?: Record; - formats?: Array; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - assetFiles?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - assetDirectories?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - nameMappings?: Record< - string, - { - namePrefix: string; - } - >; - }; - notifier?: { - notifierRules?: Record; - resolutionsFile?: Record; - mail?: { - recipientAddresses?: Record; - mailServerConfiguration?: { - hostName: string; - port: number; - username: string; - password: string; - useSsl: boolean; - fromAddress: string; - }; - }; - }; - parameters?: Record; - }; - jobs: { - analyzer?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - allowDynamicVersions?: boolean; - disabledPackageManagers?: Record; - enabledPackageManagers?: Record; - environmentConfig?: { - infrastructureServices: Array<{ - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; - }>; - environmentDefinitions?: Record< - string, - Array> - >; - environmentVariables?: Array<{ - name: string; - secretName: string; - }>; - strict?: boolean; - }; - packageCurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - packageManagerOptions?: Record< - string, - { - mustRunAfter?: Record; - options?: Record; - } - >; - repositoryConfigPath?: Record; - skipExcluded?: Record; - }; - status: OrtRun.status; - }; - advisor?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - advisors?: Array; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - status: OrtRun.status; - }; - scanner?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - createMissingArchives?: Record; - detectedLicenseMappings?: Record; - ignorePatterns?: Record; - projectScanners?: Record; - scanners?: Record; - skipConcluded?: Record; - skipExcluded?: boolean; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - }; - status: OrtRun.status; - }; - evaluator?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - copyrightGarbageFile?: Record; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - ruleSet?: Record; - }; - status: OrtRun.status; - }; - reporter?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - copyrightGarbageFile?: Record; - formats?: Array; - licenseClassificationsFile?: Record; - packageConfigurationProviders?: Array<{ - type: string; - id?: string; - enabled?: boolean; - options?: Record; - secrets?: Record; - }>; - resolutionsFile?: Record; - assetFiles?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - assetDirectories?: Array<{ - sourcePath: string; - targetFolder?: Record; - targetName?: Record; - }>; - config?: Record< - string, - { - options: Record; - secrets: Record; - } - >; - nameMappings?: Record< - string, - { - namePrefix: string; - } - >; - }; - status: OrtRun.status; - reportFilenames?: Record; - }; - notifier?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - configuration: { - notifierRules?: Record; - resolutionsFile?: Record; - mail?: { - recipientAddresses?: Record; - mailServerConfiguration?: { - hostName: string; - port: number; - username: string; - password: string; - useSsl: boolean; - fromAddress: string; - }; - }; - }; - status: OrtRun.status; - }; - }; - status: OrtRun.status; - labels: Record; - issues: Array<{ - timestamp: string; - source: string; - message: string; - severity: string; - }>; - jobConfigContext?: Record; - resolvedJobConfigContext?: Record; -}; - -export namespace OrtRun { - export enum status { - CREATED = 'CREATED', - SCHEDULED = 'SCHEDULED', - RUNNING = 'RUNNING', - FAILED = 'FAILED', - FINISHED = 'FINISHED', - } -} diff --git a/ui/src/api/requests/models/Product.ts b/ui/src/api/requests/models/Product.ts deleted file mode 100644 index dd6ac4eae..000000000 --- a/ui/src/api/requests/models/Product.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Product = { - id: number; - name: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/Repository.ts b/ui/src/api/requests/models/Repository.ts deleted file mode 100644 index a8e72a6d1..000000000 --- a/ui/src/api/requests/models/Repository.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Repository = { - id: number; - type: Repository.type; - url: string; -}; - -export namespace Repository { - export enum type { - GIT = 'GIT', - GIT_REPO = 'GIT_REPO', - MERCURIAL = 'MERCURIAL', - SUBVERSION = 'SUBVERSION', - CVS = 'CVS', - } -} diff --git a/ui/src/api/requests/models/Secret.ts b/ui/src/api/requests/models/Secret.ts deleted file mode 100644 index 7dbbd65a3..000000000 --- a/ui/src/api/requests/models/Secret.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type Secret = { - name: string; - description: Record; -}; diff --git a/ui/src/api/requests/models/UpdateInfrastructureService.ts b/ui/src/api/requests/models/UpdateInfrastructureService.ts deleted file mode 100644 index 4a3e532f1..000000000 --- a/ui/src/api/requests/models/UpdateInfrastructureService.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type UpdateInfrastructureService = { - url?: string; - description?: Record; - usernameSecretRef?: string; - passwordSecretRef?: string; - excludeFromNetrc?: boolean; -}; diff --git a/ui/src/api/requests/models/UpdateOrganization.ts b/ui/src/api/requests/models/UpdateOrganization.ts deleted file mode 100644 index cdbad3611..000000000 --- a/ui/src/api/requests/models/UpdateOrganization.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type UpdateOrganization = { - name?: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/UpdateProduct.ts b/ui/src/api/requests/models/UpdateProduct.ts deleted file mode 100644 index 5d37345f7..000000000 --- a/ui/src/api/requests/models/UpdateProduct.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type UpdateProduct = { - name?: string; - description?: Record; -}; diff --git a/ui/src/api/requests/models/UpdateRepository.ts b/ui/src/api/requests/models/UpdateRepository.ts deleted file mode 100644 index 602b3511c..000000000 --- a/ui/src/api/requests/models/UpdateRepository.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type UpdateRepository = { - type?: UpdateRepository.type; - url?: string; -}; - -export namespace UpdateRepository { - export enum type { - GIT = 'GIT', - GIT_REPO = 'GIT_REPO', - MERCURIAL = 'MERCURIAL', - SUBVERSION = 'SUBVERSION', - CVS = 'CVS', - } -} diff --git a/ui/src/api/requests/models/UpdateSecret.ts b/ui/src/api/requests/models/UpdateSecret.ts deleted file mode 100644 index 772415a92..000000000 --- a/ui/src/api/requests/models/UpdateSecret.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type UpdateSecret = { - name?: string; - value?: string; - description?: string; -}; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_.ts deleted file mode 100644 index 3ad86c037..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ = - { - data: Array<{ - name: string; - url: string; - description?: Record; - usernameSecretRef: string; - passwordSecretRef: string; - excludeFromNetrc?: boolean; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_.ts deleted file mode 100644 index bdda174d3..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ = - { - data: Array<{ - id: number; - name: string; - description?: Record; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_.ts deleted file mode 100644 index 18544a822..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ = - { - data: Array<{ - id: number; - index: number; - repositoryId: number; - revision: string; - path?: Record; - createdAt: string; - finishedAt?: Record; - jobs: { - analyzer?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; - }; - advisor?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; - }; - scanner?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; - }; - evaluator?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; - }; - reporter?: { - id: number; - createdAt: string; - startedAt?: Record; - finishedAt?: Record; - status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; - }; - }; - status: 'CREATED' | 'ACTIVE' | 'FINISHED' | 'FAILED'; - labels: Record; - jobConfigContext?: Record; - resolvedJobConfigContext?: Record; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_.ts deleted file mode 100644 index 92684a39c..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ = - { - data: Array<{ - id: number; - name: string; - description?: Record; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_.ts deleted file mode 100644 index d821903fc..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ = - { - data: Array<{ - id: number; - type: 'GIT' | 'GIT_REPO' | 'MERCURIAL' | 'SUBVERSION' | 'CVS'; - url: string; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_.ts b/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_.ts deleted file mode 100644 index d0a712372..000000000 --- a/ui/src/api/requests/models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ = - { - data: Array<{ - name: string; - description: Record; - }>; - options: { - limit?: Record; - offset?: Record; - sortProperties?: Record; - }; - }; diff --git a/ui/src/api/requests/schemas.gen.ts b/ui/src/api/requests/schemas.gen.ts new file mode 100644 index 000000000..105de1cec --- /dev/null +++ b/ui/src/api/requests/schemas.gen.ts @@ -0,0 +1,3199 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const $Liveness = { + required: ['message'], + type: 'object', + properties: { + message: { + type: 'string', + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: ['id', 'name'], + type: 'object', + properties: { + id: { + type: 'number', + }, + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $CreateOrganization = { + required: ['name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $Organization = { + required: ['id', 'name'], + type: 'object', + properties: { + id: { + type: 'number', + }, + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $UpdateOrganization = { + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: ['id', 'name'], + type: 'object', + properties: { + id: { + type: 'number', + }, + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $CreateProduct = { + required: ['name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $Product = { + required: ['id', 'name'], + type: 'object', + properties: { + id: { + type: 'number', + }, + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: ['description', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $Secret = { + required: ['description', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $UpdateSecret = { + type: 'object', + properties: { + name: { + type: 'string', + }, + value: { + type: 'string', + }, + description: { + type: 'string', + }, + }, +} as const; + +export const $CreateSecret = { + required: ['description', 'name', 'value'], + type: 'object', + properties: { + name: { + type: 'string', + }, + value: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: ['name', 'passwordSecretRef', 'url', 'usernameSecretRef'], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $CreateInfrastructureService = { + required: ['name', 'passwordSecretRef', 'url', 'usernameSecretRef'], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, +} as const; + +export const $InfrastructureService = { + required: ['name', 'passwordSecretRef', 'url', 'usernameSecretRef'], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, +} as const; + +export const $UpdateInfrastructureService = { + type: 'object', + properties: { + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, +} as const; + +export const $UpdateProduct = { + type: 'object', + properties: { + name: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: ['id', 'type', 'url'], + type: 'object', + properties: { + id: { + type: 'number', + }, + type: { + type: 'string', + enum: ['GIT', 'GIT_REPO', 'MERCURIAL', 'SUBVERSION', 'CVS'], + }, + url: { + type: 'string', + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $CreateRepository = { + required: ['type', 'url'], + type: 'object', + properties: { + type: { + type: 'string', + enum: ['GIT', 'GIT_REPO', 'MERCURIAL', 'SUBVERSION', 'CVS'], + }, + url: { + type: 'string', + }, + }, +} as const; + +export const $Repository = { + required: ['id', 'type', 'url'], + type: 'object', + properties: { + id: { + type: 'number', + }, + type: { + type: 'string', + enum: ['GIT', 'GIT_REPO', 'MERCURIAL', 'SUBVERSION', 'CVS'], + }, + url: { + type: 'string', + }, + }, +} as const; + +export const $UpdateRepository = { + type: 'object', + properties: { + type: { + type: 'string', + enum: ['GIT', 'GIT_REPO', 'MERCURIAL', 'SUBVERSION', 'CVS'], + }, + url: { + type: 'string', + }, + }, +} as const; + +export const $org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ = + { + required: ['data', 'options'], + type: 'object', + properties: { + data: { + type: 'array', + items: { + required: [ + 'createdAt', + 'id', + 'index', + 'jobs', + 'labels', + 'repositoryId', + 'revision', + 'status', + ], + type: 'object', + properties: { + id: { + type: 'number', + }, + index: { + type: 'number', + }, + repositoryId: { + type: 'number', + }, + revision: { + type: 'string', + }, + path: { + type: 'string', + nullable: true, + }, + createdAt: { + type: 'string', + }, + finishedAt: { + type: 'string', + nullable: true, + }, + jobs: { + type: 'object', + properties: { + analyzer: { + required: ['createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + status: { + type: 'string', + enum: [ + 'CREATED', + 'SCHEDULED', + 'RUNNING', + 'FAILED', + 'FINISHED', + ], + }, + }, + nullable: true, + }, + advisor: { + required: ['createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + status: { + type: 'string', + enum: [ + 'CREATED', + 'SCHEDULED', + 'RUNNING', + 'FAILED', + 'FINISHED', + ], + }, + }, + nullable: true, + }, + scanner: { + required: ['createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + status: { + type: 'string', + enum: [ + 'CREATED', + 'SCHEDULED', + 'RUNNING', + 'FAILED', + 'FINISHED', + ], + }, + }, + nullable: true, + }, + evaluator: { + required: ['createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + status: { + type: 'string', + enum: [ + 'CREATED', + 'SCHEDULED', + 'RUNNING', + 'FAILED', + 'FINISHED', + ], + }, + }, + nullable: true, + }, + reporter: { + required: ['createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + status: { + type: 'string', + enum: [ + 'CREATED', + 'SCHEDULED', + 'RUNNING', + 'FAILED', + 'FINISHED', + ], + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'ACTIVE', 'FINISHED', 'FAILED'], + }, + labels: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + jobConfigContext: { + type: 'string', + nullable: true, + }, + resolvedJobConfigContext: { + type: 'string', + nullable: true, + }, + }, + }, + }, + options: { + type: 'object', + properties: { + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sortProperties: { + type: 'array', + nullable: true, + items: { + required: ['direction', 'name'], + type: 'object', + properties: { + name: { + type: 'string', + }, + direction: { + type: 'string', + enum: ['ASCENDING', 'DESCENDING'], + }, + }, + }, + }, + }, + }, + }, + } as const; + +export const $CreateOrtRun = { + required: ['jobConfigs', 'revision'], + type: 'object', + properties: { + revision: { + type: 'string', + }, + path: { + type: 'string', + nullable: true, + }, + jobConfigs: { + type: 'object', + properties: { + analyzer: { + type: 'object', + properties: { + allowDynamicVersions: { + type: 'boolean', + }, + disabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + enabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + environmentConfig: { + required: ['infrastructureServices'], + type: 'object', + properties: { + infrastructureServices: { + type: 'array', + items: { + required: [ + 'name', + 'passwordSecretRef', + 'url', + 'usernameSecretRef', + ], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, + }, + }, + environmentDefinitions: { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + environmentVariables: { + type: 'array', + items: { + required: ['name', 'secretName'], + type: 'object', + properties: { + name: { + type: 'string', + }, + secretName: { + type: 'string', + }, + }, + }, + }, + strict: { + type: 'boolean', + }, + }, + nullable: true, + }, + packageCurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + packageManagerOptions: { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + mustRunAfter: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + }, + }, + nullable: true, + }, + repositoryConfigPath: { + type: 'string', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + nullable: true, + }, + }, + }, + advisor: { + type: 'object', + properties: { + advisors: { + type: 'array', + items: { + type: 'string', + }, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + scanner: { + type: 'object', + properties: { + createMissingArchives: { + type: 'boolean', + nullable: true, + }, + detectedLicenseMappings: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + ignorePatterns: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + projectScanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + scanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + skipConcluded: { + type: 'boolean', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + evaluator: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + ruleSet: { + type: 'string', + nullable: true, + }, + }, + nullable: true, + }, + reporter: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + formats: { + type: 'array', + items: { + type: 'string', + }, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + customLicenseTextDir: { + type: 'string', + nullable: true, + }, + assetFiles: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + assetDirectories: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + nameMappings: { + type: 'object', + additionalProperties: { + required: ['namePrefix'], + type: 'object', + properties: { + namePrefix: { + type: 'string', + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + notifier: { + type: 'object', + properties: { + notifierRules: { + type: 'string', + nullable: true, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + mail: { + type: 'object', + properties: { + recipientAddresses: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + mailServerConfiguration: { + required: [ + 'fromAddress', + 'hostName', + 'password', + 'port', + 'useSsl', + 'username', + ], + type: 'object', + properties: { + hostName: { + type: 'string', + }, + port: { + type: 'number', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + useSsl: { + type: 'boolean', + }, + fromAddress: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + jira: { + type: 'object', + properties: { + jiraRestClientConfiguration: { + required: ['password', 'serverUrl', 'username'], + type: 'object', + properties: { + serverUrl: { + type: 'string', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + parameters: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + labels: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + jobConfigContext: { + type: 'string', + nullable: true, + }, + }, +} as const; + +export const $OrtRun = { + required: [ + 'createdAt', + 'id', + 'index', + 'issues', + 'jobConfigs', + 'jobs', + 'labels', + 'repositoryId', + 'revision', + 'status', + ], + type: 'object', + properties: { + id: { + type: 'number', + }, + index: { + type: 'number', + }, + repositoryId: { + type: 'number', + }, + revision: { + type: 'string', + }, + path: { + type: 'string', + nullable: true, + }, + createdAt: { + type: 'string', + }, + finishedAt: { + type: 'string', + nullable: true, + }, + jobConfigs: { + type: 'object', + properties: { + analyzer: { + type: 'object', + properties: { + allowDynamicVersions: { + type: 'boolean', + }, + disabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + enabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + environmentConfig: { + required: ['infrastructureServices'], + type: 'object', + properties: { + infrastructureServices: { + type: 'array', + items: { + required: [ + 'name', + 'passwordSecretRef', + 'url', + 'usernameSecretRef', + ], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, + }, + }, + environmentDefinitions: { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + environmentVariables: { + type: 'array', + items: { + required: ['name', 'secretName'], + type: 'object', + properties: { + name: { + type: 'string', + }, + secretName: { + type: 'string', + }, + }, + }, + }, + strict: { + type: 'boolean', + }, + }, + nullable: true, + }, + packageCurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + packageManagerOptions: { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + mustRunAfter: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + }, + }, + nullable: true, + }, + repositoryConfigPath: { + type: 'string', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + nullable: true, + }, + }, + }, + advisor: { + type: 'object', + properties: { + advisors: { + type: 'array', + items: { + type: 'string', + }, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + scanner: { + type: 'object', + properties: { + createMissingArchives: { + type: 'boolean', + nullable: true, + }, + detectedLicenseMappings: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + ignorePatterns: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + projectScanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + scanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + skipConcluded: { + type: 'boolean', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + evaluator: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + ruleSet: { + type: 'string', + nullable: true, + }, + }, + nullable: true, + }, + reporter: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + formats: { + type: 'array', + items: { + type: 'string', + }, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + customLicenseTextDir: { + type: 'string', + nullable: true, + }, + assetFiles: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + assetDirectories: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + nameMappings: { + type: 'object', + additionalProperties: { + required: ['namePrefix'], + type: 'object', + properties: { + namePrefix: { + type: 'string', + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + notifier: { + type: 'object', + properties: { + notifierRules: { + type: 'string', + nullable: true, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + mail: { + type: 'object', + properties: { + recipientAddresses: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + mailServerConfiguration: { + required: [ + 'fromAddress', + 'hostName', + 'password', + 'port', + 'useSsl', + 'username', + ], + type: 'object', + properties: { + hostName: { + type: 'string', + }, + port: { + type: 'number', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + useSsl: { + type: 'boolean', + }, + fromAddress: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + jira: { + type: 'object', + properties: { + jiraRestClientConfiguration: { + required: ['password', 'serverUrl', 'username'], + type: 'object', + properties: { + serverUrl: { + type: 'string', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + parameters: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + resolvedJobConfigs: { + type: 'object', + properties: { + analyzer: { + type: 'object', + properties: { + allowDynamicVersions: { + type: 'boolean', + }, + disabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + enabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + environmentConfig: { + required: ['infrastructureServices'], + type: 'object', + properties: { + infrastructureServices: { + type: 'array', + items: { + required: [ + 'name', + 'passwordSecretRef', + 'url', + 'usernameSecretRef', + ], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, + }, + }, + environmentDefinitions: { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + environmentVariables: { + type: 'array', + items: { + required: ['name', 'secretName'], + type: 'object', + properties: { + name: { + type: 'string', + }, + secretName: { + type: 'string', + }, + }, + }, + }, + strict: { + type: 'boolean', + }, + }, + nullable: true, + }, + packageCurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + packageManagerOptions: { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + mustRunAfter: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + }, + }, + nullable: true, + }, + repositoryConfigPath: { + type: 'string', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + nullable: true, + }, + }, + }, + advisor: { + type: 'object', + properties: { + advisors: { + type: 'array', + items: { + type: 'string', + }, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + scanner: { + type: 'object', + properties: { + createMissingArchives: { + type: 'boolean', + nullable: true, + }, + detectedLicenseMappings: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + ignorePatterns: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + projectScanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + scanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + skipConcluded: { + type: 'boolean', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + evaluator: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + ruleSet: { + type: 'string', + nullable: true, + }, + }, + nullable: true, + }, + reporter: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + formats: { + type: 'array', + items: { + type: 'string', + }, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + customLicenseTextDir: { + type: 'string', + nullable: true, + }, + assetFiles: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + assetDirectories: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + nameMappings: { + type: 'object', + additionalProperties: { + required: ['namePrefix'], + type: 'object', + properties: { + namePrefix: { + type: 'string', + }, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + notifier: { + type: 'object', + properties: { + notifierRules: { + type: 'string', + nullable: true, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + mail: { + type: 'object', + properties: { + recipientAddresses: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + mailServerConfiguration: { + required: [ + 'fromAddress', + 'hostName', + 'password', + 'port', + 'useSsl', + 'username', + ], + type: 'object', + properties: { + hostName: { + type: 'string', + }, + port: { + type: 'number', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + useSsl: { + type: 'boolean', + }, + fromAddress: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + jira: { + type: 'object', + properties: { + jiraRestClientConfiguration: { + required: ['password', 'serverUrl', 'username'], + type: 'object', + properties: { + serverUrl: { + type: 'string', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + parameters: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + nullable: true, + }, + jobs: { + type: 'object', + properties: { + analyzer: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + allowDynamicVersions: { + type: 'boolean', + }, + disabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + enabledPackageManagers: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + environmentConfig: { + required: ['infrastructureServices'], + type: 'object', + properties: { + infrastructureServices: { + type: 'array', + items: { + required: [ + 'name', + 'passwordSecretRef', + 'url', + 'usernameSecretRef', + ], + type: 'object', + properties: { + name: { + type: 'string', + }, + url: { + type: 'string', + }, + description: { + type: 'string', + nullable: true, + }, + usernameSecretRef: { + type: 'string', + }, + passwordSecretRef: { + type: 'string', + }, + excludeFromNetrc: { + type: 'boolean', + }, + }, + }, + }, + environmentDefinitions: { + type: 'object', + additionalProperties: { + type: 'array', + items: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + environmentVariables: { + type: 'array', + items: { + required: ['name', 'secretName'], + type: 'object', + properties: { + name: { + type: 'string', + }, + secretName: { + type: 'string', + }, + }, + }, + }, + strict: { + type: 'boolean', + }, + }, + nullable: true, + }, + packageCurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + packageManagerOptions: { + type: 'object', + additionalProperties: { + type: 'object', + properties: { + mustRunAfter: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + }, + }, + nullable: true, + }, + repositoryConfigPath: { + type: 'string', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + }, + nullable: true, + }, + advisor: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + advisors: { + type: 'array', + items: { + type: 'string', + }, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + }, + nullable: true, + }, + scanner: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + createMissingArchives: { + type: 'boolean', + nullable: true, + }, + detectedLicenseMappings: { + type: 'object', + additionalProperties: { + type: 'string', + }, + nullable: true, + }, + ignorePatterns: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + projectScanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + scanners: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + skipConcluded: { + type: 'boolean', + nullable: true, + }, + skipExcluded: { + type: 'boolean', + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + }, + nullable: true, + }, + evaluator: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + ruleSet: { + type: 'string', + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + }, + nullable: true, + }, + reporter: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + copyrightGarbageFile: { + type: 'string', + nullable: true, + }, + formats: { + type: 'array', + items: { + type: 'string', + }, + }, + licenseClassificationsFile: { + type: 'string', + nullable: true, + }, + packageConfigurationProviders: { + type: 'array', + items: { + required: ['type'], + type: 'object', + properties: { + type: { + type: 'string', + }, + id: { + type: 'string', + }, + enabled: { + type: 'boolean', + }, + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + customLicenseTextDir: { + type: 'string', + nullable: true, + }, + assetFiles: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + assetDirectories: { + type: 'array', + items: { + required: ['sourcePath'], + type: 'object', + properties: { + sourcePath: { + type: 'string', + }, + targetFolder: { + type: 'string', + nullable: true, + }, + targetName: { + type: 'string', + nullable: true, + }, + }, + }, + }, + config: { + type: 'object', + additionalProperties: { + required: ['options', 'secrets'], + type: 'object', + properties: { + options: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + nullable: true, + }, + nameMappings: { + type: 'object', + additionalProperties: { + required: ['namePrefix'], + type: 'object', + properties: { + namePrefix: { + type: 'string', + }, + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + reportFilenames: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + }, + nullable: true, + }, + notifier: { + required: ['configuration', 'createdAt', 'id', 'status'], + type: 'object', + properties: { + id: { + type: 'number', + }, + createdAt: { + type: 'string', + }, + startedAt: { + type: 'string', + nullable: true, + }, + finishedAt: { + type: 'string', + nullable: true, + }, + configuration: { + type: 'object', + properties: { + notifierRules: { + type: 'string', + nullable: true, + }, + resolutionsFile: { + type: 'string', + nullable: true, + }, + mail: { + type: 'object', + properties: { + recipientAddresses: { + type: 'array', + nullable: true, + items: { + type: 'string', + }, + }, + mailServerConfiguration: { + required: [ + 'fromAddress', + 'hostName', + 'password', + 'port', + 'useSsl', + 'username', + ], + type: 'object', + properties: { + hostName: { + type: 'string', + }, + port: { + type: 'number', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + useSsl: { + type: 'boolean', + }, + fromAddress: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + jira: { + type: 'object', + properties: { + jiraRestClientConfiguration: { + required: ['password', 'serverUrl', 'username'], + type: 'object', + properties: { + serverUrl: { + type: 'string', + }, + username: { + type: 'string', + }, + password: { + type: 'string', + }, + }, + nullable: true, + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'SCHEDULED', 'RUNNING', 'FAILED', 'FINISHED'], + }, + }, + nullable: true, + }, + }, + }, + status: { + type: 'string', + enum: ['CREATED', 'ACTIVE', 'FINISHED', 'FAILED'], + }, + labels: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + issues: { + type: 'array', + items: { + required: ['message', 'severity', 'source', 'timestamp'], + type: 'object', + properties: { + timestamp: { + type: 'string', + }, + source: { + type: 'string', + }, + message: { + type: 'string', + }, + severity: { + type: 'string', + }, + }, + }, + }, + jobConfigContext: { + type: 'string', + nullable: true, + }, + resolvedJobConfigContext: { + type: 'string', + nullable: true, + }, + }, +} as const; diff --git a/ui/src/api/requests/services.gen.ts b/ui/src/api/requests/services.gen.ts new file mode 100644 index 000000000..08ac588ec --- /dev/null +++ b/ui/src/api/requests/services.gen.ts @@ -0,0 +1,1120 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { CancelablePromise } from './core/CancelablePromise'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; +import type { + GetLivenessResponse, + GetReportByRunIdAndTokenData, + GetReportByRunIdAndTokenResponse, + GetReportByRunIdAndFileNameData, + GetReportByRunIdAndFileNameResponse, + GetOrganizationsData, + GetOrganizationsResponse, + PostOrganizationsData, + PostOrganizationsResponse, + GetOrganizationByIdData, + GetOrganizationByIdResponse, + DeleteOrganizationByIdData, + DeleteOrganizationByIdResponse, + PatchOrganizationByIdData, + PatchOrganizationByIdResponse, + GetOrganizationProductsData, + GetOrganizationProductsResponse, + PostProductData, + PostProductResponse, + GetProductByIdData, + GetProductByIdResponse, + DeleteProductByIdData, + DeleteProductByIdResponse, + PatchProductByIdData, + PatchProductByIdResponse, + GetSecretsByOrganizationIdData, + GetSecretsByOrganizationIdResponse, + PostSecretForOrganizationData, + PostSecretForOrganizationResponse, + GetSecretByOrganizationIdAndNameData, + GetSecretByOrganizationIdAndNameResponse, + DeleteSecretByOrganizationIdAndNameData, + DeleteSecretByOrganizationIdAndNameResponse, + PatchSecretByOrganizationIdAndNameData, + PatchSecretByOrganizationIdAndNameResponse, + GetSecretsByProductIdData, + GetSecretsByProductIdResponse, + PostSecretForProductData, + PostSecretForProductResponse, + GetSecretByProductIdAndNameData, + GetSecretByProductIdAndNameResponse, + DeleteSecretByProductIdAndNameData, + DeleteSecretByProductIdAndNameResponse, + PatchSecretByProductIdIdAndNameData, + PatchSecretByProductIdIdAndNameResponse, + GetSecretsByRepositoryIdData, + GetSecretsByRepositoryIdResponse, + PostSecretForRepositoryData, + PostSecretForRepositoryResponse, + GetSecretByRepositoryIdAndNameData, + GetSecretByRepositoryIdAndNameResponse, + DeleteSecretByRepositoryIdAndNameData, + DeleteSecretByRepositoryIdAndNameResponse, + PatchSecretByRepositoryIdIdAndNameData, + PatchSecretByRepositoryIdIdAndNameResponse, + GetInfrastructureServicesByOrganizationIdData, + GetInfrastructureServicesByOrganizationIdResponse, + PostInfrastructureServiceForOrganizationData, + PostInfrastructureServiceForOrganizationResponse, + DeleteInfrastructureServiceForOrganizationIdAndNameData, + DeleteInfrastructureServiceForOrganizationIdAndNameResponse, + PatchInfrastructureServiceForOrganizationIdAndNameData, + PatchInfrastructureServiceForOrganizationIdAndNameResponse, + GetRepositoriesByProductIdData, + GetRepositoriesByProductIdResponse, + CreateRepositoryData, + CreateRepositoryResponse, + GetRepositoryByIdData, + GetRepositoryByIdResponse, + DeleteRepositoryByIdData, + DeleteRepositoryByIdResponse, + PatchRepositoryByIdData, + PatchRepositoryByIdResponse, + GetOrtRunsData, + GetOrtRunsResponse, + PostOrtRunData, + PostOrtRunResponse, + GetOrtRunByIndexData, + GetOrtRunByIndexResponse, + GetLogsByRunIdData, + GetLogsByRunIdResponse, +} from './types.gen'; + +export class HealthService { + /** + * Get the health of the ORT server. + * @returns Liveness Success + * @throws ApiError + */ + public static getLiveness(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/liveness', + }); + } +} + +export class ReportsService { + /** + * Download a report of an ORT run using a token. This endpoint does not require authentication. + * @param data The data for the request. + * @param data.runId The ID of the ORT run. + * @param data.token The token providing access to the report file to be downloaded. + * @returns string Success. The response body contains the requested report file. + * @throws ApiError + */ + public static getReportByRunIdAndToken( + data: GetReportByRunIdAndTokenData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/runs/{runId}/downloads/report/{token}', + path: { + runId: data.runId, + token: data.token, + }, + responseHeader: 'Content-Type', + errors: { + 404: 'The provided token could not be resolved or has expired.', + }, + }); + } + + /** + * Download a report of an ORT run. + * @param data The data for the request. + * @param data.runId The ID of the ORT run. + * @param data.fileName The name of the report file to be downloaded. + * @returns string Success. The response body contains the requested report file. + * @throws ApiError + */ + public static getReportByRunIdAndFileName( + data: GetReportByRunIdAndFileNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/runs/{runId}/reporter/{fileName}', + path: { + runId: data.runId, + fileName: data.fileName, + }, + responseHeader: 'Content-Type', + errors: { + 401: 'Invalid Token', + 404: 'The requested report file or the ORT run could not be resolved.', + }, + }); + } +} + +export class OrganizationsService { + /** + * Get all organizations. + * @param data The data for the request. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ Success + * @throws ApiError + */ + public static getOrganizations( + data: GetOrganizationsData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations', + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create an organization. + * @param data The data for the request. + * @param data.requestBody + * @returns Organization Success + * @throws ApiError + */ + public static postOrganizations( + data: PostOrganizationsData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/organizations', + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @returns Organization Success + * @throws ApiError + */ + public static getOrganizationById( + data: GetOrganizationByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations/{organizationId}', + path: { + organizationId: data.organizationId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @returns void Success + * @throws ApiError + */ + public static deleteOrganizationById( + data: DeleteOrganizationByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/organizations/{organizationId}', + path: { + organizationId: data.organizationId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Organization Success + * @throws ApiError + */ + public static patchOrganizationById( + data: PatchOrganizationByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/organizations/{organizationId}', + path: { + organizationId: data.organizationId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } +} + +export class ProductsService { + /** + * Get all products of an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ Success + * @throws ApiError + */ + public static getOrganizationProducts( + data: GetOrganizationProductsData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations/{organizationId}/products', + path: { + organizationId: data.organizationId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create a product for an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.requestBody + * @returns Product Success + * @throws ApiError + */ + public static postProduct( + data: PostProductData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/organizations/{organizationId}/products', + path: { + organizationId: data.organizationId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @returns Product Success + * @throws ApiError + */ + public static getProductById( + data: GetProductByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/products/{productId}', + path: { + productId: data.productId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @returns void Success + * @throws ApiError + */ + public static deleteProductById( + data: DeleteProductByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/products/{productId}', + path: { + productId: data.productId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Product Success + * @throws ApiError + */ + public static patchProductById( + data: PatchProductByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/products/{productId}', + path: { + productId: data.productId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } +} + +export class SecretsService { + /** + * Get all secrets of an organization. + * @param data The data for the request. + * @param data.organizationId The ID of an organization. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success + * @throws ApiError + */ + public static getSecretsByOrganizationId( + data: GetSecretsByOrganizationIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations/{organizationId}/secrets', + path: { + organizationId: data.organizationId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create a secret for an organization. + * @param data The data for the request. + * @param data.requestBody + * @returns Secret Success + * @throws ApiError + */ + public static postSecretForOrganization( + data: PostSecretForOrganizationData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/organizations/{organizationId}/secrets', + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of a secret of an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.secretName The secret's name. + * @returns Secret Success + * @throws ApiError + */ + public static getSecretByOrganizationIdAndName( + data: GetSecretByOrganizationIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', + path: { + organizationId: data.organizationId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete a secret from an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.secretName The secret's name. + * @returns void Success + * @throws ApiError + */ + public static deleteSecretByOrganizationIdAndName( + data: DeleteSecretByOrganizationIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', + path: { + organizationId: data.organizationId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update a secret of an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.secretName The secret's name. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Secret Success + * @throws ApiError + */ + public static patchSecretByOrganizationIdAndName( + data: PatchSecretByOrganizationIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', + path: { + organizationId: data.organizationId, + secretName: data.secretName, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get all secrets of a specific product. + * @param data The data for the request. + * @param data.productId The ID of a product. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success + * @throws ApiError + */ + public static getSecretsByProductId( + data: GetSecretsByProductIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/products/{productId}/secrets', + path: { + productId: data.productId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create a secret for a product. + * @param data The data for the request. + * @param data.requestBody + * @returns Secret Success + * @throws ApiError + */ + public static postSecretForProduct( + data: PostSecretForProductData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/products/{productId}/secrets', + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of a secret of a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.secretName The secret's name. + * @returns Secret Success + * @throws ApiError + */ + public static getSecretByProductIdAndName( + data: GetSecretByProductIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/products/{productId}/secrets/{secretName}', + path: { + productId: data.productId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete a secret from a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.secretName The secret's name. + * @returns void Success + * @throws ApiError + */ + public static deleteSecretByProductIdAndName( + data: DeleteSecretByProductIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/products/{productId}/secrets/{secretName}', + path: { + productId: data.productId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update a secret of a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.secretName The secret's name. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Secret Success + * @throws ApiError + */ + public static patchSecretByProductIdIdAndName( + data: PatchSecretByProductIdIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/products/{productId}/secrets/{secretName}', + path: { + productId: data.productId, + secretName: data.secretName, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get all secrets of a repository. + * @param data The data for the request. + * @param data.repositoryId The ID of a repository. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success + * @throws ApiError + */ + public static getSecretsByRepositoryId( + data: GetSecretsByRepositoryIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/repositories/{repositoryId}/secrets', + path: { + repositoryId: data.repositoryId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create a secret for a repository. + * @param data The data for the request. + * @param data.requestBody + * @returns Secret Success + * @throws ApiError + */ + public static postSecretForRepository( + data: PostSecretForRepositoryData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/repositories/{repositoryId}/secrets', + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of a secret of a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.secretName The secret's name. + * @returns Secret Success + * @throws ApiError + */ + public static getSecretByRepositoryIdAndName( + data: GetSecretByRepositoryIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', + path: { + repositoryId: data.repositoryId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete a secret from a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.secretName The secret's name. + * @returns void Success + * @throws ApiError + */ + public static deleteSecretByRepositoryIdAndName( + data: DeleteSecretByRepositoryIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', + path: { + repositoryId: data.repositoryId, + secretName: data.secretName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update a secret of a repository. + * @param data The data for the request. + * @param data.repositoryIdId The repository's ID. + * @param data.secretName The secret's name. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Secret Success + * @throws ApiError + */ + public static patchSecretByRepositoryIdIdAndName( + data: PatchSecretByRepositoryIdIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', + path: { + repositoryIdId: data.repositoryIdId, + secretName: data.secretName, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } +} + +export class InfrastructureServicesService { + /** + * List all infrastructure services of an organization. + * @param data The data for the request. + * @param data.organizationId The ID of an organization. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ Success + * @throws ApiError + */ + public static getInfrastructureServicesByOrganizationId( + data: GetInfrastructureServicesByOrganizationIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/organizations/{organizationId}/infrastructure-services', + path: { + organizationId: data.organizationId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create an infrastructure service for an organization. + * @param data The data for the request. + * @param data.requestBody + * @returns InfrastructureService Success + * @throws ApiError + */ + public static postInfrastructureServiceForOrganization( + data: PostInfrastructureServiceForOrganizationData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/organizations/{organizationId}/infrastructure-services', + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete an infrastructure service from an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.serviceName The name of the infrastructure service. + * @returns void Success + * @throws ApiError + */ + public static deleteInfrastructureServiceForOrganizationIdAndName( + data: DeleteInfrastructureServiceForOrganizationIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/organizations/{organizationId}/infrastructure-services/{serviceName}', + path: { + organizationId: data.organizationId, + serviceName: data.serviceName, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update an infrastructure service for an organization. + * @param data The data for the request. + * @param data.organizationId The organization's ID. + * @param data.serviceName The name of the infrastructure service. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns InfrastructureService Success + * @throws ApiError + */ + public static patchInfrastructureServiceForOrganizationIdAndName( + data: PatchInfrastructureServiceForOrganizationIdAndNameData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/organizations/{organizationId}/infrastructure-services/{serviceName}', + path: { + organizationId: data.organizationId, + serviceName: data.serviceName, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } +} + +export class RepositoriesService { + /** + * Get all repositories of a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ Success + * @throws ApiError + */ + public static getRepositoriesByProductId( + data: GetRepositoriesByProductIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/products/{productId}/repositories', + path: { + productId: data.productId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create a repository for a product. + * @param data The data for the request. + * @param data.productId The product's ID. + * @param data.requestBody + * @returns Repository Success + * @throws ApiError + */ + public static createRepository( + data: CreateRepositoryData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/products/{productId}/repositories', + path: { + productId: data.productId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @returns Repository Success + * @throws ApiError + */ + public static getRepositoryById( + data: GetRepositoryByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/repositories/{repositoryId}', + path: { + repositoryId: data.repositoryId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Delete a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @returns void Success + * @throws ApiError + */ + public static deleteRepositoryById( + data: DeleteRepositoryByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/repositories/{repositoryId}', + path: { + repositoryId: data.repositoryId, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Update a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.requestBody Set the values that should be updated. To delete a value, set it explicitly to null. + * @returns Repository Success + * @throws ApiError + */ + public static patchRepositoryById( + data: PatchRepositoryByIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/v1/repositories/{repositoryId}', + path: { + repositoryId: data.repositoryId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get all ORT runs of a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + * @param data.offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + * @param data.sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ Success + * @throws ApiError + */ + public static getOrtRuns( + data: GetOrtRunsData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/repositories/{repositoryId}/runs', + path: { + repositoryId: data.repositoryId, + }, + query: { + limit: data.limit, + offset: data.offset, + sort: data.sort, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Create an ORT run for a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.requestBody + * @returns OrtRun Success + * @throws ApiError + */ + public static postOrtRun( + data: PostOrtRunData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/repositories/{repositoryId}/runs', + path: { + repositoryId: data.repositoryId, + }, + body: data.requestBody, + mediaType: 'application/json', + errors: { + 401: 'Invalid Token', + }, + }); + } + + /** + * Get details of an ORT run of a repository. + * @param data The data for the request. + * @param data.repositoryId The repository's ID. + * @param data.ortRunIndex The index of an ORT run. + * @returns OrtRun Success + * @throws ApiError + */ + public static getOrtRunByIndex( + data: GetOrtRunByIndexData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/repositories/{repositoryId}/runs/{ortRunIndex}', + path: { + repositoryId: data.repositoryId, + ortRunIndex: data.ortRunIndex, + }, + errors: { + 401: 'Invalid Token', + }, + }); + } +} + +export class LogsService { + /** + * Download an archive with selected logs of an ORT run. + * @param data The data for the request. + * @param data.runId The ID of the ORT run. + * @param data.level The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. + * @param data.steps Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. + * @returns unknown Success. The response body contains a Zip archive with the selected log files. + * @throws ApiError + */ + public static getLogsByRunId( + data: GetLogsByRunIdData = {} + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/runs/{runId}/logs', + path: { + runId: data.runId, + }, + query: { + level: data.level, + steps: data.steps, + }, + errors: { + 400: 'Invalid values have been provided for the log level or steps parameters.', + 401: 'Invalid Token', + 404: 'The ORT run does not exist.', + }, + }); + } +} diff --git a/ui/src/api/requests/services/HealthService.ts b/ui/src/api/requests/services/HealthService.ts deleted file mode 100644 index 94702a6c3..000000000 --- a/ui/src/api/requests/services/HealthService.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Liveness } from '../models/Liveness'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class HealthService { - /** - * Get the health of the ORT server. - * @returns Liveness Success - * @throws ApiError - */ - public static getLiveness(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/liveness', - }); - } -} diff --git a/ui/src/api/requests/services/InfrastructureServicesService.ts b/ui/src/api/requests/services/InfrastructureServicesService.ts deleted file mode 100644 index 52a816bf9..000000000 --- a/ui/src/api/requests/services/InfrastructureServicesService.ts +++ /dev/null @@ -1,117 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateInfrastructureService } from '../models/CreateInfrastructureService'; -import type { InfrastructureService } from '../models/InfrastructureService'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_'; -import type { UpdateInfrastructureService } from '../models/UpdateInfrastructureService'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class InfrastructureServicesService { - /** - * List all infrastructure services of an organization. - * @param organizationId The ID of an organization. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ Success - * @throws ApiError - */ - public static getInfrastructureServicesByOrganizationId( - organizationId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations/{organizationId}/infrastructure-services', - path: { - organizationId: organizationId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create an infrastructure service for an organization. - * @param requestBody - * @returns InfrastructureService Success - * @throws ApiError - */ - public static postInfrastructureServiceForOrganization( - requestBody?: CreateInfrastructureService - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/organizations/{organizationId}/infrastructure-services', - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete an infrastructure service from an organization. - * @param organizationId The organization's ID. - * @param serviceName The name of the infrastructure service. - * @returns void - * @throws ApiError - */ - public static deleteInfrastructureServiceForOrganizationIdAndName( - organizationId?: number, - serviceName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/organizations/{organizationId}/infrastructure-services/{serviceName}', - path: { - organizationId: organizationId, - serviceName: serviceName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update an infrastructure service for an organization. - * @param organizationId The organization's ID. - * @param serviceName The name of the infrastructure service. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns InfrastructureService Success - * @throws ApiError - */ - public static patchInfrastructureServiceForOrganizationIdAndName( - organizationId?: number, - serviceName?: string, - requestBody?: UpdateInfrastructureService - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/organizations/{organizationId}/infrastructure-services/{serviceName}', - path: { - organizationId: organizationId, - serviceName: serviceName, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/LogsService.ts b/ui/src/api/requests/services/LogsService.ts deleted file mode 100644 index fd755fa9e..000000000 --- a/ui/src/api/requests/services/LogsService.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class LogsService { - /** - * Download an archive with selected logs of an ORT run. - * @param runId The ID of the ORT run. - * @param level The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. - * @param steps Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. - * @returns any Success. The response body contains a Zip archive with the selected log files. - * @throws ApiError - */ - public static getLogsByRunId( - runId?: number, - level?: string, - steps?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/runs/{runId}/logs', - path: { - runId: runId, - }, - query: { - level: level, - steps: steps, - }, - errors: { - 400: `Invalid values have been provided for the log level or steps parameters.`, - 401: `Invalid Token`, - 404: `The ORT run does not exist.`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/OrganizationsService.ts b/ui/src/api/requests/services/OrganizationsService.ts deleted file mode 100644 index ecca894f3..000000000 --- a/ui/src/api/requests/services/OrganizationsService.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateOrganization } from '../models/CreateOrganization'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_'; -import type { Organization } from '../models/Organization'; -import type { UpdateOrganization } from '../models/UpdateOrganization'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class OrganizationsService { - /** - * Get all organizations. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ Success - * @throws ApiError - */ - public static getOrganizations( - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations', - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create an organization. - * @param requestBody - * @returns Organization Success - * @throws ApiError - */ - public static postOrganizations( - requestBody?: CreateOrganization - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/organizations', - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of an organization. - * @param organizationId The organization's ID. - * @returns Organization Success - * @throws ApiError - */ - public static getOrganizationById( - organizationId?: number - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations/{organizationId}', - path: { - organizationId: organizationId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete an organization. - * @param organizationId The organization's ID. - * @returns void - * @throws ApiError - */ - public static deleteOrganizationById( - organizationId?: number - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/organizations/{organizationId}', - path: { - organizationId: organizationId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update an organization. - * @param organizationId The organization's ID. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Organization Success - * @throws ApiError - */ - public static patchOrganizationById( - organizationId?: number, - requestBody?: UpdateOrganization - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/organizations/{organizationId}', - path: { - organizationId: organizationId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/ProductsService.ts b/ui/src/api/requests/services/ProductsService.ts deleted file mode 100644 index 8b3b55e7a..000000000 --- a/ui/src/api/requests/services/ProductsService.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateProduct } from '../models/CreateProduct'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_'; -import type { Product } from '../models/Product'; -import type { UpdateProduct } from '../models/UpdateProduct'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class ProductsService { - /** - * Get all products of an organization. - * @param organizationId The organization's ID. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ Success - * @throws ApiError - */ - public static getOrganizationProducts( - organizationId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations/{organizationId}/products', - path: { - organizationId: organizationId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create a product for an organization. - * @param organizationId The organization's ID. - * @param requestBody - * @returns Product Success - * @throws ApiError - */ - public static postProduct( - organizationId?: number, - requestBody?: CreateProduct - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/organizations/{organizationId}/products', - path: { - organizationId: organizationId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of a product. - * @param productId The product's ID. - * @returns Product Success - * @throws ApiError - */ - public static getProductById(productId?: number): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/products/{productId}', - path: { - productId: productId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete a product. - * @param productId The product's ID. - * @returns void - * @throws ApiError - */ - public static deleteProductById(productId?: number): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/products/{productId}', - path: { - productId: productId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update a product. - * @param productId The product's ID. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Product Success - * @throws ApiError - */ - public static patchProductById( - productId?: number, - requestBody?: UpdateProduct - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/products/{productId}', - path: { - productId: productId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/ReportsService.ts b/ui/src/api/requests/services/ReportsService.ts deleted file mode 100644 index 52d2e230a..000000000 --- a/ui/src/api/requests/services/ReportsService.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class ReportsService { - /** - * Download a report of an ORT run using a token. This endpoint does not require authentication. - * @param runId The ID of the ORT run. - * @param token The token providing access to the report file to be downloaded. - * @returns string Success. The response body contains the requested report file. - * @throws ApiError - */ - public static getReportByRunIdAndToken( - runId?: number, - token?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/runs/{runId}/downloads/report/{token}', - path: { - runId: runId, - token: token, - }, - responseHeader: 'Content-Type', - errors: { - 404: `The provided token could not be resolved or has expired.`, - }, - }); - } - - /** - * Download a report of an ORT run. - * @param runId The ID of the ORT run. - * @param fileName The name of the report file to be downloaded. - * @returns string Success. The response body contains the requested report file. - * @throws ApiError - */ - public static getReportByRunIdAndFileName( - runId?: number, - fileName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/runs/{runId}/reporter/{fileName}', - path: { - runId: runId, - fileName: fileName, - }, - responseHeader: 'Content-Type', - errors: { - 401: `Invalid Token`, - 404: `The requested report file or the ORT run could not be resolved.`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/RepositoriesService.ts b/ui/src/api/requests/services/RepositoriesService.ts deleted file mode 100644 index af78686da..000000000 --- a/ui/src/api/requests/services/RepositoriesService.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateOrtRun } from '../models/CreateOrtRun'; -import type { CreateRepository } from '../models/CreateRepository'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_'; -import type { OrtRun } from '../models/OrtRun'; -import type { Repository } from '../models/Repository'; -import type { UpdateRepository } from '../models/UpdateRepository'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class RepositoriesService { - /** - * Get all repositories of a product. - * @param productId The product's ID. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ Success - * @throws ApiError - */ - public static getRepositoriesByProductId( - productId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/products/{productId}/repositories', - path: { - productId: productId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create a repository for a product. - * @param productId The product's ID. - * @param requestBody - * @returns Repository Success - * @throws ApiError - */ - public static createRepository( - productId?: number, - requestBody?: CreateRepository - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/products/{productId}/repositories', - path: { - productId: productId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of a repository. - * @param repositoryId The repository's ID. - * @returns Repository Success - * @throws ApiError - */ - public static getRepositoryById( - repositoryId?: number - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/repositories/{repositoryId}', - path: { - repositoryId: repositoryId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete a repository. - * @param repositoryId The repository's ID. - * @returns void - * @throws ApiError - */ - public static deleteRepositoryById( - repositoryId?: number - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/repositories/{repositoryId}', - path: { - repositoryId: repositoryId, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update a repository. - * @param repositoryId The repository's ID. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Repository Success - * @throws ApiError - */ - public static patchRepositoryById( - repositoryId?: number, - requestBody?: UpdateRepository - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/repositories/{repositoryId}', - path: { - repositoryId: repositoryId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get all ORT runs of a repository. - * @param repositoryId The repository's ID. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ Success - * @throws ApiError - */ - public static getOrtRuns( - repositoryId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/repositories/{repositoryId}/runs', - path: { - repositoryId: repositoryId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create an ORT run for a repository. - * @param repositoryId The repository's ID. - * @param requestBody - * @returns OrtRun Success - * @throws ApiError - */ - public static postOrtRun( - repositoryId?: number, - requestBody?: CreateOrtRun - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/repositories/{repositoryId}/runs', - path: { - repositoryId: repositoryId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of an ORT run of a repository. - * @param repositoryId The repository's ID. - * @param ortRunIndex The index of an ORT run. - * @returns OrtRun Success - * @throws ApiError - */ - public static getOrtRunByIndex( - repositoryId?: number, - ortRunIndex?: number - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/repositories/{repositoryId}/runs/{ortRunIndex}', - path: { - repositoryId: repositoryId, - ortRunIndex: ortRunIndex, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } -} diff --git a/ui/src/api/requests/services/SecretsService.ts b/ui/src/api/requests/services/SecretsService.ts deleted file mode 100644 index e50c35545..000000000 --- a/ui/src/api/requests/services/SecretsService.ts +++ /dev/null @@ -1,397 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CreateSecret } from '../models/CreateSecret'; -import type { org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ } from '../models/org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_'; -import type { Secret } from '../models/Secret'; -import type { UpdateSecret } from '../models/UpdateSecret'; - -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; - -export class SecretsService { - /** - * Get all secrets of an organization. - * @param organizationId The ID of an organization. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success - * @throws ApiError - */ - public static getSecretsByOrganizationId( - organizationId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations/{organizationId}/secrets', - path: { - organizationId: organizationId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create a secret for an organization. - * @param requestBody - * @returns Secret Success - * @throws ApiError - */ - public static postSecretForOrganization( - requestBody?: CreateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/organizations/{organizationId}/secrets', - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of a secret of an organization. - * @param organizationId The organization's ID. - * @param secretName The secret's name. - * @returns Secret Success - * @throws ApiError - */ - public static getSecretByOrganizationIdAndName( - organizationId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', - path: { - organizationId: organizationId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete a secret from an organization. - * @param organizationId The organization's ID. - * @param secretName The secret's name. - * @returns void - * @throws ApiError - */ - public static deleteSecretByOrganizationIdAndName( - organizationId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', - path: { - organizationId: organizationId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update a secret of an organization. - * @param organizationId The organization's ID. - * @param secretName The secret's name. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Secret Success - * @throws ApiError - */ - public static patchSecretByOrganizationIdAndName( - organizationId?: number, - secretName?: string, - requestBody?: UpdateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/organizations/{organizationId}/secrets/{secretName}', - path: { - organizationId: organizationId, - secretName: secretName, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get all secrets of a specific product. - * @param productId The ID of a product. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success - * @throws ApiError - */ - public static getSecretsByProductId( - productId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/products/{productId}/secrets', - path: { - productId: productId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create a secret for a product. - * @param requestBody - * @returns Secret Success - * @throws ApiError - */ - public static postSecretForProduct( - requestBody?: CreateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/products/{productId}/secrets', - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of a secret of a product. - * @param productId The product's ID. - * @param secretName The secret's name. - * @returns Secret Success - * @throws ApiError - */ - public static getSecretByProductIdAndName( - productId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/products/{productId}/secrets/{secretName}', - path: { - productId: productId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete a secret from a product. - * @param productId The product's ID. - * @param secretName The secret's name. - * @returns void - * @throws ApiError - */ - public static deleteSecretByProductIdAndName( - productId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/products/{productId}/secrets/{secretName}', - path: { - productId: productId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update a secret of a product. - * @param productId The product's ID. - * @param secretName The secret's name. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Secret Success - * @throws ApiError - */ - public static patchSecretByProductIdIdAndName( - productId?: number, - secretName?: string, - requestBody?: UpdateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/products/{productId}/secrets/{secretName}', - path: { - productId: productId, - secretName: secretName, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get all secrets of a repository. - * @param repositoryId The ID of a repository. - * @param limit The maximum number of items to retrieve. If not specified at most 20 items are retrieved. - * @param offset The offset of the first item in the result. Together with 'limit', this can be used to implement paging. - * @param sort Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. - * @returns org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ Success - * @throws ApiError - */ - public static getSecretsByRepositoryId( - repositoryId?: number, - limit?: number, - offset?: number, - sort?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/repositories/{repositoryId}/secrets', - path: { - repositoryId: repositoryId, - }, - query: { - limit: limit, - offset: offset, - sort: sort, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Create a secret for a repository. - * @param requestBody - * @returns Secret Success - * @throws ApiError - */ - public static postSecretForRepository( - requestBody?: CreateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/repositories/{repositoryId}/secrets', - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Get details of a secret of a repository. - * @param repositoryId The repository's ID. - * @param secretName The secret's name. - * @returns Secret Success - * @throws ApiError - */ - public static getSecretByRepositoryIdAndName( - repositoryId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', - path: { - repositoryId: repositoryId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Delete a secret from a repository. - * @param repositoryId The repository's ID. - * @param secretName The secret's name. - * @returns void - * @throws ApiError - */ - public static deleteSecretByRepositoryIdAndName( - repositoryId?: number, - secretName?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', - path: { - repositoryId: repositoryId, - secretName: secretName, - }, - errors: { - 401: `Invalid Token`, - }, - }); - } - - /** - * Update a secret of a repository. - * @param repositoryIdId The repository's ID. - * @param secretName The secret's name. - * @param requestBody Set the values that should be updated. To delete a value, set it explicitly to null. - * @returns Secret Success - * @throws ApiError - */ - public static patchSecretByRepositoryIdIdAndName( - repositoryIdId?: number, - secretName?: string, - requestBody?: UpdateSecret - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/v1/repositories/{repositoryId}/secrets/{secretName}', - path: { - repositoryIdId: repositoryIdId, - secretName: secretName, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 401: `Invalid Token`, - }, - }); - } -} diff --git a/ui/src/api/requests/types.gen.ts b/ui/src/api/requests/types.gen.ts new file mode 100644 index 000000000..6d985b1a3 --- /dev/null +++ b/ui/src/api/requests/types.gen.ts @@ -0,0 +1,2489 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Liveness = { + message: string; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_ = + { + data: Array<{ + id: number; + name: string; + description?: string | null; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type CreateOrganization = { + name: string; + description?: string | null; +}; + +export type Organization = { + id: number; + name: string; + description?: string | null; +}; + +export type UpdateOrganization = { + name?: string; + description?: string | null; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_ = + { + data: Array<{ + id: number; + name: string; + description?: string | null; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type CreateProduct = { + name: string; + description?: string | null; +}; + +export type Product = { + id: number; + name: string; + description?: string | null; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_ = + { + data: Array<{ + name: string; + description: string | null; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type Secret = { + name: string; + description: string | null; +}; + +export type UpdateSecret = { + name?: string; + value?: string; + description?: string; +}; + +export type CreateSecret = { + name: string; + value: string; + description: string | null; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_ = + { + data: Array<{ + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type CreateInfrastructureService = { + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; +}; + +export type InfrastructureService = { + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; +}; + +export type UpdateInfrastructureService = { + url?: string; + description?: string | null; + usernameSecretRef?: string; + passwordSecretRef?: string; + excludeFromNetrc?: boolean; +}; + +export type UpdateProduct = { + name?: string; + description?: string | null; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_ = + { + data: Array<{ + id: number; + type: 'GIT' | 'GIT_REPO' | 'MERCURIAL' | 'SUBVERSION' | 'CVS'; + url: string; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type CreateRepository = { + type: 'GIT' | 'GIT_REPO' | 'MERCURIAL' | 'SUBVERSION' | 'CVS'; + url: string; +}; + +export type Repository = { + id: number; + type: 'GIT' | 'GIT_REPO' | 'MERCURIAL' | 'SUBVERSION' | 'CVS'; + url: string; +}; + +export type UpdateRepository = { + type?: 'GIT' | 'GIT_REPO' | 'MERCURIAL' | 'SUBVERSION' | 'CVS'; + url?: string; +}; + +export type org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_ = + { + data: Array<{ + id: number; + index: number; + repositoryId: number; + revision: string; + path?: string | null; + createdAt: string; + finishedAt?: string | null; + jobs: { + analyzer?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + advisor?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + scanner?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + evaluator?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + reporter?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + }; + status: 'CREATED' | 'ACTIVE' | 'FINISHED' | 'FAILED'; + labels: { + [key: string]: string; + }; + jobConfigContext?: string | null; + resolvedJobConfigContext?: string | null; + }>; + options: { + limit?: number | null; + offset?: number | null; + sortProperties?: Array<{ + name: string; + direction: 'ASCENDING' | 'DESCENDING'; + }> | null; + }; + }; + +export type CreateOrtRun = { + revision: string; + path?: string | null; + jobConfigs: { + analyzer?: { + allowDynamicVersions?: boolean; + disabledPackageManagers?: Array | null; + enabledPackageManagers?: Array | null; + environmentConfig?: { + infrastructureServices: Array<{ + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; + }>; + environmentDefinitions?: { + [key: string]: Array<{ + [key: string]: string; + }>; + }; + environmentVariables?: Array<{ + name: string; + secretName: string; + }>; + strict?: boolean; + } | null; + packageCurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + packageManagerOptions?: { + [key: string]: { + mustRunAfter?: Array | null; + options?: { + [key: string]: string; + } | null; + }; + } | null; + repositoryConfigPath?: string | null; + skipExcluded?: boolean | null; + }; + advisor?: { + advisors?: Array; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + scanner?: { + createMissingArchives?: boolean | null; + detectedLicenseMappings?: { + [key: string]: string; + } | null; + ignorePatterns?: Array | null; + projectScanners?: Array | null; + scanners?: Array | null; + skipConcluded?: boolean | null; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + evaluator?: { + copyrightGarbageFile?: string | null; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + ruleSet?: string | null; + } | null; + reporter?: { + copyrightGarbageFile?: string | null; + formats?: Array; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + customLicenseTextDir?: string | null; + assetFiles?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + assetDirectories?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + nameMappings?: { + [key: string]: { + namePrefix: string; + }; + } | null; + } | null; + notifier?: { + notifierRules?: string | null; + resolutionsFile?: string | null; + mail?: { + recipientAddresses?: Array | null; + mailServerConfiguration?: { + hostName: string; + port: number; + username: string; + password: string; + useSsl: boolean; + fromAddress: string; + } | null; + } | null; + jira?: { + jiraRestClientConfiguration?: { + serverUrl: string; + username: string; + password: string; + } | null; + } | null; + } | null; + parameters?: { + [key: string]: string; + }; + }; + labels?: { + [key: string]: string; + } | null; + jobConfigContext?: string | null; +}; + +export type OrtRun = { + id: number; + index: number; + repositoryId: number; + revision: string; + path?: string | null; + createdAt: string; + finishedAt?: string | null; + jobConfigs: { + analyzer?: { + allowDynamicVersions?: boolean; + disabledPackageManagers?: Array | null; + enabledPackageManagers?: Array | null; + environmentConfig?: { + infrastructureServices: Array<{ + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; + }>; + environmentDefinitions?: { + [key: string]: Array<{ + [key: string]: string; + }>; + }; + environmentVariables?: Array<{ + name: string; + secretName: string; + }>; + strict?: boolean; + } | null; + packageCurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + packageManagerOptions?: { + [key: string]: { + mustRunAfter?: Array | null; + options?: { + [key: string]: string; + } | null; + }; + } | null; + repositoryConfigPath?: string | null; + skipExcluded?: boolean | null; + }; + advisor?: { + advisors?: Array; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + scanner?: { + createMissingArchives?: boolean | null; + detectedLicenseMappings?: { + [key: string]: string; + } | null; + ignorePatterns?: Array | null; + projectScanners?: Array | null; + scanners?: Array | null; + skipConcluded?: boolean | null; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + evaluator?: { + copyrightGarbageFile?: string | null; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + ruleSet?: string | null; + } | null; + reporter?: { + copyrightGarbageFile?: string | null; + formats?: Array; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + customLicenseTextDir?: string | null; + assetFiles?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + assetDirectories?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + nameMappings?: { + [key: string]: { + namePrefix: string; + }; + } | null; + } | null; + notifier?: { + notifierRules?: string | null; + resolutionsFile?: string | null; + mail?: { + recipientAddresses?: Array | null; + mailServerConfiguration?: { + hostName: string; + port: number; + username: string; + password: string; + useSsl: boolean; + fromAddress: string; + } | null; + } | null; + jira?: { + jiraRestClientConfiguration?: { + serverUrl: string; + username: string; + password: string; + } | null; + } | null; + } | null; + parameters?: { + [key: string]: string; + }; + }; + resolvedJobConfigs?: { + analyzer?: { + allowDynamicVersions?: boolean; + disabledPackageManagers?: Array | null; + enabledPackageManagers?: Array | null; + environmentConfig?: { + infrastructureServices: Array<{ + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; + }>; + environmentDefinitions?: { + [key: string]: Array<{ + [key: string]: string; + }>; + }; + environmentVariables?: Array<{ + name: string; + secretName: string; + }>; + strict?: boolean; + } | null; + packageCurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + packageManagerOptions?: { + [key: string]: { + mustRunAfter?: Array | null; + options?: { + [key: string]: string; + } | null; + }; + } | null; + repositoryConfigPath?: string | null; + skipExcluded?: boolean | null; + }; + advisor?: { + advisors?: Array; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + scanner?: { + createMissingArchives?: boolean | null; + detectedLicenseMappings?: { + [key: string]: string; + } | null; + ignorePatterns?: Array | null; + projectScanners?: Array | null; + scanners?: Array | null; + skipConcluded?: boolean | null; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + } | null; + evaluator?: { + copyrightGarbageFile?: string | null; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + ruleSet?: string | null; + } | null; + reporter?: { + copyrightGarbageFile?: string | null; + formats?: Array; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + customLicenseTextDir?: string | null; + assetFiles?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + assetDirectories?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + nameMappings?: { + [key: string]: { + namePrefix: string; + }; + } | null; + } | null; + notifier?: { + notifierRules?: string | null; + resolutionsFile?: string | null; + mail?: { + recipientAddresses?: Array | null; + mailServerConfiguration?: { + hostName: string; + port: number; + username: string; + password: string; + useSsl: boolean; + fromAddress: string; + } | null; + } | null; + jira?: { + jiraRestClientConfiguration?: { + serverUrl: string; + username: string; + password: string; + } | null; + } | null; + } | null; + parameters?: { + [key: string]: string; + }; + } | null; + jobs: { + analyzer?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + allowDynamicVersions?: boolean; + disabledPackageManagers?: Array | null; + enabledPackageManagers?: Array | null; + environmentConfig?: { + infrastructureServices: Array<{ + name: string; + url: string; + description?: string | null; + usernameSecretRef: string; + passwordSecretRef: string; + excludeFromNetrc?: boolean; + }>; + environmentDefinitions?: { + [key: string]: Array<{ + [key: string]: string; + }>; + }; + environmentVariables?: Array<{ + name: string; + secretName: string; + }>; + strict?: boolean; + } | null; + packageCurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + packageManagerOptions?: { + [key: string]: { + mustRunAfter?: Array | null; + options?: { + [key: string]: string; + } | null; + }; + } | null; + repositoryConfigPath?: string | null; + skipExcluded?: boolean | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + advisor?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + advisors?: Array; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + scanner?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + createMissingArchives?: boolean | null; + detectedLicenseMappings?: { + [key: string]: string; + } | null; + ignorePatterns?: Array | null; + projectScanners?: Array | null; + scanners?: Array | null; + skipConcluded?: boolean | null; + skipExcluded?: boolean; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + evaluator?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + copyrightGarbageFile?: string | null; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + ruleSet?: string | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + reporter?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + copyrightGarbageFile?: string | null; + formats?: Array; + licenseClassificationsFile?: string | null; + packageConfigurationProviders?: Array<{ + type: string; + id?: string; + enabled?: boolean; + options?: { + [key: string]: string; + }; + secrets?: { + [key: string]: string; + }; + }>; + resolutionsFile?: string | null; + customLicenseTextDir?: string | null; + assetFiles?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + assetDirectories?: Array<{ + sourcePath: string; + targetFolder?: string | null; + targetName?: string | null; + }>; + config?: { + [key: string]: { + options: { + [key: string]: string; + }; + secrets: { + [key: string]: string; + }; + }; + } | null; + nameMappings?: { + [key: string]: { + namePrefix: string; + }; + } | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + reportFilenames?: Array | null; + } | null; + notifier?: { + id: number; + createdAt: string; + startedAt?: string | null; + finishedAt?: string | null; + configuration: { + notifierRules?: string | null; + resolutionsFile?: string | null; + mail?: { + recipientAddresses?: Array | null; + mailServerConfiguration?: { + hostName: string; + port: number; + username: string; + password: string; + useSsl: boolean; + fromAddress: string; + } | null; + } | null; + jira?: { + jiraRestClientConfiguration?: { + serverUrl: string; + username: string; + password: string; + } | null; + } | null; + }; + status: 'CREATED' | 'SCHEDULED' | 'RUNNING' | 'FAILED' | 'FINISHED'; + } | null; + }; + status: 'CREATED' | 'ACTIVE' | 'FINISHED' | 'FAILED'; + labels: { + [key: string]: string; + }; + issues: Array<{ + timestamp: string; + source: string; + message: string; + severity: string; + }>; + jobConfigContext?: string | null; + resolvedJobConfigContext?: string | null; +}; + +export type GetLivenessResponse = Liveness; + +export type GetReportByRunIdAndTokenData = { + /** + * The ID of the ORT run. + */ + runId?: number; + /** + * The token providing access to the report file to be downloaded. + */ + token?: string; +}; + +export type GetReportByRunIdAndTokenResponse = string; + +export type GetReportByRunIdAndFileNameData = { + /** + * The name of the report file to be downloaded. + */ + fileName?: string; + /** + * The ID of the ORT run. + */ + runId?: number; +}; + +export type GetReportByRunIdAndFileNameResponse = string; + +export type GetOrganizationsData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetOrganizationsResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_; + +export type PostOrganizationsData = { + requestBody?: CreateOrganization; +}; + +export type PostOrganizationsResponse = Organization; + +export type GetOrganizationByIdData = { + /** + * The organization's ID. + */ + organizationId?: number; +}; + +export type GetOrganizationByIdResponse = Organization; + +export type DeleteOrganizationByIdData = { + /** + * The organization's ID. + */ + organizationId?: number; +}; + +export type DeleteOrganizationByIdResponse = void; + +export type PatchOrganizationByIdData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateOrganization; +}; + +export type PatchOrganizationByIdResponse = Organization; + +export type GetOrganizationProductsData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetOrganizationProductsResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_; + +export type PostProductData = { + /** + * The organization's ID. + */ + organizationId?: number; + requestBody?: CreateProduct; +}; + +export type PostProductResponse = Product; + +export type GetProductByIdData = { + /** + * The product's ID. + */ + productId?: number; +}; + +export type GetProductByIdResponse = Product; + +export type DeleteProductByIdData = { + /** + * The product's ID. + */ + productId?: number; +}; + +export type DeleteProductByIdResponse = void; + +export type PatchProductByIdData = { + /** + * The product's ID. + */ + productId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateProduct; +}; + +export type PatchProductByIdResponse = Product; + +export type GetSecretsByOrganizationIdData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of an organization. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetSecretsByOrganizationIdResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + +export type PostSecretForOrganizationData = { + requestBody?: CreateSecret; +}; + +export type PostSecretForOrganizationResponse = Secret; + +export type GetSecretByOrganizationIdAndNameData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type GetSecretByOrganizationIdAndNameResponse = Secret; + +export type DeleteSecretByOrganizationIdAndNameData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type DeleteSecretByOrganizationIdAndNameResponse = void; + +export type PatchSecretByOrganizationIdAndNameData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type PatchSecretByOrganizationIdAndNameResponse = Secret; + +export type GetSecretsByProductIdData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of a product. + */ + productId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetSecretsByProductIdResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + +export type PostSecretForProductData = { + requestBody?: CreateSecret; +}; + +export type PostSecretForProductResponse = Secret; + +export type GetSecretByProductIdAndNameData = { + /** + * The product's ID. + */ + productId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type GetSecretByProductIdAndNameResponse = Secret; + +export type DeleteSecretByProductIdAndNameData = { + /** + * The product's ID. + */ + productId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type DeleteSecretByProductIdAndNameResponse = void; + +export type PatchSecretByProductIdIdAndNameData = { + /** + * The product's ID. + */ + productId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type PatchSecretByProductIdIdAndNameResponse = Secret; + +export type GetSecretsByRepositoryIdData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of a repository. + */ + repositoryId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetSecretsByRepositoryIdResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + +export type PostSecretForRepositoryData = { + requestBody?: CreateSecret; +}; + +export type PostSecretForRepositoryResponse = Secret; + +export type GetSecretByRepositoryIdAndNameData = { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type GetSecretByRepositoryIdAndNameResponse = Secret; + +export type DeleteSecretByRepositoryIdAndNameData = { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type DeleteSecretByRepositoryIdAndNameResponse = void; + +export type PatchSecretByRepositoryIdIdAndNameData = { + /** + * The repository's ID. + */ + repositoryIdId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; +}; + +export type PatchSecretByRepositoryIdIdAndNameResponse = Secret; + +export type GetInfrastructureServicesByOrganizationIdData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of an organization. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetInfrastructureServicesByOrganizationIdResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_; + +export type PostInfrastructureServiceForOrganizationData = { + requestBody?: CreateInfrastructureService; +}; + +export type PostInfrastructureServiceForOrganizationResponse = + InfrastructureService; + +export type DeleteInfrastructureServiceForOrganizationIdAndNameData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The name of the infrastructure service. + */ + serviceName?: string; +}; + +export type DeleteInfrastructureServiceForOrganizationIdAndNameResponse = void; + +export type PatchInfrastructureServiceForOrganizationIdAndNameData = { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateInfrastructureService; + /** + * The name of the infrastructure service. + */ + serviceName?: string; +}; + +export type PatchInfrastructureServiceForOrganizationIdAndNameResponse = + InfrastructureService; + +export type GetRepositoriesByProductIdData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The product's ID. + */ + productId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetRepositoriesByProductIdResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_; + +export type CreateRepositoryData = { + /** + * The product's ID. + */ + productId?: number; + requestBody?: CreateRepository; +}; + +export type CreateRepositoryResponse = Repository; + +export type GetRepositoryByIdData = { + /** + * The repository's ID. + */ + repositoryId?: number; +}; + +export type GetRepositoryByIdResponse = Repository; + +export type DeleteRepositoryByIdData = { + /** + * The repository's ID. + */ + repositoryId?: number; +}; + +export type DeleteRepositoryByIdResponse = void; + +export type PatchRepositoryByIdData = { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateRepository; +}; + +export type PatchRepositoryByIdResponse = Repository; + +export type GetOrtRunsData = { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; +}; + +export type GetOrtRunsResponse = + org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_; + +export type PostOrtRunData = { + /** + * The repository's ID. + */ + repositoryId?: number; + requestBody?: CreateOrtRun; +}; + +export type PostOrtRunResponse = OrtRun; + +export type GetOrtRunByIndexData = { + /** + * The index of an ORT run. + */ + ortRunIndex?: number; + /** + * The repository's ID. + */ + repositoryId?: number; +}; + +export type GetOrtRunByIndexResponse = OrtRun; + +export type GetLogsByRunIdData = { + /** + * The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. + */ + level?: string; + /** + * The ID of the ORT run. + */ + runId?: number; + /** + * Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. + */ + steps?: string; +}; + +export type GetLogsByRunIdResponse = unknown; + +export type $OpenApiTs = { + '/api/v1/liveness': { + get: { + res: { + /** + * Success + */ + 200: Liveness; + }; + }; + }; + '/api/v1/runs/{runId}/downloads/report/{token}': { + get: { + req: { + /** + * The ID of the ORT run. + */ + runId?: number; + /** + * The token providing access to the report file to be downloaded. + */ + token?: string; + }; + res: { + /** + * Success. The response body contains the requested report file. + */ + 200: string; + /** + * The provided token could not be resolved or has expired. + */ + 404: unknown; + }; + }; + }; + '/api/v1/runs/{runId}/reporter/{fileName}': { + get: { + req: { + /** + * The name of the report file to be downloaded. + */ + fileName?: string; + /** + * The ID of the ORT run. + */ + runId?: number; + }; + res: { + /** + * Success. The response body contains the requested report file. + */ + 200: string; + /** + * Invalid Token + */ + 401: unknown; + /** + * The requested report file or the ORT run could not be resolved. + */ + 404: unknown; + }; + }; + }; + '/api/v1/organizations': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Organization_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + requestBody?: CreateOrganization; + }; + res: { + /** + * Success + */ + 201: Organization; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}': { + get: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + }; + res: { + /** + * Success + */ + 200: Organization; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateOrganization; + }; + res: { + /** + * Success + */ + 200: Organization; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}/products': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Product_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + requestBody?: CreateProduct; + }; + res: { + /** + * Success + */ + 201: Product; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/products/{productId}': { + get: { + req: { + /** + * The product's ID. + */ + productId?: number; + }; + res: { + /** + * Success + */ + 200: Product; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The product's ID. + */ + productId?: number; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The product's ID. + */ + productId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateProduct; + }; + res: { + /** + * Success + */ + 200: Product; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}/secrets': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of an organization. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + requestBody?: CreateSecret; + }; + res: { + /** + * Success + */ + 201: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}/secrets/{secretName}': { + get: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/products/{productId}/secrets': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of a product. + */ + productId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + requestBody?: CreateSecret; + }; + res: { + /** + * Success + */ + 201: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/products/{productId}/secrets/{secretName}': { + get: { + req: { + /** + * The product's ID. + */ + productId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The product's ID. + */ + productId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The product's ID. + */ + productId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/repositories/{repositoryId}/secrets': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of a repository. + */ + repositoryId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Secret_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + requestBody?: CreateSecret; + }; + res: { + /** + * Success + */ + 201: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/repositories/{repositoryId}/secrets/{secretName}': { + get: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The repository's ID. + */ + repositoryIdId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateSecret; + /** + * The secret's name. + */ + secretName?: string; + }; + res: { + /** + * Success + */ + 200: Secret; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}/infrastructure-services': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The ID of an organization. + */ + organizationId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_InfrastructureService_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + requestBody?: CreateInfrastructureService; + }; + res: { + /** + * Success + */ + 201: InfrastructureService; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/organizations/{organizationId}/infrastructure-services/{serviceName}': { + delete: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * The name of the infrastructure service. + */ + serviceName?: string; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The organization's ID. + */ + organizationId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateInfrastructureService; + /** + * The name of the infrastructure service. + */ + serviceName?: string; + }; + res: { + /** + * Success + */ + 200: InfrastructureService; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/products/{productId}/repositories': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The product's ID. + */ + productId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_Repository_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + /** + * The product's ID. + */ + productId?: number; + requestBody?: CreateRepository; + }; + res: { + /** + * Success + */ + 201: Repository; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/repositories/{repositoryId}': { + get: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + }; + res: { + /** + * Success + */ + 200: Repository; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + delete: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + }; + res: { + /** + * Success + */ + 204: void; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + patch: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * Set the values that should be updated. To delete a value, set it explicitly to null. + */ + requestBody?: UpdateRepository; + }; + res: { + /** + * Success + */ + 200: Repository; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/repositories/{repositoryId}/runs': { + get: { + req: { + /** + * The maximum number of items to retrieve. If not specified at most 20 items are retrieved. + */ + limit?: number; + /** + * The offset of the first item in the result. Together with 'limit', this can be used to implement paging. + */ + offset?: number; + /** + * The repository's ID. + */ + repositoryId?: number; + /** + * Comma-separated list of fields by which the result is sorted. The listed fields must be supported by the endpoint. Putting a minus ('-') before a field name, reverts the sort order for this field. If not specified, a default sort field and sort order is used. + */ + sort?: string; + }; + res: { + /** + * Success + */ + 200: org_eclipse_apoapsis_ortserver_api_v1_model_PagedResponse_org_eclipse_apoapsis_ortserver_api_v1_model_OrtRunSummary_; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + post: { + req: { + /** + * The repository's ID. + */ + repositoryId?: number; + requestBody?: CreateOrtRun; + }; + res: { + /** + * Success + */ + 200: OrtRun; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/repositories/{repositoryId}/runs/{ortRunIndex}': { + get: { + req: { + /** + * The index of an ORT run. + */ + ortRunIndex?: number; + /** + * The repository's ID. + */ + repositoryId?: number; + }; + res: { + /** + * Success + */ + 200: OrtRun; + /** + * Invalid Token + */ + 401: unknown; + }; + }; + }; + '/api/v1/runs/{runId}/logs': { + get: { + req: { + /** + * The log level; can be one of 'DEBUG', 'INFO', 'WARN', 'ERROR' (ignoring case).Only logs of this level or higher are retrieved. Defaults to 'INFO' if missing. + */ + level?: string; + /** + * The ID of the ORT run. + */ + runId?: number; + /** + * Defines the run steps for which logs are to be retrieved. This is a comma-separated string with the following allowed steps: 'CONFIG', 'ANALYZER', 'ADVISOR', 'SCANNER', 'EVALUATOR', 'REPORTER' (ignoring case). If missing, the logs for all steps are retrieved. + */ + steps?: string; + }; + res: { + /** + * Success. The response body contains a Zip archive with the selected log files. + */ + 200: unknown; + /** + * Invalid values have been provided for the log level or steps parameters. + */ + 400: unknown; + /** + * Invalid Token + */ + 401: unknown; + /** + * The ORT run does not exist. + */ + 404: unknown; + }; + }; + }; +};