UNPKG

@configurator/ravendb

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