UNPKG

ravendb

Version:
50 lines 1.75 kB
import { RavenCommand } from "../../Http/RavenCommand.js"; import { StringUtil } from "../../Utility/StringUtil.js"; import { throwError } from "../../Exceptions/index.js"; import { RaftIdGenerator } from "../../Utility/RaftIdGenerator.js"; export 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); } } export class RemoveNodeFromOrchestratorTopologyCommand extends RavenCommand { _databaseName; _node; constructor(databaseName, node) { super(); if (StringUtil.isNullOrEmpty(databaseName)) { throwError("InvalidArgumentException", "DatabaseName cannot be null or empty"); } if (StringUtil.isNullOrEmpty(node)) { 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.newId(); } } //# sourceMappingURL=RemoveNodeFromOrchestratorTopologyOperation.js.map