UNPKG

ravendb

Version:
46 lines 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteIndexCommand = exports.DeleteIndexOperation = void 0; const index_js_1 = require("../../../Exceptions/index.js"); const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js"); class DeleteIndexOperation { _indexName; constructor(indexName) { if (!indexName) { (0, index_js_1.throwError)("InvalidArgumentException", "Index name cannot be null."); } this._indexName = indexName; } getCommand(conventions) { return new DeleteIndexCommand(this._indexName); } get resultType() { return "CommandResult"; } } exports.DeleteIndexOperation = DeleteIndexOperation; class DeleteIndexCommand extends RavenCommand_js_1.RavenCommand { _indexName; constructor(indexName) { super(); this._responseType = "Empty"; if (!indexName) { (0, index_js_1.throwError)("InvalidArgumentException", "Index name cannot be null."); } this._indexName = indexName; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/indexes?name=" + encodeURIComponent(this._indexName); return { method: "DELETE", uri }; } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator_js_1.RaftIdGenerator.newId(); } } exports.DeleteIndexCommand = DeleteIndexCommand; //# sourceMappingURL=DeleteIndexOperation.js.map