@configurator/ravendb
Version:
RavenDB client for Node.js
39 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetSubscriptionsCommand = void 0;
const RavenCommand_1 = require("../../Http/RavenCommand");
class GetSubscriptionsCommand extends RavenCommand_1.RavenCommand {
constructor(start, pageSize) {
super();
this._start = start;
this._pageSize = pageSize;
}
createRequest(node) {
const uri = node.url + "/databases/" + node.database
+ "/subscriptions?start=" + this._start + "&pageSize=" + this._pageSize;
return {
uri
};
}
async setResponseAsync(bodyStream, fromCache) {
if (!bodyStream) {
this.result = null;
return;
}
let body = null;
const data = await this._defaultPipeline(_ => body = _)
.process(bodyStream);
const results = data["results"];
if (!results) {
this._throwInvalidResponse();
return;
}
this.result = results;
return body;
}
get isReadRequest() {
return true;
}
}
exports.GetSubscriptionsCommand = GetSubscriptionsCommand;
//# sourceMappingURL=GetSubscriptionsCommand.js.map