UNPKG

ravendb

Version:
51 lines 1.87 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetRevisionsBinEntryCommand = void 0; const TypeUtil_js_1 = require("../../Utility/TypeUtil.js"); const GetDocumentsCommand_js_1 = require("./GetDocumentsCommand.js"); const RavenCommand_js_1 = require("../../Http/RavenCommand.js"); class GetRevisionsBinEntryCommand extends RavenCommand_js_1.RavenCommand { _conventions; _start; _pageSize; _continuationToken; constructor(conventions, startOrContinuationToken, pageSize) { super(); this._conventions = conventions; if (TypeUtil_js_1.TypeUtil.isString(startOrContinuationToken)) { this._continuationToken = startOrContinuationToken; this._start = 0; this._pageSize = null; return; } this._start = startOrContinuationToken; this._pageSize = pageSize; } createRequest(node) { let uri = node.url + "/databases/" + node.database + "/revisions/bin?start=" + this._start; if (TypeUtil_js_1.TypeUtil.isNullOrUndefined(this._pageSize)) { uri += "&pageSize=" + this._pageSize; } if (this._continuationToken) { uri += "&continuationToken=" + this._continuationToken; } return { uri }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { this.result = null; return; } let body = null; this.result = await GetDocumentsCommand_js_1.GetDocumentsCommand.parseDocumentsResultResponseAsync(bodyStream, this._conventions, b => body = b); return body; } get isReadRequest() { return true; } } exports.GetRevisionsBinEntryCommand = GetRevisionsBinEntryCommand; //# sourceMappingURL=GetRevisionsBinEntryCommand.js.map