UNPKG

ravendb

Version:
42 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryStreamCommand = void 0; const RavenCommand_js_1 = require("../../Http/RavenCommand.js"); const IndexQuery_js_1 = require("../Queries/IndexQuery.js"); const index_js_1 = require("../../Exceptions/index.js"); class QueryStreamCommand extends RavenCommand_js_1.RavenCommand { _conventions; _indexQuery; constructor(conventions, query) { super(); if (!conventions) { (0, index_js_1.throwError)("InvalidArgumentException", "Conventions cannot be null."); } if (!query) { (0, index_js_1.throwError)("InvalidArgumentException", "Query cannot be null."); } this._conventions = conventions; this._indexQuery = query; this._responseType = "Empty"; } createRequest(node) { return { method: "POST", uri: `${node.url}/databases/${node.database}/streams/queries?format=jsonl`, body: (0, IndexQuery_js_1.writeIndexQuery)(this._conventions, this._indexQuery), headers: this._headers().typeAppJson().build() }; } async processResponse(cache, response, bodyStream, url) { this.result = { response, stream: bodyStream }; return "Manually"; } get isReadRequest() { return true; } } exports.QueryStreamCommand = QueryStreamCommand; //# sourceMappingURL=QueryStreamCommand.js.map