UNPKG

ravendb

Version:
53 lines 1.76 kB
import { RavenCommand } from "../../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js"; import { throwError } from "../../../Exceptions/index.js"; export class UpdatePullReplicationAsSinkOperation { _pullReplication; constructor(pullReplication) { if (!pullReplication) { throwError("InvalidArgumentException", "PullReplication cannot be null"); } this._pullReplication = pullReplication; } getCommand(conventions) { return new UpdatePullEdgeReplication(this._pullReplication); } get resultType() { return "CommandResult"; } } class UpdatePullEdgeReplication extends RavenCommand { _pullReplication; constructor(pullReplication) { super(); if (!pullReplication) { 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.newId(); } } //# sourceMappingURL=UpdatePullReplicationAsSinkOperation.js.map