This commit is contained in:
99
dist/services/ScanService.js
vendored
Normal file
99
dist/services/ScanService.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ScanService = void 0;
|
||||
const request_1 = require("../core/request");
|
||||
class ScanService {
|
||||
/**
|
||||
* Get all
|
||||
* Lists all scans (normal or track) from all runners. <br> This includes the scan's runner's distance ran.
|
||||
* @returns any
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerGetAll() {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/scans`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post
|
||||
* Create a new scan. <br> Please remeber to provide the scan's runner's id and distance for normal scans.
|
||||
* @param requestBody CreateScan
|
||||
* @returns ResponseScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerPost(requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/scans`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get one
|
||||
* Lists all information about the scan whose id got provided. This includes the scan's runner's distance ran.
|
||||
* @param id
|
||||
* @returns any
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerGetOne(id) {
|
||||
const result = await request_1.request({
|
||||
method: 'GET',
|
||||
path: `/api/scans/${id}`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Put
|
||||
* Update the scan whose id you provided. <br> Please remember that ids can't be changed and distances must be positive.
|
||||
* @param id
|
||||
* @param requestBody UpdateScan
|
||||
* @returns ResponseScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerPut(id, requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'PUT',
|
||||
path: `/api/scans/${id}`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Remove
|
||||
* Delete the scan whose id you provided. <br> If no scan with this id exists it will just return 204(no content).
|
||||
* @param id
|
||||
* @param force
|
||||
* @returns ResponseScan
|
||||
* @returns ResponseEmpty
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerRemove(id, force) {
|
||||
const result = await request_1.request({
|
||||
method: 'DELETE',
|
||||
path: `/api/scans/${id}`,
|
||||
query: {
|
||||
'force': force,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post track scans
|
||||
* Create a new track scan. <br> This is just a alias for posting /scans
|
||||
* @param requestBody CreateTrackScan
|
||||
* @returns ResponseScan
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async scanControllerPostTrackScans(requestBody) {
|
||||
const result = await request_1.request({
|
||||
method: 'POST',
|
||||
path: `/api/scans/trackscans`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
}
|
||||
exports.ScanService = ScanService;
|
||||
Reference in New Issue
Block a user