improve admin release and deployment safeguards
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -150,7 +150,7 @@ export function listBuildJobs(appKey?: string) {
|
||||
return apiRequest<BuildJob[]>(`/apps/builds${query}`);
|
||||
}
|
||||
|
||||
export function listBuildJobsPage(options: { appKey?: string; page: number; limit: number; since?: string; status?: string }) {
|
||||
export function listBuildJobsPage(options: { appKey?: string; page: number; limit: number; since?: string; status?: string; hideReleaseCandidates?: boolean }) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
@@ -158,6 +158,7 @@ export function listBuildJobsPage(options: { appKey?: string; page: number; limi
|
||||
if (options.appKey) params.set('appKey', options.appKey);
|
||||
if (options.since) params.set('since', options.since);
|
||||
if (options.status) params.set('status', options.status);
|
||||
if (options.hideReleaseCandidates) params.set('hideReleaseCandidates', 'true');
|
||||
return apiRequest<{ jobs: BuildJob[]; total: number; page: number; limit: number }>(`/apps/builds?${params.toString()}`);
|
||||
}
|
||||
|
||||
@@ -176,6 +177,12 @@ export function deleteBuildJob(buildJobId: string) {
|
||||
return apiRequest<{ deleted: boolean }>(`/apps/builds/${buildJobId}`, { method: 'DELETE' });
|
||||
}
|
||||
|
||||
export function hideReleaseCandidate(buildJobId: string) {
|
||||
return apiRequest<{ buildJob: BuildJob }>(`/apps/builds/${buildJobId}/hide-release-candidate`, {
|
||||
method: 'PATCH'
|
||||
});
|
||||
}
|
||||
|
||||
export function listReleases(appKey?: string) {
|
||||
const query = appKey ? `?appKey=${encodeURIComponent(appKey)}` : '';
|
||||
return apiRequest<AppRelease[]>(`/apps/releases${query}`);
|
||||
@@ -198,6 +205,12 @@ export function createRelease(input: { appId: string; version: string; branch?:
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteRelease(releaseId: string) {
|
||||
return apiRequest<{ deleted: boolean }>(`/apps/releases/${releaseId}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
export function listDeployments(appKey?: string) {
|
||||
const query = appKey ? `?appKey=${encodeURIComponent(appKey)}` : '';
|
||||
return apiRequest<DeploymentJob[]>(`/apps/deployments${query}`);
|
||||
|
||||
Reference in New Issue
Block a user