UNPKG

ravendb

Version:
47 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StartTransactionsRecordingOperation = void 0; const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); const index_js_1 = require("../../../Exceptions/index.js"); class StartTransactionsRecordingOperation { _filePath; constructor(filePath) { if (!filePath) { (0, index_js_1.throwError)("InvalidArgumentException", "FilePath cannot be null"); } this._filePath = filePath; } getCommand(conventions) { return new StartTransactionsRecordingCommand(this._filePath); } get resultType() { return "CommandResult"; } } exports.StartTransactionsRecordingOperation = StartTransactionsRecordingOperation; class StartTransactionsRecordingCommand extends RavenCommand_js_1.RavenCommand { _filePath; constructor(filePath) { super(); this._filePath = filePath; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/admin/transactions/start-recording"; const body = this._serializer.serialize({ File: this._filePath }); return { uri, method: "POST", headers: this._headers().typeAppJson().build(), body }; } get isReadRequest() { return false; } async setResponseAsync(bodyStream, fromCache) { return this._parseResponseDefaultAsync(bodyStream); } } //# sourceMappingURL=StartTransactionsRecordingOperation.js.map