UNPKG

@configurator/ravendb

Version:
40 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StopIndexCommand = exports.StopIndexOperation = void 0; const Exceptions_1 = require("../../../Exceptions"); const RavenCommand_1 = require("../../../Http/RavenCommand"); class StopIndexOperation { constructor(indexName) { if (!indexName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Index name cannot be null"); } this._indexName = indexName; } getCommand(conventions) { return new StopIndexCommand(this._indexName); } get resultType() { return "CommandResult"; } } exports.StopIndexOperation = StopIndexOperation; class StopIndexCommand extends RavenCommand_1.RavenCommand { constructor(indexName) { super(); if (!indexName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Index name cannot be null"); } this._responseType = "Empty"; this._indexName = indexName; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/indexes/stop?name=" + encodeURIComponent(this._indexName); return { method: "POST", uri }; } get isReadRequest() { return false; } } exports.StopIndexCommand = StopIndexCommand; //# sourceMappingURL=StopIndexOperation.js.map