UNPKG

ravendb

Version:
57 lines 2.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResetEtlOperation = 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 ResetEtlOperation { _configurationName; _transformationName; constructor(configurationName, transformationName) { if (!configurationName) { (0, index_js_1.throwError)("InvalidArgumentException", "ConfigurationName cannot be null"); } if (!transformationName) { (0, index_js_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_js_1.RavenCommand { _configurationName; _transformationName; 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_js_1.RaftIdGenerator.newId(); } } //# sourceMappingURL=ResetEtlOperation.js.map