UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint manager to set up, configure and monitor 3D printers. Our aim is to provide extremely optimized websocket performance and reliability.

31 lines (30 loc) 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "OctoprintHttpClientBuilder", { enumerable: true, get: function() { return OctoprintHttpClientBuilder; } }); const _defaulthttpclientbuilder = require("../../../shared/default-http-client.builder"); const _octoprintserviceconstants = require("../constants/octoprint-service.constants"); class OctoprintHttpClientBuilder extends _defaulthttpclientbuilder.DefaultHttpClientBuilder { build() { if (!this.axiosOptions.baseURL) { throw new Error("Base URL is required"); } return super.build(); } withXApiKeyHeader(apiKey) { if (!apiKey?.length) { throw new Error("XApiKey header may not be an empty string"); } this.withHeaders({ [_octoprintserviceconstants.apiKeyHeaderKey]: apiKey }); return this; } } //# sourceMappingURL=octoprint-http-client.builder.js.map