ravendb
Version:
RavenDB client for Node.js
49 lines • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteOngoingTaskOperation = void 0;
const RavenCommand_js_1 = require("../../../Http/RavenCommand.js");
const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js");
class DeleteOngoingTaskOperation {
_taskId;
_taskType;
constructor(taskId, taskType) {
this._taskId = taskId;
this._taskType = taskType;
}
get resultType() {
return "CommandResult";
}
getCommand(conventions) {
return new DeleteOngoingTaskCommand(this._taskId, this._taskType);
}
}
exports.DeleteOngoingTaskOperation = DeleteOngoingTaskOperation;
class DeleteOngoingTaskCommand extends RavenCommand_js_1.RavenCommand {
_taskId;
_taskType;
constructor(taskId, taskType) {
super();
this._taskId = taskId;
this._taskType = taskType;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database + "/admin/tasks?id=" + this._taskId + "&type=" + this._taskType;
return {
uri,
method: "DELETE"
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this._throwInvalidResponse();
}
return this._parseResponseDefaultAsync(bodyStream);
}
get isReadRequest() {
return false;
}
getRaftUniqueRequestId() {
return RaftIdGenerator_js_1.RaftIdGenerator.newId();
}
}
//# sourceMappingURL=DeleteOngoingTaskOperation.js.map