UNPKG

ravendb

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