UNPKG

@kurrent/kurrentdb-client

Version:
31 lines 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const shared_pb_1 = require("../../generated/shared_pb"); const persistent_pb_1 = require("../../generated/persistent_pb"); const persistent_grpc_pb_1 = require("../../generated/persistent_grpc_pb"); const utils_1 = require("../utils"); const Client_1 = require("../Client"); const mapPersistentSubscriptionInfo_1 = require("./utils/mapPersistentSubscriptionInfo"); Client_1.Client.prototype.getPersistentSubscriptionToAllInfo = async function (groupName, baseOptions = {}) { if (!(await this.supports(persistent_grpc_pb_1.PersistentSubscriptionsService.getInfo, "all"))) { throw new utils_1.UnsupportedError("getPersistentSubscriptionToAllInfo", "21.10.1"); } const req = new persistent_pb_1.GetInfoReq(); const options = new persistent_pb_1.GetInfoReq.Options(); options.setAll(new shared_pb_1.Empty()); options.setGroupName(groupName); req.setOptions(options); utils_1.debug.command("getPersistentSubscriptionToAllInfo: %O", { groupName, options, }); utils_1.debug.command_grpc("getPersistentSubscriptionToAllInfo: %g", req); return this.execute(persistent_grpc_pb_1.PersistentSubscriptionsClient, "getPersistentSubscriptionToAllInfo", (client) => new Promise((resolve, reject) => { client.getInfo(req, ...this.callArguments(baseOptions), (error, response) => { if (error) return reject((0, utils_1.convertToCommandError)(error)); return resolve((0, mapPersistentSubscriptionInfo_1.mapPersistentSubscriptionToAllInfo)(response.getSubscriptionInfo())); }); })); }; //# sourceMappingURL=getPersistentSubscriptionToAllInfo.js.map