1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

chore(deps): lock file maintenance (#3876)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <qwerty287@posteo.de>
This commit is contained in:
renovate[bot] 2024-07-07 01:15:18 -07:00 committed by GitHub
parent 987c201c0d
commit 8a5d36451c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 1721 additions and 976 deletions

1590
docs/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

932
web/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -70,19 +70,19 @@ export default class ApiClient {
return res.text(); return res.text();
} }
_get(path: string) { async _get(path: string) {
return this._request('GET', path); return this._request('GET', path);
} }
_post(path: string, data?: unknown) { async _post(path: string, data?: unknown) {
return this._request('POST', path, data); return this._request('POST', path, data);
} }
_patch(path: string, data?: unknown) { async _patch(path: string, data?: unknown) {
return this._request('PATCH', path, data); return this._request('PATCH', path, data);
} }
_delete(path: string) { async _delete(path: string) {
return this._request('DELETE', path); return this._request('DELETE', path);
} }

View File

@ -42,57 +42,57 @@ interface PaginationOptions {
} }
export default class WoodpeckerClient extends ApiClient { export default class WoodpeckerClient extends ApiClient {
getRepoList(opts?: RepoListOptions): Promise<Repo[]> { async getRepoList(opts?: RepoListOptions): Promise<Repo[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/user/repos?${query}`) as Promise<Repo[]>; return this._get(`/api/user/repos?${query}`) as Promise<Repo[]>;
} }
lookupRepo(owner: string, name: string): Promise<Repo | undefined> { async lookupRepo(owner: string, name: string): Promise<Repo | undefined> {
return this._get(`/api/repos/lookup/${owner}/${name}`) as Promise<Repo | undefined>; return this._get(`/api/repos/lookup/${owner}/${name}`) as Promise<Repo | undefined>;
} }
getRepo(repoId: number): Promise<Repo> { async getRepo(repoId: number): Promise<Repo> {
return this._get(`/api/repos/${repoId}`) as Promise<Repo>; return this._get(`/api/repos/${repoId}`) as Promise<Repo>;
} }
getRepoPermissions(repoId: number): Promise<RepoPermissions> { async getRepoPermissions(repoId: number): Promise<RepoPermissions> {
return this._get(`/api/repos/${repoId}/permissions`) as Promise<RepoPermissions>; return this._get(`/api/repos/${repoId}/permissions`) as Promise<RepoPermissions>;
} }
getRepoBranches(repoId: number, opts?: PaginationOptions): Promise<string[]> { async getRepoBranches(repoId: number, opts?: PaginationOptions): Promise<string[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/branches?${query}`) as Promise<string[]>; return this._get(`/api/repos/${repoId}/branches?${query}`) as Promise<string[]>;
} }
getRepoPullRequests(repoId: number, opts?: PaginationOptions): Promise<PullRequest[]> { async getRepoPullRequests(repoId: number, opts?: PaginationOptions): Promise<PullRequest[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/pull_requests?${query}`) as Promise<PullRequest[]>; return this._get(`/api/repos/${repoId}/pull_requests?${query}`) as Promise<PullRequest[]>;
} }
activateRepo(forgeRemoteId: string): Promise<Repo> { async activateRepo(forgeRemoteId: string): Promise<Repo> {
return this._post(`/api/repos?forge_remote_id=${forgeRemoteId}`) as Promise<Repo>; return this._post(`/api/repos?forge_remote_id=${forgeRemoteId}`) as Promise<Repo>;
} }
updateRepo(repoId: number, repoSettings: RepoSettings): Promise<unknown> { async updateRepo(repoId: number, repoSettings: RepoSettings): Promise<unknown> {
return this._patch(`/api/repos/${repoId}`, repoSettings); return this._patch(`/api/repos/${repoId}`, repoSettings);
} }
deleteRepo(repoId: number, remove = true): Promise<unknown> { async deleteRepo(repoId: number, remove = true): Promise<unknown> {
const query = encodeQueryString({ remove }); const query = encodeQueryString({ remove });
return this._delete(`/api/repos/${repoId}?${query}`); return this._delete(`/api/repos/${repoId}?${query}`);
} }
repairRepo(repoId: number): Promise<unknown> { async repairRepo(repoId: number): Promise<unknown> {
return this._post(`/api/repos/${repoId}/repair`); return this._post(`/api/repos/${repoId}/repair`);
} }
createPipeline(repoId: number, options: PipelineOptions): Promise<Pipeline> { async createPipeline(repoId: number, options: PipelineOptions): Promise<Pipeline> {
return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/pipelines`, options) as Promise<Pipeline>;
} }
// Deploy triggers a deployment for an existing pipeline using the // Deploy triggers a deployment for an existing pipeline using the
// specified target environment and task. // specified target environment and task.
deployPipeline(repoId: number, pipelineNumber: string, options: DeploymentOptions): Promise<Pipeline> { async deployPipeline(repoId: number, pipelineNumber: string, options: DeploymentOptions): Promise<Pipeline> {
const vars = { const vars = {
...options.variables, ...options.variables,
event: 'deployment', event: 'deployment',
@ -103,36 +103,39 @@ export default class WoodpeckerClient extends ApiClient {
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}?${query}`) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}?${query}`) as Promise<Pipeline>;
} }
getPipelineList(repoId: number, opts?: PaginationOptions & { before?: string; after?: string }): Promise<Pipeline[]> { async getPipelineList(
repoId: number,
opts?: PaginationOptions & { before?: string; after?: string },
): Promise<Pipeline[]> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/pipelines?${query}`) as Promise<Pipeline[]>; return this._get(`/api/repos/${repoId}/pipelines?${query}`) as Promise<Pipeline[]>;
} }
getPipeline(repoId: number, pipelineNumber: number | 'latest'): Promise<Pipeline> { async getPipeline(repoId: number, pipelineNumber: number | 'latest'): Promise<Pipeline> {
return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}`) as Promise<Pipeline>; return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}`) as Promise<Pipeline>;
} }
getPipelineConfig(repoId: number, pipelineNumber: number): Promise<PipelineConfig[]> { async getPipelineConfig(repoId: number, pipelineNumber: number): Promise<PipelineConfig[]> {
return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}/config`) as Promise<PipelineConfig[]>; return this._get(`/api/repos/${repoId}/pipelines/${pipelineNumber}/config`) as Promise<PipelineConfig[]>;
} }
getPipelineFeed(): Promise<PipelineFeed[]> { async getPipelineFeed(): Promise<PipelineFeed[]> {
return this._get(`/api/user/feed`) as Promise<PipelineFeed[]>; return this._get(`/api/user/feed`) as Promise<PipelineFeed[]>;
} }
cancelPipeline(repoId: number, pipelineNumber: number): Promise<unknown> { async cancelPipeline(repoId: number, pipelineNumber: number): Promise<unknown> {
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/cancel`); return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/cancel`);
} }
approvePipeline(repoId: number, pipelineNumber: string): Promise<unknown> { async approvePipeline(repoId: number, pipelineNumber: string): Promise<unknown> {
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/approve`); return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/approve`);
} }
declinePipeline(repoId: number, pipelineNumber: string): Promise<unknown> { async declinePipeline(repoId: number, pipelineNumber: string): Promise<unknown> {
return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/decline`); return this._post(`/api/repos/${repoId}/pipelines/${pipelineNumber}/decline`);
} }
restartPipeline( async restartPipeline(
repoId: number, repoId: number,
pipeline: string, pipeline: string,
opts?: { event?: string; deploy_to?: string; fork?: boolean }, opts?: { event?: string; deploy_to?: string; fork?: boolean },
@ -141,257 +144,257 @@ export default class WoodpeckerClient extends ApiClient {
return this._post(`/api/repos/${repoId}/pipelines/${pipeline}?${query}`) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/pipelines/${pipeline}?${query}`) as Promise<Pipeline>;
} }
getLogs(repoId: number, pipeline: number, step: number): Promise<PipelineLog[]> { async getLogs(repoId: number, pipeline: number, step: number): Promise<PipelineLog[]> {
return this._get(`/api/repos/${repoId}/logs/${pipeline}/${step}`) as Promise<PipelineLog[]>; return this._get(`/api/repos/${repoId}/logs/${pipeline}/${step}`) as Promise<PipelineLog[]>;
} }
deleteLogs(repoId: number, pipeline: number, step: number): Promise<unknown> { async deleteLogs(repoId: number, pipeline: number, step: number): Promise<unknown> {
return this._delete(`/api/repos/${repoId}/logs/${pipeline}/${step}`); return this._delete(`/api/repos/${repoId}/logs/${pipeline}/${step}`);
} }
getSecretList(repoId: number, opts?: PaginationOptions): Promise<Secret[] | null> { async getSecretList(repoId: number, opts?: PaginationOptions): Promise<Secret[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/secrets?${query}`) as Promise<Secret[] | null>; return this._get(`/api/repos/${repoId}/secrets?${query}`) as Promise<Secret[] | null>;
} }
createSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> { async createSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> {
return this._post(`/api/repos/${repoId}/secrets`, secret); return this._post(`/api/repos/${repoId}/secrets`, secret);
} }
updateSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> { async updateSecret(repoId: number, secret: Partial<Secret>): Promise<unknown> {
const secretName = encodeURIComponent(secret.name ?? ''); const secretName = encodeURIComponent(secret.name ?? '');
return this._patch(`/api/repos/${repoId}/secrets/${secretName}`, secret); return this._patch(`/api/repos/${repoId}/secrets/${secretName}`, secret);
} }
deleteSecret(repoId: number, secretName: string): Promise<unknown> { async deleteSecret(repoId: number, secretName: string): Promise<unknown> {
const name = encodeURIComponent(secretName); const name = encodeURIComponent(secretName);
return this._delete(`/api/repos/${repoId}/secrets/${name}`); return this._delete(`/api/repos/${repoId}/secrets/${name}`);
} }
getRegistryList(repoId: number, opts?: PaginationOptions): Promise<Registry[] | null> { async getRegistryList(repoId: number, opts?: PaginationOptions): Promise<Registry[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/registries?${query}`) as Promise<Registry[] | null>; return this._get(`/api/repos/${repoId}/registries?${query}`) as Promise<Registry[] | null>;
} }
createRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> { async createRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> {
return this._post(`/api/repos/${repoId}/registries`, registry); return this._post(`/api/repos/${repoId}/registries`, registry);
} }
updateRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> { async updateRegistry(repoId: number, registry: Partial<Registry>): Promise<unknown> {
return this._patch(`/api/repos/${repoId}/registries/${registry.address}`, registry); return this._patch(`/api/repos/${repoId}/registries/${registry.address}`, registry);
} }
deleteRegistry(repoId: number, registryAddress: string): Promise<unknown> { async deleteRegistry(repoId: number, registryAddress: string): Promise<unknown> {
return this._delete(`/api/repos/${repoId}/registries/${registryAddress}`); return this._delete(`/api/repos/${repoId}/registries/${registryAddress}`);
} }
getOrgRegistryList(orgId: number, opts?: PaginationOptions): Promise<Registry[] | null> { async getOrgRegistryList(orgId: number, opts?: PaginationOptions): Promise<Registry[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/orgs/${orgId}/registries?${query}`) as Promise<Registry[] | null>; return this._get(`/api/orgs/${orgId}/registries?${query}`) as Promise<Registry[] | null>;
} }
createOrgRegistry(orgId: number, registry: Partial<Registry>): Promise<unknown> { async createOrgRegistry(orgId: number, registry: Partial<Registry>): Promise<unknown> {
return this._post(`/api/orgs/${orgId}/registries`, registry); return this._post(`/api/orgs/${orgId}/registries`, registry);
} }
updateOrgRegistry(orgId: number, registry: Partial<Registry>): Promise<unknown> { async updateOrgRegistry(orgId: number, registry: Partial<Registry>): Promise<unknown> {
return this._patch(`/api/orgs/${orgId}/registries/${registry.address}`, registry); return this._patch(`/api/orgs/${orgId}/registries/${registry.address}`, registry);
} }
deleteOrgRegistry(orgId: number, registryAddress: string): Promise<unknown> { async deleteOrgRegistry(orgId: number, registryAddress: string): Promise<unknown> {
return this._delete(`/api/orgs/${orgId}/registries/${registryAddress}`); return this._delete(`/api/orgs/${orgId}/registries/${registryAddress}`);
} }
getGlobalRegistryList(opts?: PaginationOptions): Promise<Registry[] | null> { async getGlobalRegistryList(opts?: PaginationOptions): Promise<Registry[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/registries?${query}`) as Promise<Registry[] | null>; return this._get(`/api/registries?${query}`) as Promise<Registry[] | null>;
} }
createGlobalRegistry(registry: Partial<Registry>): Promise<unknown> { async createGlobalRegistry(registry: Partial<Registry>): Promise<unknown> {
return this._post(`/api/registries`, registry); return this._post(`/api/registries`, registry);
} }
updateGlobalRegistry(registry: Partial<Registry>): Promise<unknown> { async updateGlobalRegistry(registry: Partial<Registry>): Promise<unknown> {
return this._patch(`/api/registries/${registry.address}`, registry); return this._patch(`/api/registries/${registry.address}`, registry);
} }
deleteGlobalRegistry(registryAddress: string): Promise<unknown> { async deleteGlobalRegistry(registryAddress: string): Promise<unknown> {
return this._delete(`/api/registries/${registryAddress}`); return this._delete(`/api/registries/${registryAddress}`);
} }
getCronList(repoId: number, opts?: PaginationOptions): Promise<Cron[] | null> { async getCronList(repoId: number, opts?: PaginationOptions): Promise<Cron[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos/${repoId}/cron?${query}`) as Promise<Cron[] | null>; return this._get(`/api/repos/${repoId}/cron?${query}`) as Promise<Cron[] | null>;
} }
createCron(repoId: number, cron: Partial<Cron>): Promise<unknown> { async createCron(repoId: number, cron: Partial<Cron>): Promise<unknown> {
return this._post(`/api/repos/${repoId}/cron`, cron); return this._post(`/api/repos/${repoId}/cron`, cron);
} }
updateCron(repoId: number, cron: Partial<Cron>): Promise<unknown> { async updateCron(repoId: number, cron: Partial<Cron>): Promise<unknown> {
return this._patch(`/api/repos/${repoId}/cron/${cron.id}`, cron); return this._patch(`/api/repos/${repoId}/cron/${cron.id}`, cron);
} }
deleteCron(repoId: number, cronId: number): Promise<unknown> { async deleteCron(repoId: number, cronId: number): Promise<unknown> {
return this._delete(`/api/repos/${repoId}/cron/${cronId}`); return this._delete(`/api/repos/${repoId}/cron/${cronId}`);
} }
runCron(repoId: number, cronId: number): Promise<Pipeline> { async runCron(repoId: number, cronId: number): Promise<Pipeline> {
return this._post(`/api/repos/${repoId}/cron/${cronId}`) as Promise<Pipeline>; return this._post(`/api/repos/${repoId}/cron/${cronId}`) as Promise<Pipeline>;
} }
getOrg(orgId: number): Promise<Org> { async getOrg(orgId: number): Promise<Org> {
return this._get(`/api/orgs/${orgId}`) as Promise<Org>; return this._get(`/api/orgs/${orgId}`) as Promise<Org>;
} }
lookupOrg(name: string): Promise<Org> { async lookupOrg(name: string): Promise<Org> {
return this._get(`/api/orgs/lookup/${name}`) as Promise<Org>; return this._get(`/api/orgs/lookup/${name}`) as Promise<Org>;
} }
getOrgPermissions(orgId: number): Promise<OrgPermissions> { async getOrgPermissions(orgId: number): Promise<OrgPermissions> {
return this._get(`/api/orgs/${orgId}/permissions`) as Promise<OrgPermissions>; return this._get(`/api/orgs/${orgId}/permissions`) as Promise<OrgPermissions>;
} }
getOrgSecretList(orgId: number, opts?: PaginationOptions): Promise<Secret[] | null> { async getOrgSecretList(orgId: number, opts?: PaginationOptions): Promise<Secret[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/orgs/${orgId}/secrets?${query}`) as Promise<Secret[] | null>; return this._get(`/api/orgs/${orgId}/secrets?${query}`) as Promise<Secret[] | null>;
} }
createOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> { async createOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> {
return this._post(`/api/orgs/${orgId}/secrets`, secret); return this._post(`/api/orgs/${orgId}/secrets`, secret);
} }
updateOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> { async updateOrgSecret(orgId: number, secret: Partial<Secret>): Promise<unknown> {
const secretName = encodeURIComponent(secret.name ?? ''); const secretName = encodeURIComponent(secret.name ?? '');
return this._patch(`/api/orgs/${orgId}/secrets/${secretName}`, secret); return this._patch(`/api/orgs/${orgId}/secrets/${secretName}`, secret);
} }
deleteOrgSecret(orgId: number, secretName: string): Promise<unknown> { async deleteOrgSecret(orgId: number, secretName: string): Promise<unknown> {
const name = encodeURIComponent(secretName); const name = encodeURIComponent(secretName);
return this._delete(`/api/orgs/${orgId}/secrets/${name}`); return this._delete(`/api/orgs/${orgId}/secrets/${name}`);
} }
getGlobalSecretList(opts?: PaginationOptions): Promise<Secret[] | null> { async getGlobalSecretList(opts?: PaginationOptions): Promise<Secret[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/secrets?${query}`) as Promise<Secret[] | null>; return this._get(`/api/secrets?${query}`) as Promise<Secret[] | null>;
} }
createGlobalSecret(secret: Partial<Secret>): Promise<unknown> { async createGlobalSecret(secret: Partial<Secret>): Promise<unknown> {
return this._post(`/api/secrets`, secret); return this._post(`/api/secrets`, secret);
} }
updateGlobalSecret(secret: Partial<Secret>): Promise<unknown> { async updateGlobalSecret(secret: Partial<Secret>): Promise<unknown> {
const secretName = encodeURIComponent(secret.name ?? ''); const secretName = encodeURIComponent(secret.name ?? '');
return this._patch(`/api/secrets/${secretName}`, secret); return this._patch(`/api/secrets/${secretName}`, secret);
} }
deleteGlobalSecret(secretName: string): Promise<unknown> { async deleteGlobalSecret(secretName: string): Promise<unknown> {
const name = encodeURIComponent(secretName); const name = encodeURIComponent(secretName);
return this._delete(`/api/secrets/${name}`); return this._delete(`/api/secrets/${name}`);
} }
getSelf(): Promise<unknown> { async getSelf(): Promise<unknown> {
return this._get('/api/user'); return this._get('/api/user');
} }
getToken(): Promise<string> { async getToken(): Promise<string> {
return this._post('/api/user/token') as Promise<string>; return this._post('/api/user/token') as Promise<string>;
} }
getAgents(opts?: PaginationOptions): Promise<Agent[] | null> { async getAgents(opts?: PaginationOptions): Promise<Agent[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/agents?${query}`) as Promise<Agent[] | null>; return this._get(`/api/agents?${query}`) as Promise<Agent[] | null>;
} }
getAgent(agentId: Agent['id']): Promise<Agent> { async getAgent(agentId: Agent['id']): Promise<Agent> {
return this._get(`/api/agents/${agentId}`) as Promise<Agent>; return this._get(`/api/agents/${agentId}`) as Promise<Agent>;
} }
createAgent(agent: Partial<Agent>): Promise<Agent> { async createAgent(agent: Partial<Agent>): Promise<Agent> {
return this._post('/api/agents', agent) as Promise<Agent>; return this._post('/api/agents', agent) as Promise<Agent>;
} }
updateAgent(agent: Partial<Agent>): Promise<unknown> { async updateAgent(agent: Partial<Agent>): Promise<unknown> {
return this._patch(`/api/agents/${agent.id}`, agent); return this._patch(`/api/agents/${agent.id}`, agent);
} }
deleteAgent(agent: Agent): Promise<unknown> { async deleteAgent(agent: Agent): Promise<unknown> {
return this._delete(`/api/agents/${agent.id}`); return this._delete(`/api/agents/${agent.id}`);
} }
getForges(opts?: PaginationOptions): Promise<Forge[] | null> { async getForges(opts?: PaginationOptions): Promise<Forge[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/forges?${query}`) as Promise<Forge[] | null>; return this._get(`/api/forges?${query}`) as Promise<Forge[] | null>;
} }
getForge(forgeId: Forge['id']): Promise<Forge> { async getForge(forgeId: Forge['id']): Promise<Forge> {
return this._get(`/api/forges/${forgeId}`) as Promise<Forge>; return this._get(`/api/forges/${forgeId}`) as Promise<Forge>;
} }
createForge(forge: Partial<Forge>): Promise<Forge> { async createForge(forge: Partial<Forge>): Promise<Forge> {
return this._post('/api/forges', forge) as Promise<Forge>; return this._post('/api/forges', forge) as Promise<Forge>;
} }
updateForge(forge: Partial<Forge>): Promise<unknown> { async updateForge(forge: Partial<Forge>): Promise<unknown> {
return this._patch(`/api/forges/${forge.id}`, forge); return this._patch(`/api/forges/${forge.id}`, forge);
} }
deleteForge(forge: Forge): Promise<unknown> { async deleteForge(forge: Forge): Promise<unknown> {
return this._delete(`/api/forges/${forge.id}`); return this._delete(`/api/forges/${forge.id}`);
} }
getQueueInfo(): Promise<QueueInfo> { async getQueueInfo(): Promise<QueueInfo> {
return this._get('/api/queue/info') as Promise<QueueInfo>; return this._get('/api/queue/info') as Promise<QueueInfo>;
} }
pauseQueue(): Promise<unknown> { async pauseQueue(): Promise<unknown> {
return this._post('/api/queue/pause'); return this._post('/api/queue/pause');
} }
resumeQueue(): Promise<unknown> { async resumeQueue(): Promise<unknown> {
return this._post('/api/queue/resume'); return this._post('/api/queue/resume');
} }
getUsers(opts?: PaginationOptions): Promise<User[] | null> { async getUsers(opts?: PaginationOptions): Promise<User[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/users?${query}`) as Promise<User[] | null>; return this._get(`/api/users?${query}`) as Promise<User[] | null>;
} }
getUser(username: string): Promise<User> { async getUser(username: string): Promise<User> {
return this._get(`/api/users/${username}`) as Promise<User>; return this._get(`/api/users/${username}`) as Promise<User>;
} }
createUser(user: Partial<User>): Promise<User> { async createUser(user: Partial<User>): Promise<User> {
return this._post('/api/users', user) as Promise<User>; return this._post('/api/users', user) as Promise<User>;
} }
updateUser(user: Partial<User>): Promise<unknown> { async updateUser(user: Partial<User>): Promise<unknown> {
return this._patch(`/api/users/${user.login}`, user); return this._patch(`/api/users/${user.login}`, user);
} }
deleteUser(user: User): Promise<unknown> { async deleteUser(user: User): Promise<unknown> {
return this._delete(`/api/users/${user.login}`); return this._delete(`/api/users/${user.login}`);
} }
resetToken(): Promise<string> { async resetToken(): Promise<string> {
return this._delete('/api/user/token') as Promise<string>; return this._delete('/api/user/token') as Promise<string>;
} }
getOrgs(opts?: PaginationOptions): Promise<Org[] | null> { async getOrgs(opts?: PaginationOptions): Promise<Org[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/orgs?${query}`) as Promise<Org[] | null>; return this._get(`/api/orgs?${query}`) as Promise<Org[] | null>;
} }
deleteOrg(org: Org): Promise<unknown> { async deleteOrg(org: Org): Promise<unknown> {
return this._delete(`/api/orgs/${org.id}`); return this._delete(`/api/orgs/${org.id}`);
} }
getAllRepos(opts?: PaginationOptions): Promise<Repo[] | null> { async getAllRepos(opts?: PaginationOptions): Promise<Repo[] | null> {
const query = encodeQueryString(opts); const query = encodeQueryString(opts);
return this._get(`/api/repos?${query}`) as Promise<Repo[] | null>; return this._get(`/api/repos?${query}`) as Promise<Repo[] | null>;
} }
repairAllRepos(): Promise<unknown> { async repairAllRepos(): Promise<unknown> {
return this._post(`/api/repos/repair`); return this._post(`/api/repos/repair`);
} }

View File

@ -107,7 +107,7 @@ const routes: RouteRecordRaw[] = [
}, },
{ {
path: ':repoOwner/:repoName/:pathMatch(.*)*', path: ':repoOwner/:repoName/:pathMatch(.*)*',
component: () => import('~/views/repo/RepoDeprecatedRedirect.vue'), component: async () => import('~/views/repo/RepoDeprecatedRedirect.vue'),
props: true, props: true,
}, },
], ],
@ -161,7 +161,7 @@ const routes: RouteRecordRaw[] = [
}, },
{ {
path: `${rootPath}/cli/auth`, path: `${rootPath}/cli/auth`,
component: () => import('~/views/cli/Auth.vue'), component: async () => import('~/views/cli/Auth.vue'),
meta: { authentication: 'required' }, meta: { authentication: 'required' },
}, },
@ -172,7 +172,7 @@ const routes: RouteRecordRaw[] = [
}, },
{ {
path: `${rootPath}/:repoOwner/:repoName/:pathMatch(.*)*`, path: `${rootPath}/:repoOwner/:repoName/:pathMatch(.*)*`,
component: () => import('~/views/repo/RepoDeprecatedRedirect.vue'), component: async () => import('~/views/repo/RepoDeprecatedRedirect.vue'),
props: true, props: true,
}, },