From b60dfb21f9683c6ccada50099dfa9f5d9cdff8d7 Mon Sep 17 00:00:00 2001 From: dominik003 Date: Mon, 9 Sep 2024 15:09:59 +0200 Subject: [PATCH] chore: Update openapi client --- .../src/app/openapi/.openapi-generator/FILES | 2 +- .../api/projects-models-diagrams.service.ts | 16 +++- .../api/projects-models-git.service.ts | 95 +++++++++++++++++-- .../openapi/model/diagram-cache-metadata.ts | 1 + frontend/src/app/openapi/model/git-model.ts | 2 +- frontend/src/app/openapi/model/models.ts | 2 +- .../{patch-git-model.ts => put-git-model.ts} | 2 +- frontend/src/storybook/git.ts | 2 +- 8 files changed, 103 insertions(+), 19 deletions(-) rename frontend/src/app/openapi/model/{patch-git-model.ts => put-git-model.ts} (93%) diff --git a/frontend/src/app/openapi/.openapi-generator/FILES b/frontend/src/app/openapi/.openapi-generator/FILES index bf02952da7..423c41411f 100644 --- a/frontend/src/app/openapi/.openapi-generator/FILES +++ b/frontend/src/app/openapi/.openapi-generator/FILES @@ -87,7 +87,6 @@ model/notice-level.ts model/notice-response.ts model/page-history-event.ts model/page-pipeline-run.ts -model/patch-git-model.ts model/patch-project-user.ts model/patch-project.ts model/patch-t4-c-instance.ts @@ -121,6 +120,7 @@ model/prometheus-configuration-output.ts model/protocol.ts model/pure-variants-licenses-input.ts model/pure-variants-licenses-output.ts +model/put-git-model.ts model/rdp-ports-input.ts model/rdp-ports-output.ts model/resources-input.ts diff --git a/frontend/src/app/openapi/api/projects-models-diagrams.service.ts b/frontend/src/app/openapi/api/projects-models-diagrams.service.ts index ac18cd4c82..d5fcb85202 100644 --- a/frontend/src/app/openapi/api/projects-models-diagrams.service.ts +++ b/frontend/src/app/openapi/api/projects-models-diagrams.service.ts @@ -99,13 +99,14 @@ export class ProjectsModelsDiagramsService { * @param diagramUuidOrFilename * @param projectSlug * @param modelSlug + * @param jobId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, jobId?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, jobId?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, jobId?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDiagram(diagramUuidOrFilename: string, projectSlug: string, modelSlug: string, jobId?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'image/svg+xml' | 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (diagramUuidOrFilename === null || diagramUuidOrFilename === undefined) { throw new Error('Required parameter diagramUuidOrFilename was null or undefined when calling getDiagram.'); } @@ -116,6 +117,12 @@ export class ProjectsModelsDiagramsService { throw new Error('Required parameter modelSlug was null or undefined when calling getDiagram.'); } + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (jobId !== undefined && jobId !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + jobId, 'job_id'); + } + let localVarHeaders = this.defaultHeaders; let localVarCredential: string | undefined; @@ -153,6 +160,7 @@ export class ProjectsModelsDiagramsService { return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, + params: localVarQueryParameters, responseType: "blob", withCredentials: this.configuration.withCredentials, headers: localVarHeaders, diff --git a/frontend/src/app/openapi/api/projects-models-git.service.ts b/frontend/src/app/openapi/api/projects-models-git.service.ts index 0e60953f65..59584332b8 100644 --- a/frontend/src/app/openapi/api/projects-models-git.service.ts +++ b/frontend/src/app/openapi/api/projects-models-git.service.ts @@ -25,9 +25,9 @@ import { GitModel } from '../model/git-model'; // @ts-ignore import { HTTPValidationError } from '../model/http-validation-error'; // @ts-ignore -import { PatchGitModel } from '../model/patch-git-model'; -// @ts-ignore import { PostGitModel } from '../model/post-git-model'; +// @ts-ignore +import { PutGitModel } from '../model/put-git-model'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -268,6 +268,81 @@ export class ProjectsModelsGitService { ); } + /** + * Empty Cache + * @param projectSlug + * @param modelSlug + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public emptyCache(projectSlug: string, modelSlug: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public emptyCache(projectSlug: string, modelSlug: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public emptyCache(projectSlug: string, modelSlug: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public emptyCache(projectSlug: string, modelSlug: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (projectSlug === null || projectSlug === undefined) { + throw new Error('Required parameter projectSlug was null or undefined when calling emptyCache.'); + } + if (modelSlug === null || modelSlug === undefined) { + throw new Error('Required parameter modelSlug was null or undefined when calling emptyCache.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (PersonalAccessToken) required + localVarCredential = this.configuration.lookupCredential('PersonalAccessToken'); + if (localVarCredential) { + localVarHeaders = localVarHeaders.set('Authorization', 'Basic ' + localVarCredential); + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/projects/${this.configuration.encodeParam({name: "projectSlug", value: projectSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/models/${this.configuration.encodeParam({name: "modelSlug", value: modelSlug, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/modelsources/git/empty_cache`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + /** * Get Git Model By Id * @param projectSlug @@ -595,14 +670,14 @@ export class ProjectsModelsGitService { * @param projectSlug * @param gitModelId * @param modelSlug - * @param patchGitModel + * @param putGitModel * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, patchGitModel: PatchGitModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, putGitModel: PutGitModel, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, putGitModel: PutGitModel, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, putGitModel: PutGitModel, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateGitModelById(projectSlug: string, gitModelId: number, modelSlug: string, putGitModel: PutGitModel, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (projectSlug === null || projectSlug === undefined) { throw new Error('Required parameter projectSlug was null or undefined when calling updateGitModelById.'); } @@ -612,8 +687,8 @@ export class ProjectsModelsGitService { if (modelSlug === null || modelSlug === undefined) { throw new Error('Required parameter modelSlug was null or undefined when calling updateGitModelById.'); } - if (patchGitModel === null || patchGitModel === undefined) { - throw new Error('Required parameter patchGitModel was null or undefined when calling updateGitModelById.'); + if (putGitModel === null || putGitModel === undefined) { + throw new Error('Required parameter putGitModel was null or undefined when calling updateGitModelById.'); } let localVarHeaders = this.defaultHeaders; @@ -672,7 +747,7 @@ export class ProjectsModelsGitService { return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - body: patchGitModel, + body: putGitModel, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, diff --git a/frontend/src/app/openapi/model/diagram-cache-metadata.ts b/frontend/src/app/openapi/model/diagram-cache-metadata.ts index 1e3894ed52..8b4893bc3a 100644 --- a/frontend/src/app/openapi/model/diagram-cache-metadata.ts +++ b/frontend/src/app/openapi/model/diagram-cache-metadata.ts @@ -15,5 +15,6 @@ import { DiagramMetadata } from './diagram-metadata'; export interface DiagramCacheMetadata { diagrams: Array; last_updated: string; + job_id: string | null; } diff --git a/frontend/src/app/openapi/model/git-model.ts b/frontend/src/app/openapi/model/git-model.ts index 8d3b1307cf..c5a49c868f 100644 --- a/frontend/src/app/openapi/model/git-model.ts +++ b/frontend/src/app/openapi/model/git-model.ts @@ -18,7 +18,7 @@ export interface GitModel { username: string; password: boolean; id: number; - name: string; primary: boolean; + repository_id: string | null; } diff --git a/frontend/src/app/openapi/model/models.ts b/frontend/src/app/openapi/model/models.ts index 7585cc8939..e4754904d1 100644 --- a/frontend/src/app/openapi/model/models.ts +++ b/frontend/src/app/openapi/model/models.ts @@ -67,7 +67,6 @@ export * from './notice-level'; export * from './notice-response'; export * from './page-history-event'; export * from './page-pipeline-run'; -export * from './patch-git-model'; export * from './patch-project'; export * from './patch-project-user'; export * from './patch-t4-c-instance'; @@ -101,6 +100,7 @@ export * from './prometheus-configuration-output'; export * from './protocol'; export * from './pure-variants-licenses-input'; export * from './pure-variants-licenses-output'; +export * from './put-git-model'; export * from './rdp-ports-input'; export * from './rdp-ports-output'; export * from './resources-input'; diff --git a/frontend/src/app/openapi/model/patch-git-model.ts b/frontend/src/app/openapi/model/put-git-model.ts similarity index 93% rename from frontend/src/app/openapi/model/patch-git-model.ts rename to frontend/src/app/openapi/model/put-git-model.ts index 743aed476e..777c1004ec 100644 --- a/frontend/src/app/openapi/model/patch-git-model.ts +++ b/frontend/src/app/openapi/model/put-git-model.ts @@ -11,7 +11,7 @@ -export interface PatchGitModel { +export interface PutGitModel { path: string; entrypoint: string; revision: string; diff --git a/frontend/src/storybook/git.ts b/frontend/src/storybook/git.ts index fa231060fc..93a5efe11d 100644 --- a/frontend/src/storybook/git.ts +++ b/frontend/src/storybook/git.ts @@ -11,13 +11,13 @@ import { export const mockPrimaryGitModel: Readonly = { id: 1, - name: 'fakeGitModelName', primary: true, path: 'fakePath', revision: 'fakeRevision', entrypoint: 'fakeEntrypoint', password: false, username: 'fakeUsername', + repository_id: null, }; export class MockGitModelService implements Partial {