new lib version [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2021-01-03 18:16:14 +00:00
parent 46e9ee2a1b
commit f6c6013368
211 changed files with 2857 additions and 4 deletions

103
dist/services/ImportService.js vendored Normal file
View 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 into the provided group. <br> If teams/classes are provided alongside the runner's name they'll automaticly be created under the provided org and the runners will be inserted into the teams instead.
* @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 into the provided org. <br> If teams/classes are provided alongside the runner's name they'll automaticly be created under the provided org and the runners will be inserted into the teams instead.
* @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 into the provided group. <br> If teams/classes are provided alongside the runner's name they'll automaticly be created under the provided org and the runners will be inserted into the teams instead.
* @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 into the provided org. <br> If teams/classes are provided alongside the runner's name they'll automaticly be created under the provided org and the runners will be inserted into the teams instead.
* @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;