new lib version [CI SKIP]
This commit is contained in:
103
dist/services/ImportService.js
vendored
Normal file
103
dist/services/ImportService.js
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ImportService = void 0;
|
||||
const request_1 = require("../core/request");
|
||||
class ImportService {
|
||||
/**
|
||||
* Post json
|
||||
* Create new runners from json and insert them (or their teams) into the provided group
|
||||
* @param group
|
||||
* @param requestBody ImportRunner
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostJson(group, requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/runners/import`,
|
||||
query: {
|
||||
'group': group,
|
||||
},
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post orgs json
|
||||
* Create new runners from json and insert them (or their teams) into the provided org
|
||||
* @param id
|
||||
* @param requestBody ImportRunner
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostOrgsJson(id, requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/organisations/${id}/import`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post teams json
|
||||
* Create new runners from json and insert them into the provided team
|
||||
* @param id
|
||||
* @param requestBody ImportRunner
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostTeamsJson(id, requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/teams/${id}/import`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post csv
|
||||
* Create new runners from csv and insert them (or their teams) into the provided group
|
||||
* @param group
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostCsv(group) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/runners/import/csv`,
|
||||
query: {
|
||||
'group': group,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post orgs csv
|
||||
* Create new runners from csv and insert them (or their teams) into the provided org
|
||||
* @param id
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostOrgsCsv(id) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/organisations/${id}/import/csv`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post teams csv
|
||||
* Create new runners from csv and insert them into the provided team
|
||||
* @param id
|
||||
* @returns ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async importControllerPostTeamsCsv(id) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/teams/${id}/import/csv`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
}
|
||||
exports.ImportService = ImportService;
|
||||
Reference in New Issue
Block a user