UNPKG

@configurator/ravendb

Version:
44 lines 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteAnalyzerOperation = void 0; const Exceptions_1 = require("../../../Exceptions"); const RavenCommand_1 = require("../../../Http/RavenCommand"); const RaftIdGenerator_1 = require("../../../Utility/RaftIdGenerator"); class DeleteAnalyzerOperation { constructor(analyzerName) { if (!analyzerName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "AnalyzerName cannot be null"); } this._analyzerName = analyzerName; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new DeleteAnalyzerCommand(this._analyzerName); } } exports.DeleteAnalyzerOperation = DeleteAnalyzerOperation; class DeleteAnalyzerCommand extends RavenCommand_1.RavenCommand { constructor(analyzerName) { super(); if (!analyzerName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "AnalyzerName cannot be null"); } this._analyzerName = analyzerName; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/analyzers?name=" + encodeURIComponent(this._analyzerName); return { uri, method: "DELETE" }; } getRaftUniqueRequestId() { return RaftIdGenerator_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=DeleteAnalyzerOperation.js.map