mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
Consistent and more descriptive naming of parameters in index.ts (#1455)
Parameter naming has been made more descriptive and consistent: - Change `number: number` to `pipelineNumber: number`. - Rename `pipeline` to `pipelineNumber` when it refered to a pipeline number.
This commit is contained in:
parent
1cd73f0b76
commit
b0fd99ec01
1 changed files with 12 additions and 12 deletions
|
@ -71,14 +71,14 @@ export default class WoodpeckerClient extends ApiClient {
|
|||
|
||||
// Deploy triggers a deployment for an existing pipeline using the
|
||||
// specified target environment.
|
||||
deployPipeline(owner: string, repo: string, number: number, options: DeploymentOptions): Promise<Pipeline> {
|
||||
deployPipeline(owner: string, repo: string, pipelineNumber: number, options: DeploymentOptions): Promise<Pipeline> {
|
||||
const vars = {
|
||||
...options.variables,
|
||||
event: 'deployment',
|
||||
deploy_to: options.environment,
|
||||
};
|
||||
const query = encodeQueryString(vars);
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${number}?${query}`) as Promise<Pipeline>;
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}?${query}`) as Promise<Pipeline>;
|
||||
}
|
||||
|
||||
getPipelineList(owner: string, repo: string, opts?: Record<string, string | number | boolean>): Promise<Pipeline[]> {
|
||||
|
@ -86,12 +86,12 @@ export default class WoodpeckerClient extends ApiClient {
|
|||
return this._get(`/api/repos/${owner}/${repo}/pipelines?${query}`) as Promise<Pipeline[]>;
|
||||
}
|
||||
|
||||
getPipeline(owner: string, repo: string, number: number | 'latest'): Promise<Pipeline> {
|
||||
return this._get(`/api/repos/${owner}/${repo}/pipelines/${number}`) as Promise<Pipeline>;
|
||||
getPipeline(owner: string, repo: string, pipelineNumber: number | 'latest'): Promise<Pipeline> {
|
||||
return this._get(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}`) as Promise<Pipeline>;
|
||||
}
|
||||
|
||||
getPipelineConfig(owner: string, repo: string, number: number): Promise<PipelineConfig[]> {
|
||||
return this._get(`/api/repos/${owner}/${repo}/pipelines/${number}/config`) as Promise<PipelineConfig[]>;
|
||||
getPipelineConfig(owner: string, repo: string, pipelineNumber: number): Promise<PipelineConfig[]> {
|
||||
return this._get(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}/config`) as Promise<PipelineConfig[]>;
|
||||
}
|
||||
|
||||
getPipelineFeed(opts?: Record<string, string | number | boolean>): Promise<PipelineFeed[]> {
|
||||
|
@ -99,16 +99,16 @@ export default class WoodpeckerClient extends ApiClient {
|
|||
return this._get(`/api/user/feed?${query}`) as Promise<PipelineFeed[]>;
|
||||
}
|
||||
|
||||
cancelPipeline(owner: string, repo: string, number: number): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${number}/cancel`);
|
||||
cancelPipeline(owner: string, repo: string, pipelineNumber: number): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}/cancel`);
|
||||
}
|
||||
|
||||
approvePipeline(owner: string, repo: string, pipeline: string): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}/approve`);
|
||||
approvePipeline(owner: string, repo: string, pipelineNumber: string): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}/approve`);
|
||||
}
|
||||
|
||||
declinePipeline(owner: string, repo: string, pipeline: string): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipeline}/decline`);
|
||||
declinePipeline(owner: string, repo: string, pipelineNumber: string): Promise<unknown> {
|
||||
return this._post(`/api/repos/${owner}/${repo}/pipelines/${pipelineNumber}/decline`);
|
||||
}
|
||||
|
||||
restartPipeline(
|
||||
|
|
Loading…
Reference in a new issue