UNPKG

ravendb

Version:
55 lines 2.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RemoveNodeFromOrchestratorTopologyCommand = exports.RemoveNodeFromOrchestratorTopologyOperation = void 0; const RavenCommand_js_1 = require("../../Http/RavenCommand.js"); const StringUtil_js_1 = require("../../Utility/StringUtil.js"); const index_js_1 = require("../../Exceptions/index.js"); const RaftIdGenerator_js_1 = require("../../Utility/RaftIdGenerator.js"); class RemoveNodeFromOrchestratorTopologyOperation { _databaseName; _node; constructor(databaseName, node) { this._databaseName = databaseName; this._node = node; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new RemoveNodeFromOrchestratorTopologyCommand(this._databaseName, this._node); } } exports.RemoveNodeFromOrchestratorTopologyOperation = RemoveNodeFromOrchestratorTopologyOperation; class RemoveNodeFromOrchestratorTopologyCommand extends RavenCommand_js_1.RavenCommand { _databaseName; _node; constructor(databaseName, node) { super(); if (StringUtil_js_1.StringUtil.isNullOrEmpty(databaseName)) { (0, index_js_1.throwError)("InvalidArgumentException", "DatabaseName cannot be null or empty"); } if (StringUtil_js_1.StringUtil.isNullOrEmpty(node)) { (0, index_js_1.throwError)("InvalidArgumentException", "Node cannot be null or empty"); } this._databaseName = databaseName; this._node = node; } createRequest(node) { const uri = node.url + "/admin/databases/orchestrator?name=" + this._urlEncode(this._databaseName) + "&node=" + this._urlEncode(this._node); return { uri, method: "DELETE" }; } async setResponseAsync(bodyStream, fromCache) { return this._parseResponseDefaultAsync(bodyStream); } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator_js_1.RaftIdGenerator.newId(); } } exports.RemoveNodeFromOrchestratorTopologyCommand = RemoveNodeFromOrchestratorTopologyCommand; //# sourceMappingURL=RemoveNodeFromOrchestratorTopologyOperation.js.map