UNPKG

ravendb

Version:
47 lines 1.38 kB
import { throwError } from "../../../Exceptions/index.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js"; export class DeleteServerWideTaskOperation { _name; _type; constructor(name, type) { if (!name) { 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); } } class DeleteServerWideTaskCommand extends RavenCommand { _name; _type; constructor(name, type) { super(); if (!name) { throwError("InvalidArgumentException", "Name cannot be null"); } this._name = name; this._type = type; this._responseType = "Empty"; } get isReadRequest() { return false; } getRaftUniqueRequestId() { return 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