UNPKG

@kurrent/kurrentdb-client

Version:
25 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const projections_grpc_pb_1 = require("../../generated/projections_grpc_pb"); const projections_pb_1 = require("../../generated/projections_pb"); const Client_1 = require("../Client"); const utils_1 = require("../utils"); Client_1.Client.prototype.enableProjection = async function (projectionName, baseOptions = {}) { const req = new projections_pb_1.EnableReq(); const options = new projections_pb_1.EnableReq.Options(); options.setName(projectionName); req.setOptions(options); utils_1.debug.command("enableProjection: %O", { projectionName, options: baseOptions, }); utils_1.debug.command_grpc("enableProjection: %g", req); return this.execute(projections_grpc_pb_1.ProjectionsClient, "enableProjection", (client) => new Promise((resolve, reject) => { client.enable(req, ...this.callArguments(baseOptions), (error) => { if (error) return reject((0, utils_1.convertToCommandError)(error)); return resolve(); }); })); }; //# sourceMappingURL=enableProjection.js.map