UNPKG

@configurator/ravendb

Version:
40 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetRevisionsCountOperation = void 0; const RavenCommand_1 = require("../../../Http/RavenCommand"); const Exceptions_1 = require("../../../Exceptions"); class GetRevisionsCountOperation { constructor(docId) { this._docId = docId; } createRequest() { return new GetRevisionsCountCommand(this._docId); } } exports.GetRevisionsCountOperation = GetRevisionsCountOperation; class GetRevisionsCountCommand extends RavenCommand_1.RavenCommand { constructor(id) { super(); if (!id) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Id cannot be null"); } this._id = id; } createRequest(node) { const uri = node.url + "/databases/" + node.database + "/revisions/count?&id=" + this._urlEncode(this._id); return { method: "GET", uri }; } async setResponseAsync(bodyStream, fromCache) { let body = null; const result = await this._defaultPipeline(_ => body = _).process(bodyStream); this.result = result.revisionsCount; return body; } get isReadRequest() { return true; } } //# sourceMappingURL=GetRevisionsCountOperation.js.map