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/RunnerCardService.js
Nicolai Ort 4937a12c11
All checks were successful
continuous-integration/drone Build is passing
🚀New lib version v0.7.0 [CI SKIP]
2021-03-23 17:55:01 +00:00

102 lines
3.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RunnerCardService = void 0;
const request_1 = require("../core/request");
class RunnerCardService {
/**
* Get all
* Lists all card.
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerGetAll() {
const result = await request_1.request({
method: 'GET',
path: `/api/cards`,
});
return result.body;
}
/**
* Post
* Create a new card. <br> You can provide a associated runner by id but you don't have to.
* @param requestBody CreateRunnerCard
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerPost(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/cards`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Lists all information about the card whose id got provided.
* @param id
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/cards/${id}`,
});
return result.body;
}
/**
* Put
* Update the card whose id you provided. <br> Scans created via this card will still be associated with the old runner. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateRunnerCard
* @returns ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerPut(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/cards/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete the card whose id you provided. <br> If no card with this id exists it will just return 204(no content). <br> If the card still has scans associated you have to provide the force=true query param (warning: this deletes all scans associated with by this card - please disable it instead or just remove the runner association).
* @param id
* @param force
* @returns ResponseRunnerCard
* @returns ResponseEmpty
* @throws ApiError
*/
static async runnerCardControllerRemove(id, force) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/cards/${id}`,
query: {
'force': force,
},
});
return result.body;
}
/**
* Post blanco bulk
* Create blank cards in bulk. <br> Just provide the count as a query param and wait for the 200 response.
* @param count
* @returns ResponseEmpty
* @throws ApiError
*/
static async runnerCardControllerPostBlancoBulk(count) {
const result = await request_1.request({
method: 'POST',
path: `/api/cards/bulk`,
query: {
'count': count,
},
});
return result.body;
}
}
exports.RunnerCardService = RunnerCardService;