ravendb
Version:
RavenDB client for Node.js
51 lines • 1.5 kB
JavaScript
import { RavenCommand } from "../../../Http/RavenCommand.js";
export 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);
}
}
class GetCertificatesCommand extends 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