ravendb
Version:
RavenDB client for Node.js
57 lines • 2.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdatePullReplicationAsSinkOperation = void 0;
const RavenCommand_js_1 = require("../../../Http/RavenCommand.js");
const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js");
const index_js_1 = require("../../../Exceptions/index.js");
class UpdatePullReplicationAsSinkOperation {
_pullReplication;
constructor(pullReplication) {
if (!pullReplication) {
(0, index_js_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_js_1.RavenCommand {
_pullReplication;
constructor(pullReplication) {
super();
if (!pullReplication) {
(0, index_js_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_js_1.RaftIdGenerator.newId();
}
}
//# sourceMappingURL=UpdatePullReplicationAsSinkOperation.js.map