ravendb
Version:
RavenDB client for Node.js
51 lines • 1.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteServerWideTaskOperation = 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 DeleteServerWideTaskOperation {
_name;
_type;
constructor(name, type) {
if (!name) {
(0, index_js_1.throwError)("InvalidArgumentException", "Name cannot be null");
}
this._name = name;
this._type = type;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new DeleteServerWideTaskCommand(this._name, this._type);
}
}
exports.DeleteServerWideTaskOperation = DeleteServerWideTaskOperation;
class DeleteServerWideTaskCommand extends RavenCommand_js_1.RavenCommand {
_name;
_type;
constructor(name, type) {
super();
if (!name) {
(0, index_js_1.throwError)("InvalidArgumentException", "Name cannot be null");
}
this._name = name;
this._type = type;
this._responseType = "Empty";
}
get isReadRequest() {
return false;
}
getRaftUniqueRequestId() {
return RaftIdGenerator_js_1.RaftIdGenerator.newId();
}
createRequest(node) {
const uri = node.url + "/admin/configuration/server-wide/task?type=" + this._type + "&name=" + this._urlEncode(this._name);
return {
uri,
method: "DELETE"
};
}
}
//# sourceMappingURL=DeleteServerWideTaskOperation.js.map