Socket
Socket
Sign inDemoInstall

backend-nexlab

Package Overview
Dependencies
417
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.31 to 1.0.32

5

lib/components/logging/log-request.d.ts
/// <reference types="node" />
import { NextFunction, Response } from "express";
import { IRequest } from "@typings";
export declare function LogRequest(req: IRequest, res: Response, next: NextFunction): void;
export declare function logRequest(req: IRequest, res: Response, next: NextFunction): void;
export declare function getLogHttpRequest(req: IRequest, res: Response, latencyMs?: number): {

@@ -17,3 +17,3 @@ status: number;

};
export declare function getPayloadRequest(req: IRequest): {
export declare function getPayloadRequest(req: IRequest<any>): {
body: any;

@@ -23,3 +23,4 @@ params: import("express-serve-static-core").ParamsDictionary;

headers: import("http").IncomingHttpHeaders;
currentUserId: any;
};
export declare function getTrace(req: IRequest, projectId: any): string;

8

lib/components/logging/log-request.js

@@ -16,3 +16,3 @@ "use strict";

const helpers_1 = require("../helpers");
function LogRequest(req, res, next) {
function logRequest(req, res, next) {
// handle log google

@@ -31,3 +31,3 @@ if (process.env.SERVICE_LOG && process.env.GOOGLE_APPLICATION_CREDENTIALS) {

}
exports.LogRequest = LogRequest;
exports.logRequest = logRequest;
function getLogHttpRequest(req, res, latencyMs) {

@@ -49,2 +49,3 @@ return {

function getPayloadRequest(req) {
var _a;
const bodySize = JSON.stringify(helpers_1.safeParseJSON(req.body, {})).length / 1024;

@@ -55,3 +56,4 @@ return {

query: req.query,
headers: req.headers
headers: req.headers,
currentUserId: (_a = req.currentUser) === null || _a === void 0 ? void 0 : _a.id
};

@@ -58,0 +60,0 @@ }

@@ -74,3 +74,3 @@ "use strict";

});
app && app.use(log_request_1.LogRequest);
app && app.use(log_request_1.logRequest);
process.on("unhandledRejection", (error) => {

@@ -77,0 +77,0 @@ defaultLogger.error(error);

@@ -22,3 +22,3 @@ import { Request } from "express";

}
export declare type ModelSequelize<M> = (new () => M) & ModelType;
export declare type ModelSequelize<M> = (new () => M) & ModelType & M;
export interface IPagingResult<M> {

@@ -62,3 +62,3 @@ data: M[];

export declare function findOrFail<I extends Model>(model: (new () => I) & typeof Model, query: string | number | FindOptions): Promise<I>;
export declare function customFindAndCountAll(modelClass: any, queryParams: any, pagingParams: any, optionsFilters: any): Promise<IPagingResult<ModelCtor<import("sequelize-typescript").Model<any, any>>> | {
export declare function customFindAndCountAll(modelClass: any, queryParams: any, pagingParams: any, optionsFilters: any): Promise<IPagingResult<any> | {
data: any;

@@ -65,0 +65,0 @@ pagination: {

{
"name": "backend-nexlab",
"version": "1.0.31",
"version": "1.0.32",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -9,3 +9,3 @@ import { NextFunction, Response } from "express";

export function LogRequest(req: IRequest, res: Response, next: NextFunction) {
export function logRequest(req: IRequest, res: Response, next: NextFunction) {
// handle log google

@@ -41,3 +41,3 @@ if (process.env.SERVICE_LOG && process.env.GOOGLE_APPLICATION_CREDENTIALS) {

export function getPayloadRequest(req: IRequest) {
export function getPayloadRequest(req: IRequest<any>) {
const bodySize = JSON.stringify(safeParseJSON(req.body, {})).length / 1024;

@@ -49,3 +49,4 @@

query: req.query,
headers: req.headers
headers: req.headers,
currentUserId: req.currentUser?.id
};

@@ -52,0 +53,0 @@ }

@@ -12,3 +12,3 @@ import Bunyan from "bunyan";

import { DefaultLogger, ILogger } from "./default";
import { getTrace, LogRequest } from "./log-request";
import { getTrace, logRequest } from "./log-request";

@@ -61,3 +61,3 @@ let defaultLogger: ILogger = DefaultLogger;

});
app && app.use(LogRequest);
app && app.use(logRequest);

@@ -64,0 +64,0 @@ process.on("unhandledRejection", (error) => {

@@ -28,3 +28,3 @@ import { Request } from "express";

export type ModelSequelize<M> = (new () => M) & ModelType;
export type ModelSequelize<M> = (new () => M) & ModelType & M;

@@ -31,0 +31,0 @@ export interface IPagingResult<M> {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc