UNPKG

@configurator/ravendb

Version:
53 lines 1.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResetEtlOperation = void 0; const RavenCommand_1 = require("../../../Http/RavenCommand"); const RaftIdGenerator_1 = require("../../../Utility/RaftIdGenerator"); const Exceptions_1 = require("../../../Exceptions"); class ResetEtlOperation { constructor(configurationName, transformationName) { if (!configurationName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "ConfigurationName cannot be null"); } if (!transformationName) { (0, Exceptions_1.throwError)("InvalidArgumentException", "TransformationName cannot be null"); } this._configurationName = configurationName; this._transformationName = transformationName; } getCommand(conventions) { return new ResetEtlCommand(this._configurationName, this._transformationName); } get resultType() { return "CommandResult"; } } exports.ResetEtlOperation = ResetEtlOperation; class ResetEtlCommand extends RavenCommand_1.RavenCommand { constructor(configurationName, transformationName) { super(); this._configurationName = configurationName; this._transformationName = transformationName; this._responseType = "Empty"; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/etl?configurationName=" + encodeURIComponent(this._configurationName) + "&transformationName=" + encodeURIComponent(this._transformationName); const body = "{}"; const headers = this._headers().typeAppJson().build(); return { method: "RESET", headers, body, uri }; } getRaftUniqueRequestId() { return RaftIdGenerator_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=ResetEtlOperation.js.map