paginate app operations and refine runtime settings layout
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -150,6 +150,17 @@ 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 }) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
});
|
||||
if (options.appKey) params.set('appKey', options.appKey);
|
||||
if (options.since) params.set('since', options.since);
|
||||
if (options.status) params.set('status', options.status);
|
||||
return apiRequest<{ jobs: BuildJob[]; total: number; page: number; limit: number }>(`/apps/builds?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function createBuildJob(input: { componentId: string; branch?: string; commitSha?: string }) {
|
||||
return apiRequest<{ buildJob: BuildJob }>('/apps/builds', {
|
||||
method: 'POST',
|
||||
@@ -170,6 +181,16 @@ export function listReleases(appKey?: string) {
|
||||
return apiRequest<AppRelease[]>(`/apps/releases${query}`);
|
||||
}
|
||||
|
||||
export function listReleasesPage(options: { appKey?: string; page: number; limit: number; since?: string }) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
});
|
||||
if (options.appKey) params.set('appKey', options.appKey);
|
||||
if (options.since) params.set('since', options.since);
|
||||
return apiRequest<{ releases: AppRelease[]; total: number; page: number; limit: number; usedBuildIds?: string[]; usedValues?: string[] }>(`/apps/releases?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function createRelease(input: { appId: string; version: string; branch?: string; buildJobIds: string[] }) {
|
||||
return apiRequest<{ release: AppRelease }>('/apps/releases', {
|
||||
method: 'POST',
|
||||
@@ -182,6 +203,16 @@ export function listDeployments(appKey?: string) {
|
||||
return apiRequest<DeploymentJob[]>(`/apps/deployments${query}`);
|
||||
}
|
||||
|
||||
export function listDeploymentsPage(options: { appKey?: string; page: number; limit: number; since?: string }) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
});
|
||||
if (options.appKey) params.set('appKey', options.appKey);
|
||||
if (options.since) params.set('since', options.since);
|
||||
return apiRequest<{ deployments: DeploymentJob[]; total: number; page: number; limit: number; deployedReleaseIds?: string[] }>(`/apps/deployments?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function createDeployment(input: { releaseId: string; environment: string; namespace: string; updateLauncherAppVersion?: boolean }) {
|
||||
return apiRequest<{ deploymentJob: DeploymentJob }>('/apps/deployments', {
|
||||
method: 'POST',
|
||||
@@ -193,6 +224,16 @@ export function listMigrations() {
|
||||
return apiRequest<RuntimeControlJob[]>('/apps/migrations');
|
||||
}
|
||||
|
||||
export function listMigrationsPage(options: { appId?: string; page: number; limit: number; since?: string }) {
|
||||
const params = new URLSearchParams({
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
});
|
||||
if (options.appId) params.set('appId', options.appId);
|
||||
if (options.since) params.set('since', options.since);
|
||||
return apiRequest<{ jobs: RuntimeControlJob[]; total: number; page: number; limit: number }>(`/apps/migrations?${params.toString()}`);
|
||||
}
|
||||
|
||||
export function createMigration(input: {
|
||||
releaseId: string;
|
||||
migrationComponentId: string;
|
||||
|
||||
Reference in New Issue
Block a user