@configurator/ravendb
Version:
RavenDB client for Node.js
44 lines • 1.47 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteSorterOperation = void 0;
const index_1 = require("../../../Exceptions/index");
const RavenCommand_1 = require("../../../Http/RavenCommand");
const RaftIdGenerator_1 = require("../../../Utility/RaftIdGenerator");
class DeleteSorterOperation {
constructor(sorterName) {
if (!sorterName) {
(0, index_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_1.RavenCommand {
constructor(sorterName) {
super();
if (!sorterName) {
(0, index_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_1.RaftIdGenerator.newId();
}
}
//# sourceMappingURL=DeleteSorterOperation.js.map