UNPKG

ravendb

Version:
51 lines 1.54 kB
import { throwError } from "../../../Exceptions/index.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; export class GetServerWideExternalReplicationOperation { _name; constructor(name) { if (!name) { throwError("InvalidArgumentException", "Name cannot be null"); } this._name = name; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new GetServerWideExternalReplicationCommand(this._name); } } class GetServerWideExternalReplicationCommand extends RavenCommand { _name; constructor(name) { super(); if (!name) { throwError("InvalidArgumentException", "Name cannot be null"); } this._name = name; } get isReadRequest() { return true; } createRequest(node) { const uri = node.url + "/admin/configuration/server-wide/tasks?type=" + "Replication" + "&name=" + this._urlEncode(this._name); return { uri, method: "GET" }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { return; } let body = null; const results = await this._defaultPipeline(_ => body = _) .process(bodyStream); if (results.results.length > 1) { this._throwInvalidResponse(); } this.result = results.results[0]; return body; } } //# sourceMappingURL=GetServerWideExternalReplicationOperation.js.map