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

@skbkontur/node-core

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@skbkontur/node-core - npm Package Compare versions

Comparing version 1.0.0-rc.3 to 1.0.0-rc.4

6

lib/index.js
// @flow
/* ::
import type { Options, Config, Process, Logger } from './types';
import type { IStrategy, IRequestSender, HttpRequest, HttpResponse } from '@skbkontur/cluster-client'
/* ::
import { Options, Config, Process } from './types'
export type { Options, Config, Logger, HttpRequest, HttpResponse };
*/

@@ -7,0 +9,0 @@

// @flow
/*::
import { Options, Config, Process } from './types'
/* ::
import type { Options, Config, Process } from './types'
*/

@@ -24,2 +24,6 @@

if (!spanAggrApiKey) {
throw new TypeError('Config should contains spanAggrApiKey')
}
spanAggregator = new SpanAggregator({

@@ -26,0 +30,0 @@ apiKey: spanAggrApiKey,

// @flow
/* ::
type loggerOptions = {
serverName: string,
path: string,
apiKey: string,
type?: string,
}
import type { Logger } from '../types';
*/
const winston = require('winston')
const KonturLogstash = require('@skbkontur/winston-kontur-logstash')
let logger = null
let logger /* : ?Logger */ = null
function createLogger(data /* : Object */) {
function createLogger(options /* : loggerOptions */) /* : Logger */ {
logger = new winston.Logger({
transports: [
new KonturLogstash(data),
new KonturLogstash(options),
new winston.transports.Console({ colorize: true })

@@ -13,0 +24,0 @@ ]

// @flow
/* ::
import type { Context } from 'koa';
import type { Logger } from '../types';
*/

@@ -8,4 +10,4 @@

function appErrorHandlerModule(logger) {
return async function appErrorHandler(err /* : Error */, ctx /* : Context*/) {
function appErrorHandlerModule(logger /* : Logger */) {
return async function appErrorHandler(err /* : Error */, ctx /* : Context */) {
let availableLogger = logger

@@ -16,4 +18,3 @@ let loggerLevel = 'error'

try {
const contextualLogger = ctx.state.container.resolve('logger')
availableLogger = contextualLogger
availableLogger = ctx.state.container.resolve('logger')
} catch (ex) {}

@@ -20,0 +21,0 @@ }

// @flow
/* ::
import type { Application } from 'koa';
import Application from 'koa';
*/

@@ -14,3 +14,3 @@

function useCore(app /* : Application */, coreApp) {
function useCore(app /* : Application */, coreApp /* : any */) {
const {

@@ -17,0 +17,0 @@ logger,

// @flow
/* ::
import type { Context } from 'koa';
import type { Logger } from '../types';
*/
const requestMonitoringModule = (logger) => {
const requestMonitoringModule = (logger /* : Logger */) => {
return async (

@@ -7,0 +10,0 @@ ctx /* : Context */,

@@ -17,9 +17,4 @@ // @flow

import { IStrategy, IRequestSender } from '@skbkontur/cluster-client/src/types'
import type {
types: {
IStrategy, IRequestSender
}
} from '@skbkontur/cluster-client'
type Deps = {

@@ -26,0 +21,0 @@ clusterConfig: ClusterConfig,

// @flow
/* ::
import { Span } from '@skbkontur/span-aggregator-client'
import type Span from '@skbkontur/span-aggregator-client/lib/Span'
import SpanAggregator from '@skbkontur/span-aggregator-client'

@@ -10,7 +10,3 @@ import type ClusterConfig from '@skbkontur/cluster-config-client'

const {
types: {
IStrategy, IRequestSender
}
} = ClusterClientModule
import type { IStrategy, IRequestSender } from '@skbkontur/cluster-client'

@@ -17,0 +13,0 @@ type Deps = {

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

// @flow
/* ::

@@ -28,2 +30,8 @@ export type Process = {

export type Logger = {
info: Function,
warn: Function,
error: Function
}
*/
{
"name": "@skbkontur/node-core",
"version": "1.0.0-rc.3",
"version": "1.0.0-rc.4",
"description": "",

@@ -16,3 +16,3 @@ "main": "./lib/index.js",

"dependencies": {
"@skbkontur/cluster-client": "^1.0.0-rc.3",
"@skbkontur/cluster-client": "^1.0.0-rc.5",
"@skbkontur/cluster-config-client": "^0.0.3",

@@ -22,2 +22,3 @@ "@skbkontur/monitoring-client": "^1.0.0",

"@skbkontur/winston-kontur-logstash": "^3.0.0",
"koa": "^2.5.0",
"winston": "^2.4.0"

@@ -24,0 +25,0 @@ },

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