| ... | @@ -24,6 +24,7 @@ const Api = { |
... | @@ -24,6 +24,7 @@ const Api = { |
|
|
projectMergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes',
|
|
projectMergeRequestChangesPath: '/api/:version/projects/:id/merge_requests/:mrid/changes',
|
|
|
projectMergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions',
|
|
projectMergeRequestVersionsPath: '/api/:version/projects/:id/merge_requests/:mrid/versions',
|
|
|
projectRunnersPath: '/api/:version/projects/:id/runners',
|
|
projectRunnersPath: '/api/:version/projects/:id/runners',
|
|
|
|
projectProtectedBranchesPath: '/api/:version/projects/:id/protected_branches',
|
|
|
mergeRequestsPath: '/api/:version/merge_requests',
|
|
mergeRequestsPath: '/api/:version/merge_requests',
|
|
|
groupLabelsPath: '/groups/:namespace_path/-/labels',
|
|
groupLabelsPath: '/groups/:namespace_path/-/labels',
|
|
|
issuableTemplatePath: '/:namespace_path/:project_path/templates/:type/:key',
|
|
issuableTemplatePath: '/:namespace_path/:project_path/templates/:type/:key',
|
| ... | @@ -44,6 +45,8 @@ const Api = { |
... | @@ -44,6 +45,8 @@ const Api = { |
|
|
releasePath: '/api/:version/projects/:id/releases/:tag_name',
|
|
releasePath: '/api/:version/projects/:id/releases/:tag_name',
|
|
|
mergeRequestsPipeline: '/api/:version/projects/:id/merge_requests/:merge_request_iid/pipelines',
|
|
mergeRequestsPipeline: '/api/:version/projects/:id/merge_requests/:merge_request_iid/pipelines',
|
|
|
adminStatisticsPath: '/api/:version/application/statistics',
|
|
adminStatisticsPath: '/api/:version/application/statistics',
|
|
|
|
pipelineSinglePath: '/api/:version/projects/:id/pipelines/:pipeline_id',
|
|
|
|
lsifPath: '/api/:version/projects/:id/commits/:commit_id/lsif/info',
|
|
|
|
|
|
|
|
group(groupId, callback) {
|
|
group(groupId, callback) {
|
|
|
const url = Api.buildUrl(Api.groupPath).replace(':id', groupId);
|
|
const url = Api.buildUrl(Api.groupPath).replace(':id', groupId);
|
| ... | @@ -218,6 +221,22 @@ const Api = { |
... | @@ -218,6 +221,22 @@ const Api = { |
|
|
return axios.get(url, config);
|
|
return axios.get(url, config);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
projectProtectedBranches(id, query = '') {
|
|
|
|
const url = Api.buildUrl(Api.projectProtectedBranchesPath).replace(
|
|
|
|
':id',
|
|
|
|
encodeURIComponent(id),
|
|
|
|
);
|
|
|
|
|
|
|
|
return axios
|
|
|
|
.get(url, {
|
|
|
|
params: {
|
|
|
|
search: query,
|
|
|
|
per_page: DEFAULT_PER_PAGE,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.then(({ data }) => data);
|
|
|
|
},
|
|
|
|
|
|
|
mergeRequests(params = {}) {
|
|
mergeRequests(params = {}) {
|
|
|
const url = Api.buildUrl(Api.mergeRequestsPath);
|
|
const url = Api.buildUrl(Api.mergeRequestsPath);
|
|
|
|
|
|
| ... | @@ -448,6 +467,22 @@ const Api = { |
... | @@ -448,6 +467,22 @@ const Api = { |
|
|
return axios.get(url);
|
|
return axios.get(url);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
pipelineSingle(id, pipelineId) {
|
|
|
|
const url = Api.buildUrl(this.pipelineSinglePath)
|
|
|
|
.replace(':id', encodeURIComponent(id))
|
|
|
|
.replace(':pipeline_id', encodeURIComponent(pipelineId));
|
|
|
|
|
|
|
|
return axios.get(url);
|
|
|
|
},
|
|
|
|
|
|
|
|
lsifData(projectPath, commitId, path) {
|
|
|
|
const url = Api.buildUrl(this.lsifPath)
|
|
|
|
.replace(':id', encodeURIComponent(projectPath))
|
|
|
|
.replace(':commit_id', commitId);
|
|
|
|
|
|
|
|
return axios.get(url, { params: { path } });
|
|
|
|
},
|
|
|
|
|
|
|
buildUrl(url) {
|
|
buildUrl(url) {
|
|
|
return joinPaths(gon.relative_url_root || '', url.replace(':version', gon.api_version));
|
|
return joinPaths(gon.relative_url_root || '', url.replace(':version', gon.api_version));
|
|
|
},
|
|
},
|
| ... | |
... | |
| ... | | ... | |