From 06a973ae6f8a029acba8e8c7f9b729129039bac6 Mon Sep 17 00:00:00 2001 From: Steliyan Dinkov Date: Fri, 20 Dec 2024 11:25:10 +0100 Subject: [PATCH] update client api --- apps/server/src/infra/vidis-client/README.md | 8 +- .../generated/.openapi-generator/FILES | 3 +- .../src/infra/vidis-client/generated/api.ts | 2 - .../vidis-client/generated/api/default-api.ts | 142 ---- .../generated/api/education-provider-api.ts | 676 ------------------ .../generated/api/idmbetreiber-api.ts | 176 ----- openapitools.json | 3 + 7 files changed, 8 insertions(+), 1002 deletions(-) delete mode 100644 apps/server/src/infra/vidis-client/generated/api/default-api.ts delete mode 100644 apps/server/src/infra/vidis-client/generated/api/education-provider-api.ts diff --git a/apps/server/src/infra/vidis-client/README.md b/apps/server/src/infra/vidis-client/README.md index 2a9f57615bc..259b5d589d8 100644 --- a/apps/server/src/infra/vidis-client/README.md +++ b/apps/server/src/infra/vidis-client/README.md @@ -12,11 +12,11 @@ like this: ```typescript export class MyNewService { // inject the factory into the constructor - constructor(private readonly tspClientFactory: TspClientFactory) {} + constructor(private readonly vidisClientFactory: VidisClientFactory) {} public async doSomeStuff(): Promise { // this will create a fully initialized client - const exportClient = tspClientFactory.createExportClient(); + const exportClient = vidisClientFactory.createExportClient(); // calling the api const versionResponse = await exportClient.version(); @@ -39,8 +39,8 @@ We are using the openapi-generator-cli to generate apis, models and supporting f `generated` directory. **DO NOT** modify anything in the `generated` folder, because it will be deleted on the next client generation. -The client generation is done with the npm command `npm run generate-client:tsp-api`. This -will delete the old and create new files. We are using the `tsp-api` generator configuration +The client generation is done with the npm command `npm run generate-client:vidis-api`. This +will delete the old and create new files. We are using the `vidis-api` generator configuration from the `openapitools.json` found in the repository root. You can add new endpoints by extending the `FILTER` list in the `openapiNormalizer` section with new `operationId` entries. New models must be added to the list of `models` in the `globalProperty` section. diff --git a/apps/server/src/infra/vidis-client/generated/.openapi-generator/FILES b/apps/server/src/infra/vidis-client/generated/.openapi-generator/FILES index 3d1040f30c3..5381aa4321b 100644 --- a/apps/server/src/infra/vidis-client/generated/.openapi-generator/FILES +++ b/apps/server/src/infra/vidis-client/generated/.openapi-generator/FILES @@ -1,8 +1,7 @@ .gitignore .npmignore +.openapi-generator-ignore api.ts -api/default-api.ts -api/education-provider-api.ts api/idmbetreiber-api.ts base.ts common.ts diff --git a/apps/server/src/infra/vidis-client/generated/api.ts b/apps/server/src/infra/vidis-client/generated/api.ts index cb84e884965..72a37fe6fec 100644 --- a/apps/server/src/infra/vidis-client/generated/api.ts +++ b/apps/server/src/infra/vidis-client/generated/api.ts @@ -14,7 +14,5 @@ -export * from './api/default-api'; -export * from './api/education-provider-api'; export * from './api/idmbetreiber-api'; diff --git a/apps/server/src/infra/vidis-client/generated/api/default-api.ts b/apps/server/src/infra/vidis-client/generated/api/default-api.ts deleted file mode 100644 index ad8d41cb9b2..00000000000 --- a/apps/server/src/infra/vidis-client/generated/api/default-api.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Vidis REST - * Vidis REST API - * - * The version of the OpenAPI document: v1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -/** - * DefaultApi - axios parameter creator - * @export - */ -export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @param {string} type - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOpenAPI: async (type: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'type' is not null or undefined - assertParamExists('getOpenAPI', 'type', type) - const localVarPath = `/v1.0/openapi.{type}` - .replace(`{${"type"}}`, encodeURIComponent(String(type))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * DefaultApi - functional programming interface - * @export - */ -export const DefaultApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) - return { - /** - * - * @param {string} type - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getOpenAPI(type: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOpenAPI(type, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getOpenAPI']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * DefaultApi - factory interface - * @export - */ -export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DefaultApiFp(configuration) - return { - /** - * - * @param {string} type - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOpenAPI(type: string, options?: any): AxiosPromise { - return localVarFp.getOpenAPI(type, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * DefaultApi - interface - * @export - * @interface DefaultApi - */ -export interface DefaultApiInterface { - /** - * - * @param {string} type - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApiInterface - */ - getOpenAPI(type: string, options?: RawAxiosRequestConfig): AxiosPromise; - -} - -/** - * DefaultApi - object-oriented interface - * @export - * @class DefaultApi - * @extends {BaseAPI} - */ -export class DefaultApi extends BaseAPI implements DefaultApiInterface { - /** - * - * @param {string} type - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getOpenAPI(type: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getOpenAPI(type, options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/apps/server/src/infra/vidis-client/generated/api/education-provider-api.ts b/apps/server/src/infra/vidis-client/generated/api/education-provider-api.ts deleted file mode 100644 index e1d5c94cd49..00000000000 --- a/apps/server/src/infra/vidis-client/generated/api/education-provider-api.ts +++ /dev/null @@ -1,676 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Vidis REST - * Vidis REST API - * - * The version of the OpenAPI document: v1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import type { Configuration } from '../configuration'; -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; -import globalAxios from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; -// @ts-ignore -import type { ActivationDTO } from '../models'; -// @ts-ignore -import type { PageActivationDTO } from '../models'; -// @ts-ignore -import type { PageOfferDTO } from '../models'; -// @ts-ignore -import type { PageSchoolDTO } from '../models'; -/** - * EducationProviderApi - axios parameter creator - * @export - */ -export const EducationProviderApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * List the activation details for a selected owned offer, that has activated by the selected school. - * @param {string} offerId - * @param {string} organizationId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivationByOfferAndSchool: async (offerId: string, organizationId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'offerId' is not null or undefined - assertParamExists('getActivationByOfferAndSchool', 'offerId', offerId) - // verify required parameter 'organizationId' is not null or undefined - assertParamExists('getActivationByOfferAndSchool', 'organizationId', organizationId) - const localVarPath = `/v1.0/activation/offers/{offerId}/schools/{organizationId}/details` - .replace(`{${"offerId"}}`, encodeURIComponent(String(offerId))) - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List the activation details for a selected school, that has activated the selected owned offer. - * @param {string} organizationId - * @param {string} offerId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivationBySchoolAndOffer: async (organizationId: string, offerId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'organizationId' is not null or undefined - assertParamExists('getActivationBySchoolAndOffer', 'organizationId', organizationId) - // verify required parameter 'offerId' is not null or undefined - assertParamExists('getActivationBySchoolAndOffer', 'offerId', offerId) - const localVarPath = `/v1.0/activation/schools/{organizationId}/offers/{offerId}/details` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))) - .replace(`{${"offerId"}}`, encodeURIComponent(String(offerId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all the activation details for all owned offer. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivations: async (page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/activation/details`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all owned offers, that has activated by any schools. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOffers: async (page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/activation/offers`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all owned offers, that has activated by the selected school. - * @param {string} organizationId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOffersBySchool: async (organizationId: string, page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'organizationId' is not null or undefined - assertParamExists('getOffersBySchool', 'organizationId', organizationId) - const localVarPath = `/v1.0/activation/schools/{organizationId}/offers` - .replace(`{${"organizationId"}}`, encodeURIComponent(String(organizationId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all schools, that has activated any of the owned offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchools: async (page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/activation/schools`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all schools, that has activated the selected owned offer. - * @param {string} offerId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchoolsByOffer: async (offerId: string, page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'offerId' is not null or undefined - assertParamExists('getSchoolsByOffer', 'offerId', offerId) - const localVarPath = `/v1.0/activation/offers/{offerId}/schools` - .replace(`{${"offerId"}}`, encodeURIComponent(String(offerId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * EducationProviderApi - functional programming interface - * @export - */ -export const EducationProviderApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = EducationProviderApiAxiosParamCreator(configuration) - return { - /** - * List the activation details for a selected owned offer, that has activated by the selected school. - * @param {string} offerId - * @param {string} organizationId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getActivationByOfferAndSchool(offerId: string, organizationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivationByOfferAndSchool(offerId, organizationId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getActivationByOfferAndSchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List the activation details for a selected school, that has activated the selected owned offer. - * @param {string} organizationId - * @param {string} offerId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getActivationBySchoolAndOffer(organizationId: string, offerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivationBySchoolAndOffer(organizationId, offerId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getActivationBySchoolAndOffer']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List all the activation details for all owned offer. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getActivations(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivations(page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getActivations']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List all owned offers, that has activated by any schools. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOffers(page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getOffers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List all owned offers, that has activated by the selected school. - * @param {string} organizationId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getOffersBySchool(organizationId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOffersBySchool(organizationId, page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getOffersBySchool']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List all schools, that has activated any of the owned offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getSchools(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getSchools(page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getSchools']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * List all schools, that has activated the selected owned offer. - * @param {string} offerId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getSchoolsByOffer(offerId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getSchoolsByOffer(offerId, page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['EducationProviderApi.getSchoolsByOffer']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * EducationProviderApi - factory interface - * @export - */ -export const EducationProviderApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = EducationProviderApiFp(configuration) - return { - /** - * List the activation details for a selected owned offer, that has activated by the selected school. - * @param {string} offerId - * @param {string} organizationId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivationByOfferAndSchool(offerId: string, organizationId: string, options?: any): AxiosPromise { - return localVarFp.getActivationByOfferAndSchool(offerId, organizationId, options).then((request) => request(axios, basePath)); - }, - /** - * List the activation details for a selected school, that has activated the selected owned offer. - * @param {string} organizationId - * @param {string} offerId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivationBySchoolAndOffer(organizationId: string, offerId: string, options?: any): AxiosPromise { - return localVarFp.getActivationBySchoolAndOffer(organizationId, offerId, options).then((request) => request(axios, basePath)); - }, - /** - * List all the activation details for all owned offer. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivations(page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getActivations(page, pageSize, options).then((request) => request(axios, basePath)); - }, - /** - * List all owned offers, that has activated by any schools. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOffers(page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getOffers(page, pageSize, options).then((request) => request(axios, basePath)); - }, - /** - * List all owned offers, that has activated by the selected school. - * @param {string} organizationId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOffersBySchool(organizationId: string, page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getOffersBySchool(organizationId, page, pageSize, options).then((request) => request(axios, basePath)); - }, - /** - * List all schools, that has activated any of the owned offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchools(page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getSchools(page, pageSize, options).then((request) => request(axios, basePath)); - }, - /** - * List all schools, that has activated the selected owned offer. - * @param {string} offerId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getSchoolsByOffer(offerId: string, page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getSchoolsByOffer(offerId, page, pageSize, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * EducationProviderApi - interface - * @export - * @interface EducationProviderApi - */ -export interface EducationProviderApiInterface { - /** - * List the activation details for a selected owned offer, that has activated by the selected school. - * @param {string} offerId - * @param {string} organizationId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getActivationByOfferAndSchool(offerId: string, organizationId: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List the activation details for a selected school, that has activated the selected owned offer. - * @param {string} organizationId - * @param {string} offerId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getActivationBySchoolAndOffer(organizationId: string, offerId: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List all the activation details for all owned offer. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getActivations(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List all owned offers, that has activated by any schools. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List all owned offers, that has activated by the selected school. - * @param {string} organizationId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getOffersBySchool(organizationId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List all schools, that has activated any of the owned offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getSchools(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - - /** - * List all schools, that has activated the selected owned offer. - * @param {string} offerId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApiInterface - */ - getSchoolsByOffer(offerId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - -} - -/** - * EducationProviderApi - object-oriented interface - * @export - * @class EducationProviderApi - * @extends {BaseAPI} - */ -export class EducationProviderApi extends BaseAPI implements EducationProviderApiInterface { - /** - * List the activation details for a selected owned offer, that has activated by the selected school. - * @param {string} offerId - * @param {string} organizationId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getActivationByOfferAndSchool(offerId: string, organizationId: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getActivationByOfferAndSchool(offerId, organizationId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List the activation details for a selected school, that has activated the selected owned offer. - * @param {string} organizationId - * @param {string} offerId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getActivationBySchoolAndOffer(organizationId: string, offerId: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getActivationBySchoolAndOffer(organizationId, offerId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List all the activation details for all owned offer. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getActivations(page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getActivations(page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List all owned offers, that has activated by any schools. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getOffers(page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List all owned offers, that has activated by the selected school. - * @param {string} organizationId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getOffersBySchool(organizationId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getOffersBySchool(organizationId, page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List all schools, that has activated any of the owned offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getSchools(page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getSchools(page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * List all schools, that has activated the selected owned offer. - * @param {string} offerId - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof EducationProviderApi - */ - public getSchoolsByOffer(offerId: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return EducationProviderApiFp(this.configuration).getSchoolsByOffer(offerId, page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } -} - diff --git a/apps/server/src/infra/vidis-client/generated/api/idmbetreiber-api.ts b/apps/server/src/infra/vidis-client/generated/api/idmbetreiber-api.ts index f41affcfc54..2423c2faec6 100644 --- a/apps/server/src/infra/vidis-client/generated/api/idmbetreiber-api.ts +++ b/apps/server/src/infra/vidis-client/generated/api/idmbetreiber-api.ts @@ -29,49 +29,6 @@ import type { PageOfferDTO } from '../models'; */ export const IDMBetreiberApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * List all offers, that has activated by any schools in the selected region. - * @param {string} regionName - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivatedOffersByRegion: async (regionName: string, page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'regionName' is not null or undefined - assertParamExists('getActivatedOffersByRegion', 'regionName', regionName) - const localVarPath = `/v1.0/offers/activated/by-region/{regionName}` - .replace(`{${"regionName"}}`, encodeURIComponent(String(regionName))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * List all offers, that has activated by the selected school. * @param {string} schoolName @@ -106,45 +63,6 @@ export const IDMBetreiberApiAxiosParamCreator = function (configuration?: Config - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * List all offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAllOffers: async (page?: string, pageSize?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1.0/offers/all`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['pageSize'] = pageSize; - } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -164,20 +82,6 @@ export const IDMBetreiberApiAxiosParamCreator = function (configuration?: Config export const IDMBetreiberApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = IDMBetreiberApiAxiosParamCreator(configuration) return { - /** - * List all offers, that has activated by any schools in the selected region. - * @param {string} regionName - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getActivatedOffersByRegion(regionName: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getActivatedOffersByRegion(regionName, page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['IDMBetreiberApi.getActivatedOffersByRegion']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, /** * List all offers, that has activated by the selected school. * @param {string} schoolName @@ -192,19 +96,6 @@ export const IDMBetreiberApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['IDMBetreiberApi.getActivatedOffersBySchool']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, - /** - * List all offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAllOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAllOffers(page, pageSize, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['IDMBetreiberApi.getAllOffers']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, } }; @@ -215,17 +106,6 @@ export const IDMBetreiberApiFp = function(configuration?: Configuration) { export const IDMBetreiberApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = IDMBetreiberApiFp(configuration) return { - /** - * List all offers, that has activated by any schools in the selected region. - * @param {string} regionName - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getActivatedOffersByRegion(regionName: string, page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getActivatedOffersByRegion(regionName, page, pageSize, options).then((request) => request(axios, basePath)); - }, /** * List all offers, that has activated by the selected school. * @param {string} schoolName @@ -237,16 +117,6 @@ export const IDMBetreiberApiFactory = function (configuration?: Configuration, b getActivatedOffersBySchool(schoolName: string, page?: string, pageSize?: string, options?: any): AxiosPromise { return localVarFp.getActivatedOffersBySchool(schoolName, page, pageSize, options).then((request) => request(axios, basePath)); }, - /** - * List all offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAllOffers(page?: string, pageSize?: string, options?: any): AxiosPromise { - return localVarFp.getAllOffers(page, pageSize, options).then((request) => request(axios, basePath)); - }, }; }; @@ -256,17 +126,6 @@ export const IDMBetreiberApiFactory = function (configuration?: Configuration, b * @interface IDMBetreiberApi */ export interface IDMBetreiberApiInterface { - /** - * List all offers, that has activated by any schools in the selected region. - * @param {string} regionName - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IDMBetreiberApiInterface - */ - getActivatedOffersByRegion(regionName: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - /** * List all offers, that has activated by the selected school. * @param {string} schoolName @@ -278,16 +137,6 @@ export interface IDMBetreiberApiInterface { */ getActivatedOffersBySchool(schoolName: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - /** - * List all offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IDMBetreiberApiInterface - */ - getAllOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig): AxiosPromise; - } /** @@ -297,19 +146,6 @@ export interface IDMBetreiberApiInterface { * @extends {BaseAPI} */ export class IDMBetreiberApi extends BaseAPI implements IDMBetreiberApiInterface { - /** - * List all offers, that has activated by any schools in the selected region. - * @param {string} regionName - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IDMBetreiberApi - */ - public getActivatedOffersByRegion(regionName: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return IDMBetreiberApiFp(this.configuration).getActivatedOffersByRegion(regionName, page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } - /** * List all offers, that has activated by the selected school. * @param {string} schoolName @@ -322,17 +158,5 @@ export class IDMBetreiberApi extends BaseAPI implements IDMBetreiberApiInterface public getActivatedOffersBySchool(schoolName: string, page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { return IDMBetreiberApiFp(this.configuration).getActivatedOffersBySchool(schoolName, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } - - /** - * List all offers. - * @param {string} [page] - * @param {string} [pageSize] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof IDMBetreiberApi - */ - public getAllOffers(page?: string, pageSize?: string, options?: RawAxiosRequestConfig) { - return IDMBetreiberApiFp(this.configuration).getAllOffers(page, pageSize, options).then((request) => request(this.axios, this.basePath)); - } } diff --git a/openapitools.json b/openapitools.json index e0b466bd5c0..640cf981421 100644 --- a/openapitools.json +++ b/openapitools.json @@ -65,6 +65,9 @@ "output": "./apps/server/src/infra/vidis-client/generated", "skipValidateSpec": true, "enablePostProcessFile": true, + "openapiNormalizer": { + "FILTER": "operationId:getActivatedOffersBySchool" + }, "additionalProperties": { "apiPackage": "api", "enumNameSuffix": "",