ravendb
Version:
RavenDB client for Node.js
46 lines • 1.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteSorterOperation = 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 DeleteSorterOperation {
_sorterName;
constructor(sorterName) {
if (!sorterName) {
(0, index_js_1.throwError)("InvalidArgumentException", "SorterName cannot be null");
}
this._sorterName = sorterName;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new DeleteSorterCommand(this._sorterName);
}
}
exports.DeleteSorterOperation = DeleteSorterOperation;
class DeleteSorterCommand extends RavenCommand_js_1.RavenCommand {
_sorterName;
constructor(sorterName) {
super();
if (!sorterName) {
(0, index_js_1.throwError)("InvalidArgumentException", "IndexName cannot be null");
}
this._sorterName = sorterName;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database + "/admin/sorters?name=" + encodeURIComponent(this._sorterName);
return {
uri,
method: "DELETE"
};
}
get isReadRequest() {
return false;
}
getRaftUniqueRequestId() {
return RaftIdGenerator_js_1.RaftIdGenerator.newId();
}
}
//# sourceMappingURL=DeleteSorterOperation.js.map