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

koatty_trace

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koatty_trace - npm Package Compare versions

Comparing version 1.2.8 to 1.3.0

8

dist/index.d.ts

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

import { Namespace } from "cls-hooked";
import { Application, Context } from "koatty_container";
import { Koatty, KoattyContext } from "koatty_core";
export * from "./Exception";

@@ -14,3 +14,3 @@ /**

*/
export declare function TraceServerSetup(app: Application): Namespace;
export declare function TraceServerSetup(app: Koatty): Namespace;
/**

@@ -24,3 +24,3 @@ * debug/trace server handle binding

*/
export declare function TraceBinding(app: Application, req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse, openTrace: boolean): void;
export declare function TraceBinding(app: Koatty, req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse, openTrace: boolean): void;
/**

@@ -33,2 +33,2 @@ * Trace middleware handler

*/
export declare function TraceHandler(app: Application): (ctx: Context, next: Function) => Promise<any>;
export declare function TraceHandler(app: Koatty): (ctx: KoattyContext, next: Function) => Promise<any>;

@@ -36,6 +36,6 @@ "use strict";

if (openTrace) {
app.trace.run(() => {
app.tracer.run(() => {
// event binding
app.trace.bindEmitter(req);
app.trace.bindEmitter(res);
app.tracer.bindEmitter(req);
app.tracer.bindEmitter(res);
// execute app.callback

@@ -75,3 +75,3 @@ app.callback()(req, res);

let currTraceId = '';
if (app.trace) {
if (app.tracer) {
// some key

@@ -84,5 +84,5 @@ const traceId = ctx.headers.traceId || ctx.query.traceId;

currTraceId = parentId || `koatty-${uuid_1.v4()}`;
app.trace.set('parentId', parentId !== null && parentId !== void 0 ? parentId : '');
app.trace.set('traceId', currTraceId);
app.trace.set('ctx', ctx);
app.tracer.set('parentId', parentId !== null && parentId !== void 0 ? parentId : '');
app.tracer.set('traceId', currTraceId);
app.tracer.set('ctx', ctx);
ctx.set('X-Trace-Id', currTraceId);

@@ -89,0 +89,0 @@ }

{
"name": "koatty_trace",
"version": "1.2.8",
"version": "1.3.0",
"description": "Full link tracking and error interception for koatty.",

@@ -74,2 +74,3 @@ "scripts": {

"koatty_container": "^1.x.x",
"koatty_core": "^1.x.x",
"koatty_lib": "^1.x.x",

@@ -83,2 +84,2 @@ "uuid": "^8.3.2"

}
}
}

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