UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint, Klipper, PrusaLink and BambuLab manager to set up, configure and monitor 3D printers. Our aim is to provide neat overview over your farm.

20 lines (19 loc) 713 B
import { ValidationException } from "../../../exceptions/runtime.exceptions.js"; import { apiKeyHeaderKey, contentTypeHeaderKey, jsonContentType } from "../constants/octoprint-service.constants.js"; //#region src/services/octoprint/utils/api.utils.ts function validateLogin(login) { if (!login.apiKey || !login.printerURL) throw new ValidationException("printer apiKey or printerURL undefined"); return { apiKey: login.apiKey, printerURL: login.printerURL }; } function constructHeaders(apiKey, contentType = jsonContentType) { return { [contentTypeHeaderKey]: contentType, [apiKeyHeaderKey]: apiKey }; } //#endregion export { constructHeaders, validateLogin }; //# sourceMappingURL=api.utils.js.map