UNPKG

ravendb

Version:
42 lines 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StopIndexCommand = exports.StopIndexOperation = void 0; const index_js_1 = require("../../../Exceptions/index.js"); const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class StopIndexOperation { _indexName; constructor(indexName) { if (!indexName) { (0, index_js_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_js_1.RavenCommand { _indexName; constructor(indexName) { super(); if (!indexName) { (0, index_js_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