UNPKG

ravendb

Version:
55 lines 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetServerWideExternalReplicationOperation = void 0; const index_js_1 = require("../../../Exceptions/index.js"); const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class GetServerWideExternalReplicationOperation { _name; constructor(name) { if (!name) { (0, index_js_1.throwError)("InvalidArgumentException", "Name cannot be null"); } this._name = name; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new GetServerWideExternalReplicationCommand(this._name); } } exports.GetServerWideExternalReplicationOperation = GetServerWideExternalReplicationOperation; class GetServerWideExternalReplicationCommand extends RavenCommand_js_1.RavenCommand { _name; constructor(name) { super(); if (!name) { (0, index_js_1.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