lfk-client-js/dist/services/ImportService.js
Nicolai Ort 9b6d686d93
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v0.13.1 [CI SKIP]
2023-02-02 15:19:00 +00:00

104 lines
3.7 KiB
JavaScript

"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
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostJson(group, requestBody) {
const result = await (0, 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
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostOrgsJson(id, requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/organizations/${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
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostTeamsJson(id, requestBody) {
const result = await (0, 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
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostCsv(group) {
const result = await (0, 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
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostOrgsCsv(id) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/organizations/${id}/import/csv`,
});
return result.body;
}
/**
* Post teams csv
* Create new runners from csv and insert them into the provided team
* @param id
* @result ResponseRunner
* @throws ApiError
*/
static async importControllerPostTeamsCsv(id) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/teams/${id}/import/csv`,
});
return result.body;
}
}
exports.ImportService = ImportService;