New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gravity-ui/nodekit

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gravity-ui/nodekit - npm Package Compare versions

Comparing version

to
1.2.1

1

dist/index.d.ts

@@ -5,1 +5,2 @@ export { NodeKit } from './nodekit';

export { AppError } from './lib/app-error';
export { REQUEST_ID_HEADER, REQUEST_ID_PARAM_NAME } from './lib/consts';

5

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AppError = exports.AppContext = exports.NodeKit = void 0;
exports.REQUEST_ID_PARAM_NAME = exports.REQUEST_ID_HEADER = exports.AppError = exports.AppContext = exports.NodeKit = void 0;
var nodekit_1 = require("./nodekit");

@@ -10,1 +10,4 @@ Object.defineProperty(exports, "NodeKit", { enumerable: true, get: function () { return nodekit_1.NodeKit; } });

Object.defineProperty(exports, "AppError", { enumerable: true, get: function () { return app_error_1.AppError; } });
var consts_1 = require("./lib/consts");
Object.defineProperty(exports, "REQUEST_ID_HEADER", { enumerable: true, get: function () { return consts_1.REQUEST_ID_HEADER; } });
Object.defineProperty(exports, "REQUEST_ID_PARAM_NAME", { enumerable: true, get: function () { return consts_1.REQUEST_ID_PARAM_NAME; } });
export declare const REQUEST_ID_HEADER = "x-request-id";
export declare const REQUEST_ID_PARAM_NAME = "requestId";
export declare const TRACE_KEY = "uber-trace-id";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TRACE_KEY = exports.REQUEST_ID_HEADER = void 0;
exports.TRACE_KEY = exports.REQUEST_ID_PARAM_NAME = exports.REQUEST_ID_HEADER = void 0;
exports.REQUEST_ID_HEADER = 'x-request-id';
exports.REQUEST_ID_PARAM_NAME = 'requestId';
exports.TRACE_KEY = 'uber-trace-id';

@@ -62,7 +62,3 @@ /// <reference types="node" />

extractSpanContext(headers: IncomingHttpHeaders): SpanContext | undefined;
getMetadata(): {
requestId: string;
} | {
requestId?: undefined;
};
getMetadata(): Record<string, string>;
getTraceId(): any;

@@ -69,0 +65,0 @@ private prepareLogMessage;

@@ -5,2 +5,3 @@ "use strict";

const opentracing_1 = require("opentracing");
const consts_1 = require("./consts");
const error_parser_1 = require("./error-parser");

@@ -136,11 +137,11 @@ function isContextParentParams(v) {

getMetadata() {
const metadata = {};
const requestId = this.get(consts_1.REQUEST_ID_PARAM_NAME);
if (requestId) {
metadata[consts_1.REQUEST_ID_HEADER] = requestId;
}
if (this.span) {
const requestId = this.get('requestId');
const metadata = requestId ? { requestId } : {};
this.tracer.inject(this.span, opentracing_1.FORMAT_HTTP_HEADERS, metadata);
return metadata;
}
else {
return {};
}
return metadata;
}

@@ -147,0 +148,0 @@ getTraceId() {

import type { pino } from 'pino';
import { REQUEST_ID_PARAM_NAME } from './lib/consts';
import type { LoggingLevel } from './lib/logging';

@@ -43,3 +44,3 @@ export interface AppConfig {

export interface AppContextParams {
requestId?: string;
[REQUEST_ID_PARAM_NAME]?: string;
}

@@ -46,0 +47,0 @@ export interface AppDynamicConfig {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const consts_1 = require("./lib/consts");
{
"name": "@gravity-ui/nodekit",
"version": "1.2.0",
"version": "1.2.1",
"description": "Simple toolkit for your Node.js apps and scripts",

@@ -5,0 +5,0 @@ "license": "MIT",