gitbeaker/src/services/ProjectImportExport.ts
2018-10-12 00:22:09 +03:00

35 lines
1.0 KiB
TypeScript

import { BaseService, RequestHelper } from '../infrastructure';
import { RequestOptions } from '../infrastructure/RequestHelper';
class ProjectImportExport extends BaseService {
download(projectId: ProjectId) {
const pId = encodeURIComponent(projectId);
return RequestHelper.get(this, `projects/${pId}/export/download`);
}
exportStatus(projectId: ProjectId) {
const pId = encodeURIComponent(projectId);
return RequestHelper.get(this, `projects/${pId}/export`);
}
import(file: temporaryAny, path: string, options: RequestOptions) {
return RequestHelper.post(this, 'projects/import', { file, path, ...options });
}
importStatus(projectId: ProjectId) {
const pId = encodeURIComponent(projectId);
return RequestHelper.get(this, `projects/${pId}/import`);
}
schedule(projectId: ProjectId, options: RequestOptions) {
const pId = encodeURIComponent(projectId);
return RequestHelper.post(this, `projects/${pId}/export`, options);
}
}
export default ProjectImportExport;