ravendb
Version:
RavenDB client for Node.js
47 lines • 1.6 kB
JavaScript
import { TypeUtil } from "../../Utility/TypeUtil.js";
import { GetDocumentsCommand } from "./GetDocumentsCommand.js";
import { RavenCommand } from "../../Http/RavenCommand.js";
export class GetRevisionsBinEntryCommand extends RavenCommand {
_conventions;
_start;
_pageSize;
_continuationToken;
constructor(conventions, startOrContinuationToken, pageSize) {
super();
this._conventions = conventions;
if (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.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.parseDocumentsResultResponseAsync(bodyStream, this._conventions, b => body = b);
return body;
}
get isReadRequest() {
return true;
}
}
//# sourceMappingURL=GetRevisionsBinEntryCommand.js.map