This commit is contained in:
@@ -204,18 +204,42 @@ export function listStudioRepos(limit = 50) {
|
||||
.then((result) => result.repos);
|
||||
}
|
||||
|
||||
export function listGiteaCommits(owner: string, repo: string, branch = 'develop', limit = 5) {
|
||||
export function listGiteaCommits(
|
||||
owner: string,
|
||||
repo: string,
|
||||
branch = 'develop',
|
||||
options?: { page?: number; limit?: number; since?: string }
|
||||
) {
|
||||
const params = new URLSearchParams({
|
||||
sha: branch,
|
||||
limit: String(limit)
|
||||
page: String(options?.page ?? 1),
|
||||
limit: String(options?.limit ?? 5)
|
||||
});
|
||||
if (options?.since) params.set('since', options.since);
|
||||
return apiRequest<{ commits: GiteaCommit[] }>(
|
||||
`/gitea/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits?${params.toString()}`
|
||||
).then((result) => result.commits);
|
||||
}
|
||||
|
||||
export function listLauncherBuildJobs() {
|
||||
return apiRequest<LauncherBuildJob[]>('/launcher/builds');
|
||||
export function getGiteaCommitDiff(owner: string, repo: string, sha: string) {
|
||||
return apiRequest<{ diff: string }>(
|
||||
`/gitea/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits/${encodeURIComponent(sha)}/diff`
|
||||
).then((result) => result.diff);
|
||||
}
|
||||
|
||||
export function listLauncherBuildJobs(options?: {
|
||||
target?: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
since?: string;
|
||||
}) {
|
||||
const params = new URLSearchParams();
|
||||
if (options?.target) params.set('target', options.target);
|
||||
if (options?.page) params.set('page', String(options.page));
|
||||
if (options?.limit) params.set('limit', String(options.limit));
|
||||
if (options?.since) params.set('since', options.since);
|
||||
const query = params.toString() ? `?${params.toString()}` : '';
|
||||
return apiRequest<LauncherBuildJob[]>(`/launcher/builds${query}`);
|
||||
}
|
||||
|
||||
export function getLauncherBackendDeployment() {
|
||||
|
||||
Reference in New Issue
Block a user