chromiumly
Version:
A lightweight Typescript library that interacts with Gotenberg's different modules to convert a variety of document formats to PDF files.
29 lines • 2.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.System = void 0;
const common_1 = require("../common");
const main_config_1 = require("../main.config");
class System {
static async getHealth() {
const endpoint = `${main_config_1.Chromiumly.getGotenbergEndpoint()}/${main_config_1.Chromiumly.SYSTEM_ROUTES.health}`;
return common_1.GotenbergUtils.fetchWithoutBody(endpoint, 'GET', main_config_1.Chromiumly.getGotenbergApiBasicAuthUsername(), main_config_1.Chromiumly.getGotenbergApiBasicAuthPassword(), main_config_1.Chromiumly.getCustomHttpHeaders(), main_config_1.Chromiumly.getGotenbergApiKey());
}
static async headHealth() {
const endpoint = `${main_config_1.Chromiumly.getGotenbergEndpoint()}/${main_config_1.Chromiumly.SYSTEM_ROUTES.health}`;
return common_1.GotenbergUtils.fetchWithoutBody(endpoint, 'HEAD', main_config_1.Chromiumly.getGotenbergApiBasicAuthUsername(), main_config_1.Chromiumly.getGotenbergApiBasicAuthPassword(), main_config_1.Chromiumly.getCustomHttpHeaders(), main_config_1.Chromiumly.getGotenbergApiKey());
}
static async getPrometheusMetrics() {
const endpoint = `${main_config_1.Chromiumly.getGotenbergEndpoint()}/${main_config_1.Chromiumly.SYSTEM_ROUTES.prometheusMetrics}`;
return common_1.GotenbergUtils.fetchWithoutBody(endpoint, 'GET', main_config_1.Chromiumly.getGotenbergApiBasicAuthUsername(), main_config_1.Chromiumly.getGotenbergApiBasicAuthPassword(), main_config_1.Chromiumly.getCustomHttpHeaders(), main_config_1.Chromiumly.getGotenbergApiKey());
}
static async getVersion() {
const endpoint = `${main_config_1.Chromiumly.getGotenbergEndpoint()}/${main_config_1.Chromiumly.SYSTEM_ROUTES.version}`;
return common_1.GotenbergUtils.fetchWithoutBody(endpoint, 'GET', main_config_1.Chromiumly.getGotenbergApiBasicAuthUsername(), main_config_1.Chromiumly.getGotenbergApiBasicAuthPassword(), main_config_1.Chromiumly.getCustomHttpHeaders(), main_config_1.Chromiumly.getGotenbergApiKey());
}
static async getDebug() {
const endpoint = `${main_config_1.Chromiumly.getGotenbergEndpoint()}/${main_config_1.Chromiumly.SYSTEM_ROUTES.debug}`;
return common_1.GotenbergUtils.fetchWithoutBody(endpoint, 'GET', main_config_1.Chromiumly.getGotenbergApiBasicAuthUsername(), main_config_1.Chromiumly.getGotenbergApiBasicAuthPassword(), main_config_1.Chromiumly.getCustomHttpHeaders(), main_config_1.Chromiumly.getGotenbergApiKey());
}
}
exports.System = System;
//# sourceMappingURL=system.js.map