UNPKG

ravendb

Version:
47 lines 1.41 kB
import { RavenCommand } from "../../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js"; export class AddEtlOperation { _configuration; constructor(configuration) { this._configuration = configuration; } getCommand(conventions) { return new AddEtlCommand(conventions, this._configuration); } get resultType() { return "CommandResult"; } } class AddEtlCommand extends RavenCommand { _conventions; _configuration; constructor(conventions, configuration) { super(); this._conventions = conventions; this._configuration = configuration; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/etl"; const body = JSON.stringify(this._configuration.serialize(this._conventions)); const headers = this._headers().typeAppJson().build(); return { uri, method: "PUT", body, headers }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this._throwInvalidResponse(); } return this._parseResponseDefaultAsync(bodyStream); } getRaftUniqueRequestId() { return RaftIdGenerator.newId(); } } //# sourceMappingURL=AddEtlOperation.js.map