Skip to content

Commit a013fc9

Browse files
committed
fix: openapi
1 parent 0f3573f commit a013fc9

File tree

5 files changed

+65
-26
lines changed

5 files changed

+65
-26
lines changed

client/src/app/components/release-candidate-table/release-candidate-table.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, computed, inject } from '@angular/core';
2-
import { getAllReleaseCandidatesOptions } from '@app/core/modules/openapi/@tanstack/angular-query-experimental.gen';
2+
import { getAllReleaseInfosOptions } from '@app/core/modules/openapi/@tanstack/angular-query-experimental.gen';
33
import { FILTER_OPTIONS_TOKEN, SearchTableService } from '@app/core/services/search-table.service';
44
import { injectQuery } from '@tanstack/angular-query-experimental';
55
import { IconsModule } from 'icons.module';
@@ -21,7 +21,7 @@ const FILTER_OPTIONS: { name: string; filter: (prs: ReleaseInfoListDto[]) => Rel
2121
templateUrl: './release-candidate-table.component.html',
2222
})
2323
export class ReleaseCandidateTableComponent {
24-
releaseCandidatesQuery = injectQuery(() => getAllReleaseCandidatesOptions());
24+
releaseCandidatesQuery = injectQuery(() => getAllReleaseInfosOptions());
2525
router = inject(Router);
2626
searchTableService = inject(SearchTableService);
2727

client/src/app/core/modules/openapi/@tanstack/angular-query-experimental.gen.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import {
1313
extendEnvironmentLock,
1414
syncWorkflowsByRepositoryId,
1515
createWorkflowGroup,
16-
getAllReleaseCandidates,
16+
getAllReleaseInfos,
1717
createReleaseCandidate,
18+
publishReleaseDraft,
1819
evaluate,
1920
setPrPinnedByNumber,
2021
deployToEnvironment,
@@ -35,7 +36,7 @@ import {
3536
getAllRepositories,
3637
getRepositoryById,
3738
deleteReleaseCandidateByName,
38-
getReleaseCandidateByName,
39+
getReleaseInfoByName,
3940
getCommitsSinceLastReleaseCandidate,
4041
getAllPullRequests,
4142
getPullRequestById,
@@ -75,7 +76,7 @@ import type {
7576
SyncWorkflowsByRepositoryIdData,
7677
CreateWorkflowGroupData,
7778
CreateWorkflowGroupResponse,
78-
GetAllReleaseCandidatesData,
79+
GetAllReleaseInfosData,
7980
CreateReleaseCandidateData,
8081
CreateReleaseCandidateResponse,
8182
PublishReleaseDraftData,
@@ -345,20 +346,20 @@ export const createWorkflowGroupMutation = (options?: Partial<Options<CreateWork
345346
return mutationOptions;
346347
};
347348

348-
export const getAllReleaseCandidatesQueryKey = (options?: Options<GetAllReleaseCandidatesData>) => createQueryKey('getAllReleaseCandidates', options);
349+
export const getAllReleaseInfosQueryKey = (options?: Options<GetAllReleaseInfosData>) => createQueryKey('getAllReleaseInfos', options);
349350

350-
export const getAllReleaseCandidatesOptions = (options?: Options<GetAllReleaseCandidatesData>) => {
351+
export const getAllReleaseInfosOptions = (options?: Options<GetAllReleaseInfosData>) => {
351352
return queryOptions({
352353
queryFn: async ({ queryKey, signal }) => {
353-
const { data } = await getAllReleaseCandidates({
354+
const { data } = await getAllReleaseInfos({
354355
...options,
355356
...queryKey[0],
356357
signal,
357358
throwOnError: true,
358359
});
359360
return data;
360361
},
361-
queryKey: getAllReleaseCandidatesQueryKey(options),
362+
queryKey: getAllReleaseInfosQueryKey(options),
362363
});
363364
};
364365

@@ -393,6 +394,37 @@ export const createReleaseCandidateMutation = (options?: Partial<Options<CreateR
393394
return mutationOptions;
394395
};
395396

397+
export const publishReleaseDraftQueryKey = (options: Options<PublishReleaseDraftData>) => createQueryKey('publishReleaseDraft', options);
398+
399+
export const publishReleaseDraftOptions = (options: Options<PublishReleaseDraftData>) => {
400+
return queryOptions({
401+
queryFn: async ({ queryKey, signal }) => {
402+
const { data } = await publishReleaseDraft({
403+
...options,
404+
...queryKey[0],
405+
signal,
406+
throwOnError: true,
407+
});
408+
return data;
409+
},
410+
queryKey: publishReleaseDraftQueryKey(options),
411+
});
412+
};
413+
414+
export const publishReleaseDraftMutation = (options?: Partial<Options<PublishReleaseDraftData>>) => {
415+
const mutationOptions: MutationOptions<unknown, DefaultError, Options<PublishReleaseDraftData>> = {
416+
mutationFn: async localOptions => {
417+
const { data } = await publishReleaseDraft({
418+
...options,
419+
...localOptions,
420+
throwOnError: true,
421+
});
422+
return data;
423+
},
424+
};
425+
return mutationOptions;
426+
};
427+
396428
export const evaluateQueryKey = (options: Options<EvaluateData>) => createQueryKey('evaluate', options);
397429

398430
export const evaluateOptions = (options: Options<EvaluateData>) => {
@@ -792,7 +824,7 @@ export const deleteReleaseCandidateByNameMutation = (options?: Partial<Options<D
792824
return mutationOptions;
793825
};
794826

795-
export const getReleaseCandidateByNameQueryKey = (options: Options<GetReleaseCandidateByNameData>) => createQueryKey('getReleaseCandidateByName', options);
827+
export const getReleaseInfoByNameQueryKey = (options: Options<GetReleaseInfoByNameData>) => createQueryKey('getReleaseInfoByName', options);
796828

797829
export const getReleaseInfoByNameOptions = (options: Options<GetReleaseInfoByNameData>) => {
798830
return queryOptions({

client/src/app/core/modules/openapi/sdk.gen.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import type {
2121
SyncWorkflowsByRepositoryIdData,
2222
CreateWorkflowGroupData,
2323
CreateWorkflowGroupResponse,
24-
GetAllReleaseCandidatesData,
25-
GetAllReleaseCandidatesResponse,
24+
GetAllReleaseInfosData,
25+
GetAllReleaseInfosResponse,
2626
CreateReleaseCandidateData,
2727
CreateReleaseCandidateResponse,
2828
PublishReleaseDraftData,
@@ -216,16 +216,16 @@ export const createWorkflowGroup = <ThrowOnError extends boolean = false>(option
216216
});
217217
};
218218

219-
export const getAllReleaseCandidates = <ThrowOnError extends boolean = false>(options?: Options<GetAllReleaseCandidatesData, ThrowOnError>) => {
220-
return (options?.client ?? _heyApiClient).get<GetAllReleaseCandidatesResponse, unknown, ThrowOnError>({
221-
url: '/api/release-candidate',
219+
export const getAllReleaseInfos = <ThrowOnError extends boolean = false>(options?: Options<GetAllReleaseInfosData, ThrowOnError>) => {
220+
return (options?.client ?? _heyApiClient).get<GetAllReleaseInfosResponse, unknown, ThrowOnError>({
221+
url: '/api/release-info',
222222
...options,
223223
});
224224
};
225225

226226
export const createReleaseCandidate = <ThrowOnError extends boolean = false>(options: Options<CreateReleaseCandidateData, ThrowOnError>) => {
227227
return (options.client ?? _heyApiClient).post<CreateReleaseCandidateResponse, unknown, ThrowOnError>({
228-
url: '/api/release-candidate',
228+
url: '/api/release-info',
229229
...options,
230230
headers: {
231231
'Content-Type': 'application/json',
@@ -234,9 +234,16 @@ export const createReleaseCandidate = <ThrowOnError extends boolean = false>(opt
234234
});
235235
};
236236

237+
export const publishReleaseDraft = <ThrowOnError extends boolean = false>(options: Options<PublishReleaseDraftData, ThrowOnError>) => {
238+
return (options.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>({
239+
url: '/api/release-info/{name}/publish',
240+
...options,
241+
});
242+
};
243+
237244
export const evaluate = <ThrowOnError extends boolean = false>(options: Options<EvaluateData, ThrowOnError>) => {
238245
return (options.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>({
239-
url: '/api/release-candidate/{name}/evaluate/{isWorking}',
246+
url: '/api/release-info/{name}/evaluate/{isWorking}',
240247
...options,
241248
});
242249
};
@@ -381,21 +388,21 @@ export const getRepositoryById = <ThrowOnError extends boolean = false>(options:
381388

382389
export const deleteReleaseCandidateByName = <ThrowOnError extends boolean = false>(options: Options<DeleteReleaseCandidateByNameData, ThrowOnError>) => {
383390
return (options.client ?? _heyApiClient).delete<DeleteReleaseCandidateByNameResponse, unknown, ThrowOnError>({
384-
url: '/api/release-candidate/{name}',
391+
url: '/api/release-info/{name}',
385392
...options,
386393
});
387394
};
388395

389-
export const getReleaseCandidateByName = <ThrowOnError extends boolean = false>(options: Options<GetReleaseCandidateByNameData, ThrowOnError>) => {
390-
return (options.client ?? _heyApiClient).get<GetReleaseCandidateByNameResponse, unknown, ThrowOnError>({
391-
url: '/api/release-candidate/{name}',
396+
export const getReleaseInfoByName = <ThrowOnError extends boolean = false>(options: Options<GetReleaseInfoByNameData, ThrowOnError>) => {
397+
return (options.client ?? _heyApiClient).get<GetReleaseInfoByNameResponse, unknown, ThrowOnError>({
398+
url: '/api/release-info/{name}',
392399
...options,
393400
});
394401
};
395402

396403
export const getCommitsSinceLastReleaseCandidate = <ThrowOnError extends boolean = false>(options: Options<GetCommitsSinceLastReleaseCandidateData, ThrowOnError>) => {
397404
return (options.client ?? _heyApiClient).get<GetCommitsSinceLastReleaseCandidateResponse, unknown, ThrowOnError>({
398-
url: '/api/release-candidate/newcommits',
405+
url: '/api/release-info/newcommits',
399406
...options,
400407
});
401408
};

client/src/app/core/modules/openapi/types.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,21 +581,21 @@ export type CreateWorkflowGroupResponses = {
581581

582582
export type CreateWorkflowGroupResponse = CreateWorkflowGroupResponses[keyof CreateWorkflowGroupResponses];
583583

584-
export type GetAllReleaseCandidatesData = {
584+
export type GetAllReleaseInfosData = {
585585
body?: never;
586586
path?: never;
587587
query?: never;
588588
url: '/api/release-info';
589589
};
590590

591-
export type GetAllReleaseCandidatesResponses = {
591+
export type GetAllReleaseInfosResponses = {
592592
/**
593593
* OK
594594
*/
595595
200: Array<ReleaseInfoListDto>;
596596
};
597597

598-
export type GetAllReleaseCandidatesResponse = GetAllReleaseCandidatesResponses[keyof GetAllReleaseCandidatesResponses];
598+
export type GetAllReleaseInfosResponse = GetAllReleaseInfosResponses[keyof GetAllReleaseInfosResponses];
599599

600600
export type CreateReleaseCandidateData = {
601601
body: ReleaseCandidateCreateDto;

server/application-server/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ paths:
247247
get:
248248
tags:
249249
- release-info-controller
250-
operationId: getAllReleaseCandidates
250+
operationId: getAllReleaseInfos
251251
responses:
252252
"200":
253253
description: OK

0 commit comments

Comments
 (0)