ravendb
Version:
RavenDB client for Node.js
42 lines • 1.32 kB
JavaScript
import { throwError } from "../../../Exceptions/index.js";
import { RavenCommand } from "../../../Http/RavenCommand.js";
import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js";
export class DeleteAnalyzerOperation {
_analyzerName;
constructor(analyzerName) {
if (!analyzerName) {
throwError("InvalidArgumentException", "AnalyzerName cannot be null");
}
this._analyzerName = analyzerName;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new DeleteAnalyzerCommand(this._analyzerName);
}
}
class DeleteAnalyzerCommand extends RavenCommand {
_analyzerName;
constructor(analyzerName) {
super();
if (!analyzerName) {
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.newId();
}
}
//# sourceMappingURL=DeleteAnalyzerOperation.js.map