Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngx-grpc/core

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngx-grpc/core - npm Package Compare versions

Comparing version 1.0.4 to 2.0.0

esm2015/lib/grpc-core.module.js

244

bundles/ngx-grpc-core.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngx-grpc/common'), require('rxjs/operators'), require('rxjs')) :
typeof define === 'function' && define.amd ? define('@ngx-grpc/core', ['exports', '@angular/core', '@ngx-grpc/common', 'rxjs/operators', 'rxjs'], factory) :
(global = global || self, factory((global['ngx-grpc'] = global['ngx-grpc'] || {}, global['ngx-grpc'].core = {}), global.ng.core, global.common, global.rxjs.operators, global.rxjs));
}(this, (function (exports, i0, common, operators, rxjs) { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['ngx-grpc'] = global['ngx-grpc'] || {}, global['ngx-grpc'].core = {}), global.ng.core, global.common, global.rxjs.operators, global.rxjs));
}(this, (function (exports, core, common, operators, rxjs) { 'use strict';
/**
* A configuration for GrpcConsoleLoggerInterceptor to turn it on or off
*
* Example:
*
* ```
* providers: [
* { provide: GRPC_CONSOLE_LOGGER_ENABLED, useValue: true },
* ]
* ```
*
* or more complex:
*
* ```
* providers: [
* { provide: GRPC_CONSOLE_LOGGER_ENABLED, useFactory: () => localStorage.getItem('GRPC_CONSOLE_LOGGER_ENABLED') === 'true' || !environment.prod },
* ]
* ```
*/
var GRPC_CONSOLE_LOGGER_ENABLED = new i0.InjectionToken('GRPC_CONSOLE_LOGGER_ENABLED');
/**
* Interceptor that implements logging of every request to the browser console
*
* Can be enabled / disabled by GRPC_CONSOLE_LOGGER_ENABLED injection token
*/
var GrpcConsoleLoggerInterceptor = /** @class */ (function () {
function GrpcConsoleLoggerInterceptor(enabled) {
this.enabled = enabled;
this.dataStyle = 'color: #5c7ced;';
this.errorStyle = 'color: red;';
}
GrpcConsoleLoggerInterceptor.prototype.intercept = function (request, next) {
var _this = this;
if (this.enabled) {
var start_1 = Date.now();
return next.handle(request).pipe(operators.tap(function (event) {
if (event instanceof common.GrpcDataEvent) {
console.groupCollapsed("%c" + (Date.now() - start_1) + "ms -> " + request.path, _this.dataStyle);
console.log('%c>>', _this.dataStyle, request.requestData.toObject());
console.log('%c**', _this.dataStyle, request.requestMetadata);
console.log('%c<<', _this.dataStyle, event.data.toObject());
console.groupEnd();
}
else if (event.code !== 0) {
console.groupCollapsed("%c" + (Date.now() - start_1) + "ms -> " + request.path, _this.errorStyle);
console.log('%c>>', _this.errorStyle, request.requestData.toObject());
console.error('%c<<', _this.errorStyle, event);
console.groupEnd();
}
}));
}
return next.handle(request);
};
return GrpcConsoleLoggerInterceptor;
}());
GrpcConsoleLoggerInterceptor.decorators = [
{ type: i0.Injectable }
];
GrpcConsoleLoggerInterceptor.ctorParameters = function () { return [
{ type: Boolean, decorators: [{ type: i0.Inject, args: [GRPC_CONSOLE_LOGGER_ENABLED,] }] }
]; };
/**
* Use this injection token to register the GrpcClientFactory

@@ -80,3 +18,3 @@ *

*/
var GRPC_CLIENT_FACTORY = new i0.InjectionToken('GRPC_CLIENT_FACTORY');
var GRPC_CLIENT_FACTORY = new core.InjectionToken('GRPC_CLIENT_FACTORY');
/**

@@ -93,3 +31,3 @@ * Use this injection token to add interceptors

*/
var GRPC_INTERCEPTORS = new i0.InjectionToken('GRPC_INTERCEPTORS');
var GRPC_INTERCEPTORS = new core.InjectionToken('GRPC_INTERCEPTORS');

@@ -124,13 +62,169 @@ /**

}());
GrpcHandler.ɵprov = i0.ɵɵdefineInjectable({ factory: function GrpcHandler_Factory() { return new GrpcHandler(i0.ɵɵinject(GRPC_INTERCEPTORS, 8)); }, token: GrpcHandler, providedIn: "root" });
GrpcHandler.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] }
{ type: core.Injectable }
];
GrpcHandler.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [GRPC_INTERCEPTORS,] }] }
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [GRPC_INTERCEPTORS,] }] }
]; };
var GrpcCoreModule = /** @class */ (function () {
function GrpcCoreModule() {
}
/**
* Create GrpcCoreModule for using in AppModule (application root module)
*/
GrpcCoreModule.forRoot = function () {
return {
ngModule: GrpcCoreModule,
providers: [
GrpcHandler,
],
};
};
/**
* Create GrpcCoreModule for using in children modules (incl. lazy modules)
*/
GrpcCoreModule.forChild = function () {
return {
ngModule: GrpcCoreModule,
providers: [
GrpcHandler,
],
};
};
return GrpcCoreModule;
}());
GrpcCoreModule.decorators = [
{ type: core.NgModule }
];
/**
* A configuration for GrpcLoggerInterceptor
*
* Example:
*
* ```
* providers: [
* { provide: GRPC_LOGGER_SETTINGS, useValue: { enabled: true } },
* ]
* ```
*
* or more complex:
*
* ```
* providers: [
* { provide: GRPC_LOGGER_SETTINGS, useFactory: () => { enabled: localStorage.getItem('GRPC_LOGGER_SETTINGS') === 'true' || !environment.prod } },
* ]
* ```
*/
var GRPC_LOGGER_SETTINGS = new core.InjectionToken('GRPC_LOGGER_SETTINGS');
/**
* Interceptor that implements logging of every request to the browser console
*
* Can be enabled / disabled by GRPC_LOGGER_ENABLED injection token
*/
var GrpcLoggerInterceptor = /** @class */ (function () {
function GrpcLoggerInterceptor(settings) {
if (settings === void 0) { settings = {}; }
var _a, _b, _c, _d, _e, _f;
this.dataStyle = 'color: #5c7ced;';
this.errorStyle = 'color: red;';
this.statusOkStyle = 'color: #0ffcf5;';
this.settings = {
enabled: (_a = settings.enabled) !== null && _a !== void 0 ? _a : true,
logClientSettings: (_b = settings.logClientSettings) !== null && _b !== void 0 ? _b : true,
logMetadata: (_c = settings.logMetadata) !== null && _c !== void 0 ? _c : true,
logStatusCodeOk: (_d = settings.logStatusCodeOk) !== null && _d !== void 0 ? _d : false,
requestMapper: (_e = settings.requestMapper) !== null && _e !== void 0 ? _e : (function (msg) { return msg.toObject(); }),
responseMapper: (_f = settings.responseMapper) !== null && _f !== void 0 ? _f : (function (msg) { return msg.toObject(); }),
};
}
GrpcLoggerInterceptor.prototype.intercept = function (request, next) {
var _this = this;
if (this.settings.enabled) {
var start_1 = Date.now();
return next.handle(request).pipe(operators.tap(function (event) {
var style = event instanceof common.GrpcDataEvent ? _this.dataStyle : event.statusCode !== 0 ? _this.errorStyle : _this.statusOkStyle;
var openGroup = function () { return console.groupCollapsed("%c" + (Date.now() - start_1) + "ms -> " + request.path, style); };
var printSettings = function () {
if (_this.settings.logClientSettings) {
console.log('%csc', style, request.client.getSettings());
}
};
var printMetadata = function () {
if (_this.settings.logMetadata) {
console.log('%c**', style, request.requestMetadata.toObject());
}
};
var printRequest = function () { return console.log('%c>>', style, _this.settings.requestMapper(request.requestData)); };
var closeGroup = function () { return console.groupEnd(); };
if (event instanceof common.GrpcDataEvent) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, _this.settings.responseMapper(event.data));
closeGroup();
}
else if (event.statusCode !== 0) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, event);
closeGroup();
}
else if (event.statusCode === 0 && _this.settings.logStatusCodeOk) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, event);
closeGroup();
}
}));
}
return next.handle(request);
};
return GrpcLoggerInterceptor;
}());
GrpcLoggerInterceptor.decorators = [
{ type: core.Injectable }
];
GrpcLoggerInterceptor.ctorParameters = function () { return [
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [GRPC_LOGGER_SETTINGS,] }] }
]; };
var GrpcLoggerModule = /** @class */ (function () {
function GrpcLoggerModule() {
}
/**
* Create GrpcLoggerModule for using in AppModule (application root module)
* You can provide the options here instead of injecting corresponding tokens separately
*/
GrpcLoggerModule.forRoot = function (options) {
var providers = [{ provide: GRPC_INTERCEPTORS, useClass: GrpcLoggerInterceptor, multi: true }];
if (options === null || options === void 0 ? void 0 : options.settings) {
providers.push({ provide: GRPC_LOGGER_SETTINGS, useValue: options.settings });
}
return { ngModule: GrpcLoggerModule, providers: providers };
};
/**
* Create GrpcCoreModule for using in children modules (incl. lazy modules)
* You can provide the options here instead of injecting corresponding tokens separately
*/
GrpcLoggerModule.forChild = function (options) {
var providers = [{ provide: GRPC_INTERCEPTORS, useClass: GrpcLoggerInterceptor, multi: true }];
if (options === null || options === void 0 ? void 0 : options.settings) {
providers.push({ provide: GRPC_LOGGER_SETTINGS, useValue: options.settings });
}
return { ngModule: GrpcLoggerModule, providers: providers };
};
return GrpcLoggerModule;
}());
GrpcLoggerModule.decorators = [
{ type: core.NgModule }
];
/**
* RxJS operator

@@ -141,3 +235,3 @@ * When applied to gRPC events emits error for status events with a non-zero code (includes throwStatusErrors)

function throwStatusErrors() {
return function (source$) { return source$.pipe(operators.switchMap(function (event) { return event instanceof common.GrpcStatusEvent && event.code ? rxjs.throwError(event) : rxjs.of(event); })); };
return function (source$) { return source$.pipe(operators.switchMap(function (event) { return event instanceof common.GrpcStatusEvent && event.statusCode ? rxjs.throwError(event) : rxjs.of(event); })); };
}

@@ -158,6 +252,8 @@ /**

exports.GRPC_CLIENT_FACTORY = GRPC_CLIENT_FACTORY;
exports.GRPC_CONSOLE_LOGGER_ENABLED = GRPC_CONSOLE_LOGGER_ENABLED;
exports.GRPC_INTERCEPTORS = GRPC_INTERCEPTORS;
exports.GrpcConsoleLoggerInterceptor = GrpcConsoleLoggerInterceptor;
exports.GRPC_LOGGER_SETTINGS = GRPC_LOGGER_SETTINGS;
exports.GrpcCoreModule = GrpcCoreModule;
exports.GrpcHandler = GrpcHandler;
exports.GrpcLoggerInterceptor = GrpcLoggerInterceptor;
exports.GrpcLoggerModule = GrpcLoggerModule;
exports.takeMessages = takeMessages;

@@ -164,0 +260,0 @@ exports.throwStatusErrors = throwStatusErrors;

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@ngx-grpc/common"),require("rxjs/operators"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngx-grpc/core",["exports","@angular/core","@ngx-grpc/common","rxjs/operators","rxjs"],t):t(((e=e||self)["ngx-grpc"]=e["ngx-grpc"]||{},e["ngx-grpc"].core={}),e.ng.core,e.common,e.rxjs.operators,e.rxjs)}(this,(function(e,t,r,o,n){"use strict";var a=new t.InjectionToken("GRPC_CONSOLE_LOGGER_ENABLED"),c=function(){function e(e){this.enabled=e,this.dataStyle="color: #5c7ced;",this.errorStyle="color: red;"}return e.prototype.intercept=function(e,t){var n=this;if(this.enabled){var a=Date.now();return t.handle(e).pipe(o.tap((function(t){t instanceof r.GrpcDataEvent?(console.groupCollapsed("%c"+(Date.now()-a)+"ms -> "+e.path,n.dataStyle),console.log("%c>>",n.dataStyle,e.requestData.toObject()),console.log("%c**",n.dataStyle,e.requestMetadata),console.log("%c<<",n.dataStyle,t.data.toObject()),console.groupEnd()):0!==t.code&&(console.groupCollapsed("%c"+(Date.now()-a)+"ms -> "+e.path,n.errorStyle),console.log("%c>>",n.errorStyle,e.requestData.toObject()),console.error("%c<<",n.errorStyle,t),console.groupEnd())})))}return t.handle(e)},e}();c.decorators=[{type:t.Injectable}],c.ctorParameters=function(){return[{type:Boolean,decorators:[{type:t.Inject,args:[a]}]}]};var s=new t.InjectionToken("GRPC_CLIENT_FACTORY"),i=new t.InjectionToken("GRPC_INTERCEPTORS"),p=function(){function e(e){this.interceptors=e?Array.isArray(e)?e:[e]:[]}return e.prototype.handle=function(t){var o=(this.interceptors||[]).slice(),n=o.shift();return n?n.intercept(t,new e(o)):t.type===r.GrpcCallType.unary?t.client.unary(t.path,t.requestData,t.requestMetadata,t.requestClass,t.responseClass):t.client.serverStream(t.path,t.requestData,t.requestMetadata,t.requestClass,t.responseClass)},e}();p.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new p(t.ɵɵinject(i,8))},token:p,providedIn:"root"}),p.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],p.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[i]}]}]},e.GRPC_CLIENT_FACTORY=s,e.GRPC_CONSOLE_LOGGER_ENABLED=a,e.GRPC_INTERCEPTORS=i,e.GrpcConsoleLoggerInterceptor=c,e.GrpcHandler=p,e.takeMessages=function(){return function(e){return e.pipe(o.filter((function(e){return e instanceof r.GrpcDataEvent})),o.map((function(e){return e.data})))}},e.throwStatusErrors=function(){return function(e){return e.pipe(o.switchMap((function(e){return e instanceof r.GrpcStatusEvent&&e.code?n.throwError(e):n.of(e)})))}},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@ngx-grpc/common"),require("rxjs/operators"),require("rxjs")):"function"==typeof define&&define.amd?define("@ngx-grpc/core",["exports","@angular/core","@ngx-grpc/common","rxjs/operators","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ngx-grpc"]=e["ngx-grpc"]||{},e["ngx-grpc"].core={}),e.ng.core,e.common,e.rxjs.operators,e.rxjs)}(this,(function(e,t,r,n,o){"use strict";var s=new t.InjectionToken("GRPC_CLIENT_FACTORY"),a=new t.InjectionToken("GRPC_INTERCEPTORS"),u=function(){function e(e){this.interceptors=e?Array.isArray(e)?e:[e]:[]}return e.prototype.handle=function(t){var n=(this.interceptors||[]).slice(),o=n.shift();return o?o.intercept(t,new e(n)):t.type===r.GrpcCallType.unary?t.client.unary(t.path,t.requestData,t.requestMetadata,t.requestClass,t.responseClass):t.client.serverStream(t.path,t.requestData,t.requestMetadata,t.requestClass,t.responseClass)},e}();u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[a]}]}]};var i=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[u]}},e.forChild=function(){return{ngModule:e,providers:[u]}},e}();i.decorators=[{type:t.NgModule}];var c=new t.InjectionToken("GRPC_LOGGER_SETTINGS"),l=function(){function e(e){var t,r,n,o,s,a;void 0===e&&(e={}),this.dataStyle="color: #5c7ced;",this.errorStyle="color: red;",this.statusOkStyle="color: #0ffcf5;",this.settings={enabled:null===(t=e.enabled)||void 0===t||t,logClientSettings:null===(r=e.logClientSettings)||void 0===r||r,logMetadata:null===(n=e.logMetadata)||void 0===n||n,logStatusCodeOk:null!==(o=e.logStatusCodeOk)&&void 0!==o&&o,requestMapper:null!==(s=e.requestMapper)&&void 0!==s?s:function(e){return e.toObject()},responseMapper:null!==(a=e.responseMapper)&&void 0!==a?a:function(e){return e.toObject()}}}return e.prototype.intercept=function(e,t){var o=this;if(this.settings.enabled){var s=Date.now();return t.handle(e).pipe(n.tap((function(t){var n=t instanceof r.GrpcDataEvent?o.dataStyle:0!==t.statusCode?o.errorStyle:o.statusOkStyle,a=function(){return console.groupCollapsed("%c"+(Date.now()-s)+"ms -> "+e.path,n)},u=function(){o.settings.logClientSettings&&console.log("%csc",n,e.client.getSettings())},i=function(){o.settings.logMetadata&&console.log("%c**",n,e.requestMetadata.toObject())},c=function(){return console.log("%c>>",n,o.settings.requestMapper(e.requestData))},l=function(){return console.groupEnd()};t instanceof r.GrpcDataEvent?(a(),u(),c(),i(),console.log("%c<<",n,o.settings.responseMapper(t.data)),l()):(0!==t.statusCode||0===t.statusCode&&o.settings.logStatusCodeOk)&&(a(),u(),c(),i(),console.log("%c<<",n,t),l())})))}return t.handle(e)},e}();l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[c]}]}]};var p=function(){function e(){}return e.forRoot=function(t){var r=[{provide:a,useClass:l,multi:!0}];return(null==t?void 0:t.settings)&&r.push({provide:c,useValue:t.settings}),{ngModule:e,providers:r}},e.forChild=function(t){var r=[{provide:a,useClass:l,multi:!0}];return(null==t?void 0:t.settings)&&r.push({provide:c,useValue:t.settings}),{ngModule:e,providers:r}},e}();p.decorators=[{type:t.NgModule}],e.GRPC_CLIENT_FACTORY=s,e.GRPC_INTERCEPTORS=a,e.GRPC_LOGGER_SETTINGS=c,e.GrpcCoreModule=i,e.GrpcHandler=u,e.GrpcLoggerInterceptor=l,e.GrpcLoggerModule=p,e.takeMessages=function(){return function(e){return e.pipe(n.filter((function(e){return e instanceof r.GrpcDataEvent})),n.map((function(e){return e.data})))}},e.throwStatusErrors=function(){return function(e){return e.pipe(n.switchMap((function(e){return e instanceof r.GrpcStatusEvent&&e.statusCode?o.throwError(e):o.of(e)})))}},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-grpc-core.umd.min.js.map
import { Inject, Injectable, Optional } from '@angular/core';
import { GrpcCallType } from '@ngx-grpc/common';
import { GRPC_INTERCEPTORS } from './injection-tokens';
import * as i0 from "@angular/core";
import * as i1 from "./injection-tokens";
/**

@@ -33,7 +31,4 @@ * Core gRPC transport class. Implements creation and binding of RPCs to the clients.

}
GrpcHandler.ɵprov = i0.ɵɵdefineInjectable({ factory: function GrpcHandler_Factory() { return new GrpcHandler(i0.ɵɵinject(i1.GRPC_INTERCEPTORS, 8)); }, token: GrpcHandler, providedIn: "root" });
GrpcHandler.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
{ type: Injectable }
];

@@ -43,2 +38,2 @@ GrpcHandler.ctorParameters = () => [

];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JwYy1oYW5kbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS9zcmMvbGliL2dycGMtaGFuZGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUFFLFlBQVksR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YmxlPEdycGNFdmVudDxTPj4ge1xuICAgIGNvbnN0IGludGVyY2VwdG9ycyA9ICh0aGlzLmludGVyY2VwdG9ycyB8fCBbXSkuc2xpY2UoKTtcbiAgICBjb25zdCBpbnRlcmNlcHRvciA9IGludGVyY2VwdG9ycy5zaGlmdCgpO1xuXG4gICAgaWYgKGludGVyY2VwdG9yKSB7XG4gICAgICByZXR1cm4gaW50ZXJjZXB0b3IuaW50ZXJjZXB0KHJlcXVlc3QsIG5ldyBHcnBjSGFuZGxlcihpbnRlcmNlcHRvcnMpKTtcbiAgICB9XG5cbiAgICBpZiAocmVxdWVzdC50eXBlID09PSBHcnBjQ2FsbFR5cGUudW5hcnkpIHtcbiAgICAgIHJldHVybiByZXF1ZXN0LmNsaWVudC51bmFyeShcbiAgICAgICAgcmVxdWVzdC5wYXRoLFxuICAgICAgICByZXF1ZXN0LnJlcXVlc3REYXRhLFxuICAgICAgICByZXF1ZXN0LnJlcXVlc3RNZXRhZGF0YSxcbiAgICAgICAgcmVxdWVzdC5yZXF1ZXN0Q2xhc3MsXG4gICAgICAgIHJlcXVlc3QucmVzcG9uc2VDbGFzcyxcbiAgICAgICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlcXVlc3QuY2xpZW50LnNlcnZlclN0cmVhbShcbiAgICAgIHJlcXVlc3QucGF0aCxcbiAgICAgIHJlcXVlc3QucmVxdWVzdERhdGEsXG4gICAgICByZXF1ZXN0LnJlcXVlc3RNZXRhZGF0YSxcbiAgICAgIHJlcXVlc3QucmVxdWVzdENsYXNzLFxuICAgICAgcmVxdWVzdC5yZXNwb25zZUNsYXNzLFxuICAgICk7XG4gIH1cblxufVxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JwYy1oYW5kbGVyLmpzIiwic291cmNlUm9vdCI6Ii4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjLyIsInNvdXJjZXMiOlsibGliL2dycGMtaGFuZGxlci50c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VwdG9yIGVudHJ5IHBvaW50XG4gICAqXG4gICAqIEV4YW1wbGU6XG4gICAqXG4gICAqIGBgYFxuICAgKiAgaW50ZXJjZXB0PFEgZXh0ZW5kcyBHcnBjTWVzc2FnZSwgUyBleHRlbmRzIEdycGNNZXNzYWdlPihyZXF1ZXN0OiBHcnBjUmVxdWVzdDxRLCBTPiwgbmV4dDogR3JwY0hhbmRsZXIpOiBPYnNlcnZhYmxlPEdycGNFdmVudDxTPj4ge1xuICAgKiAgICAvLyBoZXJlIGRvIHNvbWV0aGluZyBiZWZvcmUgcmVxdWVzdCwgZS5nLiBwYXRjaCBtZXNzYWdlcywgbWV0YWRhdGEsIGV0Y1xuICAgKlxuICAgKiAgICByZXR1cm4gbmV4dC5oYW5kbGUocmVxdWVzdCkucGlwZShcbiAgICogICAgICAvLyBoZXJlIGhhbmRsZSBhbGwgbWVzc2FnZXMsIHN0YXR1cyBjb2RlcywgbWV0YWRhdGEsIGVycm9ycywgcmV0cmllcyBldGNcbiAgICogICAgKTtcbiAgICogIH1cbiAgICogYGBgXG4gICAqXG4gICAqIEBwYXJhbSByZXF1ZXN0IGludGVyY2VwdGVkIHJlcXVlc3RcbiAgICogQHBhcmFtIG5leHQgY3VycmVudCBHcnBjSGFuZGxlciB0byBwYXNzIHRoZSBtZXNzYWdlcyB0aHJvdWdoXG4gICAqL1xuICBpbnRlcmNlcHQ8USBleHRlbmRzIEdycGNNZXNzYWdlLCBTIGV4dGVuZHMgR3JwY01lc3NhZ2U+KHJlcXVlc3Q6IEdycGNSZXF1ZXN0PFEsIFM+LCBuZXh0OiBHcnBjSGFuZGxlcik6IE9ic2VydmFibGU8R3JwY0V2ZW50PFM+PjtcblxufVxuIl19

@@ -10,3 +10,3 @@ import { GrpcDataEvent, GrpcStatusEvent } from '@ngx-grpc/common';

export function throwStatusErrors() {
return (source$) => source$.pipe(switchMap(event => event instanceof GrpcStatusEvent && event.code ? throwError(event) : of(event)));
return (source$) => source$.pipe(switchMap(event => event instanceof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udDxUPj4pID0+IHNvdXJjZSQucGlwZShcbiAgICBzd2l0Y2hNYXAoZXZlbnQgPT4gZXZlbnQgaW5zdGFuY2VvZiBHcnBjU3RhdHVzRXZlbnQgJiYgZXZlbnQuc3RhdHVzQ29kZSA/IHRocm93RXJyb3IoZXZlbnQpIDogb2YoZXZlbnQpKSxcbiAgKTtcbn1cblxuLyoqXG4gKiBSeEpTIG9wZXJhdG9yXG4gKiBXaGVuIGFwcGxpZWQgdG8gZ1JQQyBldmVudHMgc3RyZWFtIGV4dHJhY3RzIGFuZCByZXR1cm5zIG9ubHkgbWVzc2FnZXNcbiAqIEByZXR1cm4gT2JzZXJ2YWJsZSBvZiBtZXNzYWdlc1xuICovXG5leHBvcnQgZnVuY3Rpb24gdGFrZU1lc3NhZ2VzPFQgZXh0ZW5kcyBHcnBjTWVzc2FnZT4oKSB7XG4gIHJldHVybiAoc291cmNlJDogT2JzZXJ2YWJsZTxHcnBjRXZlbnQ8VD4+KSA9PiBzb3VyY2UkLnBpcGUoXG4gICAgZmlsdGVyKGV2ZW50ID0+IGV2ZW50IGluc3RhbmNlb2YgR3JwY0RhdGFFdmVudCksXG4gICAgbWFwKChldmVudDogR3JwY0RhdGFFdmVudDxUPikgPT4gZXZlbnQuZGF0YSksXG4gICk7XG59XG4iXX0=

@@ -26,2 +26,2 @@ import { InjectionToken } from '@angular/core';

export const GRPC_INTERCEPTORS = new InjectionToken('GRPC_INTERCEPTORS');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0aW9uLXRva2Vucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL2xpYi9pbmplY3Rpb24tdG9rZW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFL0M7Oz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mlkZXJzOiBbXG4gKiAgIHsgcHJvdmlkZTogR1JQQ19JTlRFUkNFUFRPUlMsIHVzZUNsYXNzOiBNeUludGVyY2VwdG9yLCBtdWx0aTogdHJ1ZSB9LFxuICogXVxuICogYGBgXG4gKi9cbmV4cG9ydCBjb25zdCBHUlBDX0lOVEVSQ0VQVE9SUyA9IG5ldyBJbmplY3Rpb25Ub2tlbignR1JQQ19JTlRFUkNFUFRPUlMnKTtcbiJdfQ==

@@ -5,2 +5,2 @@ /**

export * from './public-api';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWdycGMtY29yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL25neC1ncnBjLWNvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWdycGMtY29yZS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy8iLCJzb3VyY2VzIjpbIm5neC1ncnBjLWNvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==

@@ -1,6 +0,8 @@

export * from './lib/grpc-console-logger-interceptor';
export * from './lib/grpc-core.module';
export * from './lib/grpc-handler';
export * from './lib/grpc-interceptor';
export * from './lib/grpc-logger-interceptor';
export * from './lib/grpc-logger.module';
export * from './lib/grpc-rx-operators';
export * from './lib/injection-tokens';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHdCQUF3QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9saWIvZ3JwYy1jb25zb2xlLWxvZ2dlci1pbnRlcmNlcHRvcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9ncnBjLWhhbmRsZXInO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZ3JwYy1pbnRlcmNlcHRvcic7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9ncnBjLXJ4LW9wZXJhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9pbmplY3Rpb24tdG9rZW5zJztcblxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy8iLCJzb3VyY2VzIjpbInB1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyx3QkFBd0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2dycGMtY29yZS5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZ3JwYy1oYW5kbGVyJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2dycGMtaW50ZXJjZXB0b3InO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZ3JwYy1sb2dnZXItaW50ZXJjZXB0b3InO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZ3JwYy1sb2dnZXIubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2dycGMtcngtb3BlcmF0b3JzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2luamVjdGlvbi10b2tlbnMnO1xuXG4iXX0=

@@ -1,3 +0,3 @@

import { InjectionToken, Injectable, Inject, ɵɵdefineInjectable, ɵɵinject, Optional } from '@angular/core';
import { GrpcDataEvent, GrpcCallType, GrpcStatusEvent } from '@ngx-grpc/common';
import { InjectionToken, Injectable, Optional, Inject, NgModule } from '@angular/core';
import { GrpcCallType, GrpcDataEvent, GrpcStatusEvent } from '@ngx-grpc/common';
import { tap, switchMap, filter, map } from 'rxjs/operators';

@@ -7,62 +7,2 @@ import { throwError, of } from 'rxjs';

/**
* A configuration for GrpcConsoleLoggerInterceptor to turn it on or off
*
* Example:
*
* ```
* providers: [
* { provide: GRPC_CONSOLE_LOGGER_ENABLED, useValue: true },
* ]
* ```
*
* or more complex:
*
* ```
* providers: [
* { provide: GRPC_CONSOLE_LOGGER_ENABLED, useFactory: () => localStorage.getItem('GRPC_CONSOLE_LOGGER_ENABLED') === 'true' || !environment.prod },
* ]
* ```
*/
const GRPC_CONSOLE_LOGGER_ENABLED = new InjectionToken('GRPC_CONSOLE_LOGGER_ENABLED');
/**
* Interceptor that implements logging of every request to the browser console
*
* Can be enabled / disabled by GRPC_CONSOLE_LOGGER_ENABLED injection token
*/
class GrpcConsoleLoggerInterceptor {
constructor(enabled) {
this.enabled = enabled;
this.dataStyle = 'color: #5c7ced;';
this.errorStyle = 'color: red;';
}
intercept(request, next) {
if (this.enabled) {
const start = Date.now();
return next.handle(request).pipe(tap(event => {
if (event instanceof GrpcDataEvent) {
console.groupCollapsed(`%c${Date.now() - start}ms -> ${request.path}`, this.dataStyle);
console.log('%c>>', this.dataStyle, request.requestData.toObject());
console.log('%c**', this.dataStyle, request.requestMetadata);
console.log('%c<<', this.dataStyle, event.data.toObject());
console.groupEnd();
}
else if (event.code !== 0) {
console.groupCollapsed(`%c${Date.now() - start}ms -> ${request.path}`, this.errorStyle);
console.log('%c>>', this.errorStyle, request.requestData.toObject());
console.error('%c<<', this.errorStyle, event);
console.groupEnd();
}
}));
}
return next.handle(request);
}
}
GrpcConsoleLoggerInterceptor.decorators = [
{ type: Injectable }
];
GrpcConsoleLoggerInterceptor.ctorParameters = () => [
{ type: Boolean, decorators: [{ type: Inject, args: [GRPC_CONSOLE_LOGGER_ENABLED,] }] }
];
/**
* Use this injection token to register the GrpcClientFactory

@@ -119,7 +59,4 @@ *

}
GrpcHandler.ɵprov = ɵɵdefineInjectable({ factory: function GrpcHandler_Factory() { return new GrpcHandler(ɵɵinject(GRPC_INTERCEPTORS, 8)); }, token: GrpcHandler, providedIn: "root" });
GrpcHandler.decorators = [
{ type: Injectable, args: [{
providedIn: 'root'
},] }
{ type: Injectable }
];

@@ -130,3 +67,153 @@ GrpcHandler.ctorParameters = () => [

class GrpcCoreModule {
/**
* Create GrpcCoreModule for using in AppModule (application root module)
*/
static forRoot() {
return {
ngModule: GrpcCoreModule,
providers: [
GrpcHandler,
],
};
}
/**
* Create GrpcCoreModule for using in children modules (incl. lazy modules)
*/
static forChild() {
return {
ngModule: GrpcCoreModule,
providers: [
GrpcHandler,
],
};
}
}
GrpcCoreModule.decorators = [
{ type: NgModule }
];
/**
* A configuration for GrpcLoggerInterceptor
*
* Example:
*
* ```
* providers: [
* { provide: GRPC_LOGGER_SETTINGS, useValue: { enabled: true } },
* ]
* ```
*
* or more complex:
*
* ```
* providers: [
* { provide: GRPC_LOGGER_SETTINGS, useFactory: () => { enabled: localStorage.getItem('GRPC_LOGGER_SETTINGS') === 'true' || !environment.prod } },
* ]
* ```
*/
const GRPC_LOGGER_SETTINGS = new InjectionToken('GRPC_LOGGER_SETTINGS');
/**
* Interceptor that implements logging of every request to the browser console
*
* Can be enabled / disabled by GRPC_LOGGER_ENABLED injection token
*/
class GrpcLoggerInterceptor {
constructor(settings = {}) {
var _a, _b, _c, _d, _e, _f;
this.dataStyle = 'color: #5c7ced;';
this.errorStyle = 'color: red;';
this.statusOkStyle = 'color: #0ffcf5;';
this.settings = {
enabled: (_a = settings.enabled) !== null && _a !== void 0 ? _a : true,
logClientSettings: (_b = settings.logClientSettings) !== null && _b !== void 0 ? _b : true,
logMetadata: (_c = settings.logMetadata) !== null && _c !== void 0 ? _c : true,
logStatusCodeOk: (_d = settings.logStatusCodeOk) !== null && _d !== void 0 ? _d : false,
requestMapper: (_e = settings.requestMapper) !== null && _e !== void 0 ? _e : ((msg) => msg.toObject()),
responseMapper: (_f = settings.responseMapper) !== null && _f !== void 0 ? _f : ((msg) => msg.toObject()),
};
}
intercept(request, next) {
if (this.settings.enabled) {
const start = Date.now();
return next.handle(request).pipe(tap(event => {
const style = event instanceof GrpcDataEvent ? this.dataStyle : event.statusCode !== 0 ? this.errorStyle : this.statusOkStyle;
const openGroup = () => console.groupCollapsed(`%c${Date.now() - start}ms -> ${request.path}`, style);
const printSettings = () => {
if (this.settings.logClientSettings) {
console.log('%csc', style, request.client.getSettings());
}
};
const printMetadata = () => {
if (this.settings.logMetadata) {
console.log('%c**', style, request.requestMetadata.toObject());
}
};
const printRequest = () => console.log('%c>>', style, this.settings.requestMapper(request.requestData));
const closeGroup = () => console.groupEnd();
if (event instanceof GrpcDataEvent) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, this.settings.responseMapper(event.data));
closeGroup();
}
else if (event.statusCode !== 0) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, event);
closeGroup();
}
else if (event.statusCode === 0 && this.settings.logStatusCodeOk) {
openGroup();
printSettings();
printRequest();
printMetadata();
console.log('%c<<', style, event);
closeGroup();
}
}));
}
return next.handle(request);
}
}
GrpcLoggerInterceptor.decorators = [
{ type: Injectable }
];
GrpcLoggerInterceptor.ctorParameters = () => [
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [GRPC_LOGGER_SETTINGS,] }] }
];
class GrpcLoggerModule {
/**
* Create GrpcLoggerModule for using in AppModule (application root module)
* You can provide the options here instead of injecting corresponding tokens separately
*/
static forRoot(options) {
const providers = [{ provide: GRPC_INTERCEPTORS, useClass: GrpcLoggerInterceptor, multi: true }];
if (options === null || options === void 0 ? void 0 : options.settings) {
providers.push({ provide: GRPC_LOGGER_SETTINGS, useValue: options.settings });
}
return { ngModule: GrpcLoggerModule, providers };
}
/**
* Create GrpcCoreModule for using in children modules (incl. lazy modules)
* You can provide the options here instead of injecting corresponding tokens separately
*/
static forChild(options) {
const providers = [{ provide: GRPC_INTERCEPTORS, useClass: GrpcLoggerInterceptor, multi: true }];
if (options === null || options === void 0 ? void 0 : options.settings) {
providers.push({ provide: GRPC_LOGGER_SETTINGS, useValue: options.settings });
}
return { ngModule: GrpcLoggerModule, providers };
}
}
GrpcLoggerModule.decorators = [
{ type: NgModule }
];
/**
* RxJS operator

@@ -137,3 +224,3 @@ * When applied to gRPC events emits error for status events with a non-zero code (includes throwStatusErrors)

function throwStatusErrors() {
return (source$) => source$.pipe(switchMap(event => event instanceof GrpcStatusEvent && event.code ? throwError(event) : of(event)));
return (source$) => source$.pipe(switchMap(event => event instanceof GrpcStatusEvent && event.statusCode ? throwError(event) : of(event)));
}

@@ -153,3 +240,3 @@ /**

export { GRPC_CLIENT_FACTORY, GRPC_CONSOLE_LOGGER_ENABLED, GRPC_INTERCEPTORS, GrpcConsoleLoggerInterceptor, GrpcHandler, takeMessages, throwStatusErrors };
export { GRPC_CLIENT_FACTORY, GRPC_INTERCEPTORS, GRPC_LOGGER_SETTINGS, GrpcCoreModule, GrpcHandler, GrpcLoggerInterceptor, GrpcLoggerModule, takeMessages, throwStatusErrors };
//# sourceMappingURL=ngx-grpc-core.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"GRPC_CONSOLE_LOGGER_ENABLED":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":26,"character":47},"arguments":["GRPC_CONSOLE_LOGGER_ENABLED"]},"GrpcConsoleLoggerInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":33,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":39,"character":15},"arguments":[{"__symbolic":"reference","name":"GRPC_CONSOLE_LOGGER_ENABLED"}]}]],"parameters":[{"__symbolic":"reference","name":"boolean"}]}],"intercept":[{"__symbolic":"method"}]}},"GrpcHandler":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":19,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":19,"character":17},"arguments":[{"__symbolic":"reference","name":"GRPC_INTERCEPTORS"}]}]],"parameters":[{"__symbolic":"reference","name":"GrpcInterceptor"}]}],"handle":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"GrpcInterceptor":{"__symbolic":"interface"},"throwStatusErrors":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":10,"character":9,"module":"./lib/grpc-rx-operators"}},"takeMessages":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":21,"character":9,"module":"./lib/grpc-rx-operators"}},"GRPC_CLIENT_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":13,"character":39},"arguments":["GRPC_CLIENT_FACTORY"]},"GRPC_INTERCEPTORS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":26,"character":37},"arguments":["GRPC_INTERCEPTORS"]}},"origins":{"GRPC_CONSOLE_LOGGER_ENABLED":"./lib/grpc-console-logger-interceptor","GrpcConsoleLoggerInterceptor":"./lib/grpc-console-logger-interceptor","GrpcHandler":"./lib/grpc-handler","GrpcInterceptor":"./lib/grpc-interceptor","throwStatusErrors":"./lib/grpc-rx-operators","takeMessages":"./lib/grpc-rx-operators","GRPC_CLIENT_FACTORY":"./lib/injection-tokens","GRPC_INTERCEPTORS":"./lib/injection-tokens"},"importAs":"@ngx-grpc/core"}
{"__symbolic":"module","version":4,"metadata":{"GrpcCoreModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1}}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"GrpcCoreModule"},"providers":[{"__symbolic":"reference","name":"GrpcHandler"}]}},"forChild":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"GrpcCoreModule"},"providers":[{"__symbolic":"reference","name":"GrpcHandler"}]}}}},"GrpcHandler":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":11,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":17,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":17},"arguments":[{"__symbolic":"reference","name":"GRPC_INTERCEPTORS"}]}]],"parameters":[{"__symbolic":"reference","name":"GrpcInterceptor"}]}],"handle":[{"__symbolic":"method"}]}},"GrpcInterceptor":{"__symbolic":"interface"},"GRPC_LOGGER_SETTINGS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":26,"character":40},"arguments":["GRPC_LOGGER_SETTINGS"]},"GrpcLoggerSettings":{"__symbolic":"interface"},"GrpcLoggerInterceptor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":68,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":77,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":77,"character":27},"arguments":[{"__symbolic":"reference","name":"GRPC_LOGGER_SETTINGS"}]}]],"parameters":[{"__symbolic":"reference","name":"any"}]}],"intercept":[{"__symbolic":"method"}]}},"GrpcLoggerRootOptions":{"__symbolic":"interface"},"GrpcLoggerChildOptions":{"__symbolic":"interface"},"GrpcLoggerModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":12,"character":1}}],"members":{}},"throwStatusErrors":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":10,"character":9,"module":"./lib/grpc-rx-operators"}},"takeMessages":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":21,"character":9,"module":"./lib/grpc-rx-operators"}},"GRPC_CLIENT_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":13,"character":39},"arguments":["GRPC_CLIENT_FACTORY"]},"GRPC_INTERCEPTORS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":26,"character":37},"arguments":["GRPC_INTERCEPTORS"]}},"origins":{"GrpcCoreModule":"./lib/grpc-core.module","GrpcHandler":"./lib/grpc-handler","GrpcInterceptor":"./lib/grpc-interceptor","GRPC_LOGGER_SETTINGS":"./lib/grpc-logger-interceptor","GrpcLoggerSettings":"./lib/grpc-logger-interceptor","GrpcLoggerInterceptor":"./lib/grpc-logger-interceptor","GrpcLoggerRootOptions":"./lib/grpc-logger.module","GrpcLoggerChildOptions":"./lib/grpc-logger.module","GrpcLoggerModule":"./lib/grpc-logger.module","throwStatusErrors":"./lib/grpc-rx-operators","takeMessages":"./lib/grpc-rx-operators","GRPC_CLIENT_FACTORY":"./lib/injection-tokens","GRPC_INTERCEPTORS":"./lib/injection-tokens"},"importAs":"@ngx-grpc/core"}

@@ -17,3 +17,3 @@ {

"peerDependencies": {
"@ngx-grpc/common": "1.0.4",
"@ngx-grpc/common": "2.0.0",
"@angular/core": ">=8.0.0",

@@ -33,3 +33,3 @@ "rxjs": "^6.0.0"

"sideEffects": false,
"version": "1.0.4"
"version": "2.0.0"
}

@@ -1,5 +0,7 @@

export * from './lib/grpc-console-logger-interceptor';
export * from './lib/grpc-core.module';
export * from './lib/grpc-handler';
export * from './lib/grpc-interceptor';
export * from './lib/grpc-logger-interceptor';
export * from './lib/grpc-logger.module';
export * from './lib/grpc-rx-operators';
export * from './lib/injection-tokens';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc