UNPKG

@configurator/ravendb

Version:
56 lines 1.86 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetServerWideBackupConfigurationOperation = void 0; const Exceptions_1 = require("../../../Exceptions"); const RavenCommand_1 = require("../../../Http/RavenCommand"); class GetServerWideBackupConfigurationOperation { constructor(name) { if (!name) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Name cannot be null"); } this._name = name; } getCommand(conventions) { return new GetServerWideBackupConfigurationCommand(this._name); } get resultType() { return "CommandResult"; } } exports.GetServerWideBackupConfigurationOperation = GetServerWideBackupConfigurationOperation; class GetServerWideBackupConfigurationCommand extends RavenCommand_1.RavenCommand { constructor(name) { super(); if (!name) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Name cannot be null"); } this._name = name; } get isReadRequest() { return true; } createRequest(node) { const uri = node.url + "/admin/configuration/server-wide/tasks?type=Backup&name=" + encodeURIComponent(this._name); return { method: "GET", uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { return; } let body = null; const result = await this._defaultPipeline(_ => body = _).process(bodyStream); const results = result.results; if (results.length === 0) { return body; } if (results.length > 1) { this._throwInvalidResponse(); } this.result = results[0]; return body; } } //# sourceMappingURL=GetServerWideBackupConfigurationOperation.js.map