This repository has been archived on 2023-11-06. You can view files and clone it, but cannot push or open issues or pull requests.
lfk-client-node/dist/services/ImportService.js

104 lines
3.0 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 (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;