UNPKG

@tulioncds/nestjs-nats-streaming-transport

Version:

Fork Nats Streaming Transport for NestJS - Auto Reconnect stan

53 lines 2.29 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var NatsStreamingTransport_1; Object.defineProperty(exports, "__esModule", { value: true }); exports.NatsStreamingTransport = void 0; const common_1 = require("@nestjs/common"); const constants_1 = require("./constants"); const publisher_1 = require("./publisher"); let NatsStreamingTransport = NatsStreamingTransport_1 = class NatsStreamingTransport { static forRoot(clusterId, clientId, connectOptions) { console.log('WARNING: forRoot is depreciated! Use register or registerAsync instead! This will be removed in next version'); return this.register({ clusterId, clientId, connectOptions }); } static register(options) { const providers = [ { provide: constants_1.NATS_STREAMING_OPTIONS, useValue: options, }, publisher_1.Publisher, ]; return { providers, exports: providers, module: NatsStreamingTransport_1, }; } static registerAsync(options) { return { module: NatsStreamingTransport_1, imports: options.imports, providers: [ { provide: constants_1.NATS_STREAMING_OPTIONS, useFactory: options.useFactory, inject: options.inject || [], }, publisher_1.Publisher, ], exports: [publisher_1.Publisher] }; } }; NatsStreamingTransport = NatsStreamingTransport_1 = __decorate([ (0, common_1.Module)({}) ], NatsStreamingTransport); exports.NatsStreamingTransport = NatsStreamingTransport; //# sourceMappingURL=nats-streaming-transport.module.js.map