UNPKG

ravendb

Version:
55 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateEtlOperation = void 0; const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); const RaftIdGenerator_js_1 = require("../../../Utility/RaftIdGenerator.js"); class UpdateEtlOperation { _taskId; _configuration; constructor(taskId, configuration) { this._taskId = taskId; this._configuration = configuration; } getCommand(conventions) { return new UpdateEtlCommand(conventions, this._taskId, this._configuration); } get resultType() { return "CommandResult"; } } exports.UpdateEtlOperation = UpdateEtlOperation; class UpdateEtlCommand extends RavenCommand_js_1.RavenCommand { _conventions; _taskId; _configuration; constructor(conventions, taskId, configuration) { super(); this._conventions = conventions; this._taskId = taskId; this._configuration = configuration; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/etl?id=" + this._taskId; const body = this._serializer.serialize(this._configuration.serialize(this._conventions)); const headers = this._headers().typeAppJson().build(); return { uri, method: "PUT", headers, body }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } getRaftUniqueRequestId() { return RaftIdGenerator_js_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=UpdateEtlOperation.js.map