UNPKG

@configurator/ravendb

Version:
55 lines 1.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdatePullReplicationAsSinkOperation = void 0; const RavenCommand_1 = require("../../../Http/RavenCommand"); const RaftIdGenerator_1 = require("../../../Utility/RaftIdGenerator"); const Exceptions_1 = require("../../../Exceptions"); class UpdatePullReplicationAsSinkOperation { constructor(pullReplication) { if (!pullReplication) { (0, Exceptions_1.throwError)("InvalidArgumentException", "PullReplication cannot be null"); } this._pullReplication = pullReplication; } getCommand(conventions) { return new UpdatePullEdgeReplication(this._pullReplication); } get resultType() { return "CommandResult"; } } exports.UpdatePullReplicationAsSinkOperation = UpdatePullReplicationAsSinkOperation; class UpdatePullEdgeReplication extends RavenCommand_1.RavenCommand { constructor(pullReplication) { super(); if (!pullReplication) { (0, Exceptions_1.throwError)("InvalidArgumentException", "PullReplication cannot be null"); } this._pullReplication = pullReplication; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/tasks/sink-pull-replication"; const body = this._serializer.serialize({ PullReplicationAsSink: this._pullReplication }); return { method: "POST", uri, headers: this._headers().typeAppJson().build(), body }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=UpdatePullReplicationAsSinkOperation.js.map