UNPKG

ravendb

Version:
55 lines 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetCertificatesOperation = void 0; const RavenCommand_js_1 = require("../../../Http/RavenCommand.js"); class GetCertificatesOperation { _start; _pageSize; constructor(start, pageSize) { this._start = start; this._pageSize = pageSize; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new GetCertificatesCommand(this._start, this._pageSize, conventions); } } exports.GetCertificatesOperation = GetCertificatesOperation; class GetCertificatesCommand extends RavenCommand_js_1.RavenCommand { _start; _pageSize; _conventions; constructor(start, pageSize, conventions) { super(); this._start = start; this._pageSize = pageSize; this._conventions = conventions; } get isReadRequest() { return false; } createRequest(node) { const uri = node.url + "/admin/certificates?start=" + this._start + "&pageSize=" + this._pageSize; return { uri, method: "GET" }; } async setResponseAsync(bodyStream, fromCache) { if (!bodyStream) { return null; } let body = null; const results = await this._defaultPipeline(_ => body = _).process(bodyStream); this.result = this._conventions.objectMapper.fromObjectLiteral(results, { nestedTypes: { "results[].notAfter": "date", "results[].notBefore": "date" } }).results; return body; } } //# sourceMappingURL=GetCertificatesOperation.js.map