Compare commits
26 Commits
37030cdd65
...
21731ea7c5
Author | SHA1 | Date | |
---|---|---|---|
21731ea7c5 | |||
aad1b3255b | |||
87e8e398d2 | |||
5729c0c42b | |||
749c279f20 | |||
8b68bb1d63 | |||
e62be27436 | |||
6a0c98d742 | |||
9951c75549 | |||
0c722ae9d7 | |||
5f48a0ed9e | |||
dc73a05ea5 | |||
0beecb9677 | |||
8635e4b5da | |||
4a1c028678 | |||
70b03792ff | |||
7dc4981907 | |||
fc52410bd5 | |||
116c2e6bc8 | |||
41c6a5bddc | |||
b9a583454b | |||
b6ad8e3977 | |||
c66452e789 | |||
14325ef891 | |||
adcdc31c69 | |||
2c9728e817 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
.idea/
|
||||
.vscode/
|
||||
node_modules/
|
||||
node_modules/
|
||||
dist/
|
||||
lib/
|
Binary file not shown.
BIN
dist/.yarn/install-state.gz
vendored
BIN
dist/.yarn/install-state.gz
vendored
Binary file not shown.
4
dist/lib/index.d.ts
vendored
4
dist/lib/index.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
export { LoggedRoute, LoggedFunction, LoggedController, LoggedInjectable, LoggedGuard, LoggedInterceptor, LoggedMiddleware, } from './logged';
|
||||
export { ScopedLogger } from './logger';
|
||||
export { InjectLogger, LoggedParam, LoggedHeaders, LoggedBody, LoggedQuery, Logged, Returns, } from './reflected';
|
||||
export { getRequestLogger } from './utils';
|
23
dist/lib/index.js
vendored
23
dist/lib/index.js
vendored
@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRequestLogger = exports.Returns = exports.Logged = exports.LoggedQuery = exports.LoggedBody = exports.LoggedHeaders = exports.LoggedParam = exports.InjectLogger = exports.ScopedLogger = exports.LoggedMiddleware = exports.LoggedInterceptor = exports.LoggedGuard = exports.LoggedInjectable = exports.LoggedController = exports.LoggedFunction = exports.LoggedRoute = void 0;
|
||||
var logged_1 = require("./logged");
|
||||
Object.defineProperty(exports, "LoggedRoute", { enumerable: true, get: function () { return logged_1.LoggedRoute; } });
|
||||
Object.defineProperty(exports, "LoggedFunction", { enumerable: true, get: function () { return logged_1.LoggedFunction; } });
|
||||
Object.defineProperty(exports, "LoggedController", { enumerable: true, get: function () { return logged_1.LoggedController; } });
|
||||
Object.defineProperty(exports, "LoggedInjectable", { enumerable: true, get: function () { return logged_1.LoggedInjectable; } });
|
||||
Object.defineProperty(exports, "LoggedGuard", { enumerable: true, get: function () { return logged_1.LoggedGuard; } });
|
||||
Object.defineProperty(exports, "LoggedInterceptor", { enumerable: true, get: function () { return logged_1.LoggedInterceptor; } });
|
||||
Object.defineProperty(exports, "LoggedMiddleware", { enumerable: true, get: function () { return logged_1.LoggedMiddleware; } });
|
||||
var logger_1 = require("./logger");
|
||||
Object.defineProperty(exports, "ScopedLogger", { enumerable: true, get: function () { return logger_1.ScopedLogger; } });
|
||||
var reflected_1 = require("./reflected");
|
||||
Object.defineProperty(exports, "InjectLogger", { enumerable: true, get: function () { return reflected_1.InjectLogger; } });
|
||||
Object.defineProperty(exports, "LoggedParam", { enumerable: true, get: function () { return reflected_1.LoggedParam; } });
|
||||
Object.defineProperty(exports, "LoggedHeaders", { enumerable: true, get: function () { return reflected_1.LoggedHeaders; } });
|
||||
Object.defineProperty(exports, "LoggedBody", { enumerable: true, get: function () { return reflected_1.LoggedBody; } });
|
||||
Object.defineProperty(exports, "LoggedQuery", { enumerable: true, get: function () { return reflected_1.LoggedQuery; } });
|
||||
Object.defineProperty(exports, "Logged", { enumerable: true, get: function () { return reflected_1.Logged; } });
|
||||
Object.defineProperty(exports, "Returns", { enumerable: true, get: function () { return reflected_1.Returns; } });
|
||||
var utils_1 = require("./utils");
|
||||
Object.defineProperty(exports, "getRequestLogger", { enumerable: true, get: function () { return utils_1.getRequestLogger; } });
|
6
dist/lib/internals/nest.d.ts
vendored
6
dist/lib/internals/nest.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum';
|
||||
import { ParamData, PipeTransform, Type } from '@nestjs/common';
|
||||
import { ROUTE_ARGS_METADATA } from '@nestjs/common/constants';
|
||||
export { RouteParamtypes, PipeTransform, Type, ROUTE_ARGS_METADATA };
|
||||
export declare function createRouteParamDecorator(paramtype: RouteParamtypes): (data?: ParamData) => ParameterDecorator;
|
||||
export declare const createPipesRouteParamDecorator: (paramtype: RouteParamtypes) => (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
|
24
dist/lib/internals/nest.js
vendored
24
dist/lib/internals/nest.js
vendored
@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createPipesRouteParamDecorator = exports.createRouteParamDecorator = exports.ROUTE_ARGS_METADATA = exports.RouteParamtypes = void 0;
|
||||
const route_paramtypes_enum_1 = require("@nestjs/common/enums/route-paramtypes.enum");
|
||||
Object.defineProperty(exports, "RouteParamtypes", { enumerable: true, get: function () { return route_paramtypes_enum_1.RouteParamtypes; } });
|
||||
const common_1 = require("@nestjs/common");
|
||||
const constants_1 = require("@nestjs/common/constants");
|
||||
Object.defineProperty(exports, "ROUTE_ARGS_METADATA", { enumerable: true, get: function () { return constants_1.ROUTE_ARGS_METADATA; } });
|
||||
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
||||
function createRouteParamDecorator(paramtype) {
|
||||
return (data) => (target, key, index) => {
|
||||
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
||||
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, (0, common_1.assignMetadata)(args, paramtype, index, data), target.constructor, key);
|
||||
};
|
||||
}
|
||||
exports.createRouteParamDecorator = createRouteParamDecorator;
|
||||
const createPipesRouteParamDecorator = (paramtype) => (data, ...pipes) => (target, key, index) => {
|
||||
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
|
||||
const hasParamData = (0, shared_utils_1.isNil)(data) || (0, shared_utils_1.isString)(data);
|
||||
const paramData = hasParamData ? data : undefined;
|
||||
const paramPipes = hasParamData ? pipes : [data, ...pipes];
|
||||
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, (0, common_1.assignMetadata)(args, paramtype, index, paramData, ...paramPipes), target.constructor, key);
|
||||
};
|
||||
exports.createPipesRouteParamDecorator = createPipesRouteParamDecorator;
|
12
dist/lib/internals/utils.d.ts
vendored
12
dist/lib/internals/utils.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
export declare const notIncludedSymbol: unique symbol;
|
||||
export declare function includeObjectSync(ocv: any, opt: {
|
||||
paths: string[];
|
||||
}): any;
|
||||
export declare function excludeObjectSync(ocv: any, opt: {
|
||||
paths: string[];
|
||||
}): any;
|
||||
export declare function objectContainedLogSync(ocv: any, options?: {
|
||||
include?: string[];
|
||||
exclude?: string[];
|
||||
}): string;
|
||||
export declare function getItemByPathSync(obj: object, path: string | string[]): any;
|
82
dist/lib/internals/utils.js
vendored
82
dist/lib/internals/utils.js
vendored
@ -1,82 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getItemByPathSync = exports.objectContainedLogSync = exports.excludeObjectSync = exports.includeObjectSync = exports.notIncludedSymbol = void 0;
|
||||
exports.notIncludedSymbol = Symbol('notIncluded');
|
||||
function includeObjectSync(ocv, opt) {
|
||||
let current = Array.isArray(ocv) ? [] : typeof ocv === 'object' ? {} : ocv;
|
||||
opt.paths.forEach((dotpath) => {
|
||||
let query = ocv;
|
||||
let objRef = current;
|
||||
const path = dotpath.split('.');
|
||||
for (const [index, key] of Object.entries(path)) {
|
||||
query = query[key];
|
||||
if (query !== undefined && objRef[key] === undefined) {
|
||||
if (typeof query === 'object') {
|
||||
if (Array.isArray(query)) {
|
||||
objRef[key] = [];
|
||||
}
|
||||
else {
|
||||
objRef[key] = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof query !== 'object' || index === (path.length - 1).toString()) {
|
||||
objRef[key] = query;
|
||||
break;
|
||||
}
|
||||
objRef = objRef[key];
|
||||
}
|
||||
});
|
||||
return current;
|
||||
}
|
||||
exports.includeObjectSync = includeObjectSync;
|
||||
function excludeObjectSync(ocv, opt) {
|
||||
const copied = typeof ocv === 'object'
|
||||
? Array.isArray(ocv)
|
||||
? [...ocv]
|
||||
: { ...ocv }
|
||||
: ocv;
|
||||
opt.paths.forEach((dotpath) => {
|
||||
let objRef = copied;
|
||||
const path = dotpath.split('.');
|
||||
const lastIndex = (path.length - 1).toString();
|
||||
for (const [index, key] of Object.entries(path)) {
|
||||
if (index === lastIndex) {
|
||||
delete objRef[key];
|
||||
break;
|
||||
}
|
||||
objRef = objRef[key];
|
||||
if (typeof objRef !== 'object') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
return copied;
|
||||
}
|
||||
exports.excludeObjectSync = excludeObjectSync;
|
||||
function objectContainedLogSync(ocv, options) {
|
||||
if (options && typeof ocv === 'object' && ocv !== null) {
|
||||
if (options.include && options.include.length > 0) {
|
||||
return JSON.stringify(includeObjectSync(ocv, { paths: options.include }));
|
||||
}
|
||||
if (options.exclude && options.exclude.length > 0) {
|
||||
return JSON.stringify(excludeObjectSync(ocv, { paths: options.exclude }));
|
||||
}
|
||||
}
|
||||
if (typeof ocv === 'object' && ocv !== null) {
|
||||
return JSON.stringify(ocv);
|
||||
}
|
||||
else {
|
||||
return `${ocv}`;
|
||||
}
|
||||
}
|
||||
exports.objectContainedLogSync = objectContainedLogSync;
|
||||
function getItemByPathSync(obj, path) {
|
||||
const paths = Array.isArray(path) ? path : path.split('.');
|
||||
return Object.keys(obj).includes(paths[0])
|
||||
? typeof obj[paths[0]] === 'object'
|
||||
? getItemByPathSync(obj[paths[0]], paths.slice(1))
|
||||
: obj[paths[0]]
|
||||
: undefined;
|
||||
}
|
||||
exports.getItemByPathSync = getItemByPathSync;
|
9
dist/lib/logged/class.d.ts
vendored
9
dist/lib/logged/class.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
import { ControllerOptions, ScopeOptions } from '@nestjs/common';
|
||||
export declare function LoggedInjectable(options?: ScopeOptions & {
|
||||
verbose?: boolean;
|
||||
}): (target: any) => void;
|
||||
export declare function LoggedController(): (target: any) => void;
|
||||
export declare function LoggedController(prefix: string | string[]): (target: any) => void;
|
||||
export declare function LoggedController(options: ControllerOptions & {
|
||||
verbose?: boolean;
|
||||
}): (target: any) => void;
|
50
dist/lib/logged/class.js
vendored
50
dist/lib/logged/class.js
vendored
@ -1,50 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedController = exports.LoggedInjectable = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const utils_1 = require("./utils");
|
||||
const methods_1 = require("./methods");
|
||||
function LoggedInjectable(options) {
|
||||
return (target) => {
|
||||
(0, utils_1.loggerInit)(target.prototype);
|
||||
const logger = target.prototype.logger;
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
methods.forEach((method) => {
|
||||
if (method !== 'constructor' &&
|
||||
typeof target.prototype[method] === 'function') {
|
||||
if (options && options.verbose)
|
||||
logger.log(`LoggedFunction applied to ${method}`);
|
||||
(0, methods_1.LoggedFunction)()(target.prototype, method, {
|
||||
value: target.prototype[method],
|
||||
});
|
||||
}
|
||||
});
|
||||
(0, common_1.Injectable)(options)(target);
|
||||
};
|
||||
}
|
||||
exports.LoggedInjectable = LoggedInjectable;
|
||||
function LoggedController(param) {
|
||||
return (target) => {
|
||||
(0, utils_1.loggerInit)(target.prototype);
|
||||
const logger = target.prototype.logger;
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
let verbose = typeof param === 'object' && Object.keys(param).includes('verbose')
|
||||
? param.verbose
|
||||
: false;
|
||||
methods.forEach((method) => {
|
||||
if (method !== 'constructor' &&
|
||||
typeof target.prototype[method] === 'function') {
|
||||
if (verbose) {
|
||||
const path = Reflect.getMetadata('path', target.prototype[method]);
|
||||
const httpMethod = Reflect.getMetadata('method', target.prototype[method]);
|
||||
logger.log(`LoggedRoute applied to ${method} (${utils_1.RevRequestMethod[httpMethod]} ${path})`);
|
||||
}
|
||||
(0, methods_1.LoggedRoute)()(target.prototype, method, {
|
||||
value: target.prototype[method],
|
||||
});
|
||||
}
|
||||
});
|
||||
(0, common_1.Controller)(param)(target);
|
||||
};
|
||||
}
|
||||
exports.LoggedController = LoggedController;
|
21
dist/lib/logged/index.js
vendored
21
dist/lib/logged/index.js
vendored
@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedInjectable = exports.LoggedController = void 0;
|
||||
__exportStar(require("./methods"), exports);
|
||||
var class_1 = require("./class");
|
||||
Object.defineProperty(exports, "LoggedController", { enumerable: true, get: function () { return class_1.LoggedController; } });
|
||||
Object.defineProperty(exports, "LoggedInjectable", { enumerable: true, get: function () { return class_1.LoggedInjectable; } });
|
7
dist/lib/logged/metadata.d.ts
vendored
7
dist/lib/logged/metadata.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
import { OverrideBuildOptions } from './utils';
|
||||
export declare const nestLoggedMetadata: unique symbol;
|
||||
export declare class LoggedMetadata {
|
||||
options: OverrideBuildOptions;
|
||||
constructor(options?: Partial<OverrideBuildOptions>);
|
||||
updateOption(options: Partial<OverrideBuildOptions>): void;
|
||||
}
|
20
dist/lib/logged/metadata.js
vendored
20
dist/lib/logged/metadata.js
vendored
@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedMetadata = exports.nestLoggedMetadata = void 0;
|
||||
const utils_1 = require("./utils");
|
||||
exports.nestLoggedMetadata = Symbol('nlogdec-metadata');
|
||||
class LoggedMetadata {
|
||||
constructor(options) {
|
||||
this.options = {
|
||||
...utils_1.defaultOverrideBuildOptions,
|
||||
...(options ?? {}),
|
||||
};
|
||||
}
|
||||
updateOption(options) {
|
||||
this.options = {
|
||||
...this.options,
|
||||
...options,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.LoggedMetadata = LoggedMetadata;
|
2
dist/lib/logged/methods/function.d.ts
vendored
2
dist/lib/logged/methods/function.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
export declare function LoggedFunction<F extends Array<any>, R>(options?: Partial<OverrideBuildOptions>): (_target: any, key: string, descriptor: TypedPropertyDescriptor<(...args: F) => R | Promise<R>>) => void;
|
44
dist/lib/logged/methods/function.js
vendored
44
dist/lib/logged/methods/function.js
vendored
@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedFunction = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
const metadata_1 = require("../metadata");
|
||||
const reflected_1 = require("../../reflected");
|
||||
const override_1 = require("../override");
|
||||
function LoggedFunction(options) {
|
||||
return (_target, key, descriptor) => {
|
||||
(0, utils_1.loggerInit)(_target);
|
||||
const logger = _target.logger;
|
||||
const fn = descriptor.value;
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(`LoggedFunction decorator applied to non-function property: ${key}`);
|
||||
return;
|
||||
}
|
||||
const logMetadata = Reflect.getOwnMetadata(metadata_1.nestLoggedMetadata, _target, key);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new metadata_1.LoggedMetadata(options);
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
const scopedLoggerInjectableParam = Reflect.getOwnMetadata(reflected_1.scopedLogger, _target, key);
|
||||
const loggedParams = Reflect.getOwnMetadata(reflected_1.loggedParam, _target, key);
|
||||
const returnsData = Reflect.getOwnMetadata(reflected_1.returns, fn);
|
||||
const overrideFunction = (0, override_1.overrideBuild)('function', fn, logger, {
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
||||
}, key, returnsData, newMetadata);
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
Reflect.defineMetadata(metadata_1.nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.LoggedFunction = LoggedFunction;
|
3
dist/lib/logged/methods/guard.d.ts
vendored
3
dist/lib/logged/methods/guard.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
export declare function LoggedGuard<F extends Array<any>, R>(options?: Partial<OverrideBuildOptions>): (_target: any, key: string, descriptor: TypedPropertyDescriptor<(context: ExecutionContext, ...args: F) => R>) => void;
|
43
dist/lib/logged/methods/guard.js
vendored
43
dist/lib/logged/methods/guard.js
vendored
@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedGuard = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
const metadata_1 = require("../metadata");
|
||||
const reflected_1 = require("../../reflected");
|
||||
const override_1 = require("../override");
|
||||
function LoggedGuard(options) {
|
||||
return (_target, key, descriptor) => {
|
||||
(0, utils_1.loggerInit)(_target);
|
||||
const logger = _target.logger;
|
||||
const fn = descriptor.value;
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(`LoggedGuard decorator applied to non-function property: ${key}`);
|
||||
return;
|
||||
}
|
||||
const logMetadata = Reflect.getOwnMetadata(metadata_1.nestLoggedMetadata, _target, key);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new metadata_1.LoggedMetadata(options);
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
const scopedLoggerInjectableParam = Reflect.getOwnMetadata(reflected_1.scopedLogger, _target, key);
|
||||
const returnsData = Reflect.getOwnMetadata(reflected_1.returns, fn);
|
||||
const overrideFunction = (0, override_1.overrideBuild)('guard', fn, logger, {
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
}, _target.constructor.name, returnsData, newMetadata);
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
Reflect.defineMetadata(metadata_1.nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.LoggedGuard = LoggedGuard;
|
13
dist/lib/logged/methods/index.js
vendored
13
dist/lib/logged/methods/index.js
vendored
@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedMiddleware = exports.LoggedInterceptor = exports.LoggedGuard = exports.LoggedRoute = exports.LoggedFunction = void 0;
|
||||
var function_1 = require("./function");
|
||||
Object.defineProperty(exports, "LoggedFunction", { enumerable: true, get: function () { return function_1.LoggedFunction; } });
|
||||
var route_1 = require("./route");
|
||||
Object.defineProperty(exports, "LoggedRoute", { enumerable: true, get: function () { return route_1.LoggedRoute; } });
|
||||
var guard_1 = require("./guard");
|
||||
Object.defineProperty(exports, "LoggedGuard", { enumerable: true, get: function () { return guard_1.LoggedGuard; } });
|
||||
var interceptor_1 = require("./interceptor");
|
||||
Object.defineProperty(exports, "LoggedInterceptor", { enumerable: true, get: function () { return interceptor_1.LoggedInterceptor; } });
|
||||
var middleware_1 = require("./middleware");
|
||||
Object.defineProperty(exports, "LoggedMiddleware", { enumerable: true, get: function () { return middleware_1.LoggedMiddleware; } });
|
3
dist/lib/logged/methods/interceptor.d.ts
vendored
3
dist/lib/logged/methods/interceptor.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
export declare function LoggedInterceptor<F extends Array<any>, R>(options?: Partial<OverrideBuildOptions>): (_target: any, key: string, descriptor: TypedPropertyDescriptor<(context: ExecutionContext, ...args: F) => R>) => void;
|
43
dist/lib/logged/methods/interceptor.js
vendored
43
dist/lib/logged/methods/interceptor.js
vendored
@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedInterceptor = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
const metadata_1 = require("../metadata");
|
||||
const reflected_1 = require("../../reflected");
|
||||
const override_1 = require("../override");
|
||||
function LoggedInterceptor(options) {
|
||||
return (_target, key, descriptor) => {
|
||||
(0, utils_1.loggerInit)(_target);
|
||||
const logger = _target.logger;
|
||||
const fn = descriptor.value;
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(`LoggedInterceptor decorator applied to non-function property: ${key}`);
|
||||
return;
|
||||
}
|
||||
const logMetadata = Reflect.getOwnMetadata(metadata_1.nestLoggedMetadata, _target, key);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new metadata_1.LoggedMetadata(options);
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
const scopedLoggerInjectableParam = Reflect.getOwnMetadata(reflected_1.scopedLogger, _target, key);
|
||||
const returnsData = Reflect.getOwnMetadata(reflected_1.returns, fn);
|
||||
const overrideFunction = (0, override_1.overrideBuild)('interceptor', fn, logger, {
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
}, _target.constructor.name, returnsData, newMetadata);
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
Reflect.defineMetadata(metadata_1.nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.LoggedInterceptor = LoggedInterceptor;
|
2
dist/lib/logged/methods/middleware.d.ts
vendored
2
dist/lib/logged/methods/middleware.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
export declare function LoggedMiddleware<F extends Array<any>, R>(options?: Partial<OverrideBuildOptions>): (_target: any, key: string, descriptor: TypedPropertyDescriptor<(...args: F) => R>) => void;
|
43
dist/lib/logged/methods/middleware.js
vendored
43
dist/lib/logged/methods/middleware.js
vendored
@ -1,43 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedMiddleware = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
const metadata_1 = require("../metadata");
|
||||
const reflected_1 = require("../../reflected");
|
||||
const override_1 = require("../override");
|
||||
function LoggedMiddleware(options) {
|
||||
return (_target, key, descriptor) => {
|
||||
(0, utils_1.loggerInit)(_target);
|
||||
const logger = _target.logger;
|
||||
const fn = descriptor.value;
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(`LoggedMiddleware decorator applied to non-function property: ${key}`);
|
||||
return;
|
||||
}
|
||||
const logMetadata = Reflect.getOwnMetadata(metadata_1.nestLoggedMetadata, _target, key);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new metadata_1.LoggedMetadata(options);
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
const scopedLoggerInjectableParam = Reflect.getOwnMetadata(reflected_1.scopedLogger, _target, key);
|
||||
const returnsData = Reflect.getOwnMetadata(reflected_1.returns, fn);
|
||||
const overrideFunction = (0, override_1.overrideBuild)('middleware', fn, logger, {
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
}, _target.constructor.name, returnsData, newMetadata);
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
Reflect.defineMetadata(metadata_1.nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.LoggedMiddleware = LoggedMiddleware;
|
2
dist/lib/logged/methods/route.d.ts
vendored
2
dist/lib/logged/methods/route.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
export declare function LoggedRoute<F extends Array<any>, R>(route?: string, options?: Partial<OverrideBuildOptions>): (_target: any, key: string, descriptor: TypedPropertyDescriptor<(...args: F) => R>) => void;
|
52
dist/lib/logged/methods/route.js
vendored
52
dist/lib/logged/methods/route.js
vendored
@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LoggedRoute = void 0;
|
||||
const utils_1 = require("../utils");
|
||||
const metadata_1 = require("../metadata");
|
||||
const reflected_1 = require("../../reflected");
|
||||
const override_1 = require("../override");
|
||||
const nest_1 = require("../../internals/nest");
|
||||
function LoggedRoute(route, options) {
|
||||
return (_target, key, descriptor) => {
|
||||
(0, utils_1.loggerInit)(_target);
|
||||
const logger = _target.logger;
|
||||
const fn = descriptor.value;
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(`LoggedRoute decorator applied to non-function property: ${key}`);
|
||||
return;
|
||||
}
|
||||
const logMetadata = Reflect.getOwnMetadata(metadata_1.nestLoggedMetadata, _target, key);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new metadata_1.LoggedMetadata(options);
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
const httpPath = Reflect.getMetadata('path', fn);
|
||||
const httpMethod = Reflect.getMetadata('method', fn);
|
||||
const fullRoute = `${_target.constructor.name}::${route ?? httpPath}[${utils_1.RevRequestMethod[httpMethod]}]`;
|
||||
const scopedLoggerInjectableParam = Reflect.getOwnMetadata(reflected_1.scopedLogger, _target, key);
|
||||
// if @InjectLogger exists, fake nestjs as it is @Req()
|
||||
if (scopedLoggerInjectableParam !== undefined) {
|
||||
(0, nest_1.createRouteParamDecorator)(0)()(_target, key, scopedLoggerInjectableParam);
|
||||
}
|
||||
const loggedParams = Reflect.getOwnMetadata(reflected_1.loggedParam, _target, key);
|
||||
const returnsData = Reflect.getOwnMetadata(reflected_1.returns, fn);
|
||||
const overrideFunction = (0, override_1.overrideBuild)('route', fn, logger, {
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
||||
}, key, returnsData, newMetadata, fullRoute);
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
Reflect.defineMetadata(metadata_1.nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.LoggedRoute = LoggedRoute;
|
10
dist/lib/logged/override.d.ts
vendored
10
dist/lib/logged/override.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { LoggedParamReflectData, ReturnsReflectData } from '../reflected';
|
||||
import { LoggedMetadata } from './metadata';
|
||||
interface FunctionMetadata {
|
||||
scopedLoggerInjectableParam?: number;
|
||||
loggedParams?: LoggedParamReflectData[];
|
||||
}
|
||||
export declare function overrideBuild<F extends Array<any>, R>(type: 'route', originalFunction: (...args: F) => R, baseLogger: Logger, metadatas: FunctionMetadata, key: string, returnsData: ReturnsReflectData[] | string | true, logged: LoggedMetadata, route: string): (...args: F) => R;
|
||||
export declare function overrideBuild<F extends Array<any>, R>(type: 'function' | 'guard' | 'interceptor' | 'middleware', originalFunction: (...args: F) => R, baseLogger: Logger, metadatas: FunctionMetadata, key: string, returnsData: ReturnsReflectData[] | string | true, logged: LoggedMetadata): (...args: F) => R;
|
||||
export {};
|
152
dist/lib/logged/override.js
vendored
152
dist/lib/logged/override.js
vendored
@ -1,152 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.overrideBuild = void 0;
|
||||
const utils_1 = require("./utils");
|
||||
const utils_2 = require("../internals/utils");
|
||||
const logger_1 = require("../logger");
|
||||
function overrideBuild(type, originalFunction, baseLogger, metadatas, key, returnsData, logged, route) {
|
||||
return function (...args) {
|
||||
// Creating ScopedLogger
|
||||
let injectedLogger = baseLogger;
|
||||
if (typeof metadatas.scopedLoggerInjectableParam !== 'undefined') {
|
||||
if (type === 'function') {
|
||||
if (args.length <= metadatas.scopedLoggerInjectableParam ||
|
||||
!(args[metadatas.scopedLoggerInjectableParam] instanceof logger_1.ScopedLogger)) {
|
||||
args[metadatas.scopedLoggerInjectableParam] = logger_1.ScopedLogger.fromRoot(baseLogger, key);
|
||||
}
|
||||
else {
|
||||
args[metadatas.scopedLoggerInjectableParam] = logger_1.ScopedLogger.fromSuper(baseLogger, args[metadatas.scopedLoggerInjectableParam], key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// special, can access to request object
|
||||
if (type === 'guard' || type === 'interceptor') {
|
||||
// args[0] == ExecutionContext
|
||||
const ctx = args[0];
|
||||
if (ctx.getType() !== 'http') {
|
||||
injectedLogger.error('Cannot inject logger: Request type is not http');
|
||||
}
|
||||
else {
|
||||
let req = ctx.switchToHttp().getRequest();
|
||||
if (req[utils_1.REQUEST_LOG_ID] === undefined) {
|
||||
req[utils_1.REQUEST_LOG_ID] = logger_1.ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = logger_1.ScopedLogger.fromRoot(baseLogger, key, req[utils_1.REQUEST_LOG_ID]);
|
||||
}
|
||||
}
|
||||
else if (type === 'middleware') {
|
||||
let req = args[0];
|
||||
if (req[utils_1.REQUEST_LOG_ID] === undefined) {
|
||||
req[utils_1.REQUEST_LOG_ID] = logger_1.ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = logger_1.ScopedLogger.fromRoot(baseLogger, key, req[utils_1.REQUEST_LOG_ID]);
|
||||
}
|
||||
else if (type === 'route') {
|
||||
// args[metadatas.scopedLoggerInjectableParam] is now Request object, thanks to code in @LoggedRoute!!!!
|
||||
let req = args[metadatas.scopedLoggerInjectableParam];
|
||||
if (req[utils_1.REQUEST_LOG_ID] === undefined) {
|
||||
req[utils_1.REQUEST_LOG_ID] = logger_1.ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = logger_1.ScopedLogger.fromRoot(baseLogger, key, req[utils_1.REQUEST_LOG_ID]);
|
||||
}
|
||||
}
|
||||
injectedLogger = args[metadatas.scopedLoggerInjectableParam];
|
||||
}
|
||||
// If this is ExecutionContext based function (e.g. Guard, Interceptor) get Request from Context
|
||||
if (type === 'guard' || type === 'interceptor') {
|
||||
const context = args[0];
|
||||
if (context.getType() === 'http') {
|
||||
const req = context.switchToHttp().getRequest();
|
||||
route = /* supporting FastifyRequest */ req.raw ? req.raw.url : req.url;
|
||||
}
|
||||
}
|
||||
// Start Log
|
||||
if (logged.options.callLogLevel !== 'skip') {
|
||||
const callLogIdentifyMessage = type === 'middleware' ||
|
||||
type === 'guard' ||
|
||||
type === 'interceptor' ||
|
||||
type === 'route'
|
||||
? (0, utils_1.createCallLogIdentifyMessage)('HIT', type, key, route)
|
||||
: (0, utils_1.createCallLogIdentifyMessage)('HIT', type, key);
|
||||
injectedLogger[logged.options.callLogLevel](`${callLogIdentifyMessage} ${metadatas.loggedParams && metadatas.loggedParams.length > 0
|
||||
? 'WITH ' +
|
||||
metadatas.loggedParams
|
||||
.map(({ name, index, include, exclude }) => name +
|
||||
'=' +
|
||||
(0, utils_2.objectContainedLogSync)(args[index], {
|
||||
include,
|
||||
exclude,
|
||||
}))
|
||||
.join(', ')
|
||||
: ''}`);
|
||||
}
|
||||
try {
|
||||
const r = originalFunction.call(this, ...args); // Try to call original function
|
||||
// Return Log
|
||||
if (logged.options.returnLogLevel !== 'skip') {
|
||||
if (originalFunction.constructor.name === 'AsyncFunction' ||
|
||||
(r && typeof r === 'object' && typeof r['then'] === 'function')) {
|
||||
return r['then']((r) => {
|
||||
const resultLogged = Array.isArray(returnsData)
|
||||
? typeof r === 'object' && r !== null
|
||||
? 'WITH ' +
|
||||
returnsData
|
||||
.map(({ name, path }) => {
|
||||
const value = (0, utils_2.getItemByPathSync)(r, path);
|
||||
return value !== undefined ? `${name}=${value}` : '';
|
||||
})
|
||||
.filter((v) => v.length > 0)
|
||||
.join(', ')
|
||||
: ''
|
||||
: typeof returnsData === 'string'
|
||||
? 'WITH ' + returnsData + '=' + typeof r === 'object'
|
||||
? JSON.stringify(r)
|
||||
: r
|
||||
: returnsData
|
||||
? typeof r === 'object'
|
||||
? 'WITH ' + JSON.stringify(r)
|
||||
: 'WITH ' + r
|
||||
: '';
|
||||
injectedLogger[logged.options.returnLogLevel](`${(0, utils_1.createCallLogIdentifyMessage)('RETURNED', type, key, route)} ${resultLogged}`);
|
||||
return r;
|
||||
});
|
||||
}
|
||||
else {
|
||||
const resultLogged = Array.isArray(returnsData)
|
||||
? typeof r === 'object' && r !== null
|
||||
? 'WITH ' +
|
||||
returnsData
|
||||
.map(({ name, path }) => {
|
||||
const value = (0, utils_2.getItemByPathSync)(r, path);
|
||||
return value !== undefined ? `${name}=${value}` : '';
|
||||
})
|
||||
.filter((v) => v.length > 0)
|
||||
.join(', ')
|
||||
: ''
|
||||
: typeof returnsData === 'string'
|
||||
? 'WITH ' + returnsData + '=' + typeof r === 'object'
|
||||
? JSON.stringify(r)
|
||||
: r
|
||||
: returnsData
|
||||
? typeof r === 'object'
|
||||
? 'WITH ' + JSON.stringify(r)
|
||||
: 'WITH ' + r
|
||||
: '';
|
||||
injectedLogger[logged.options.returnLogLevel](`${(0, utils_1.createCallLogIdentifyMessage)('RETURNED', type, key, route)} ${resultLogged}`);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Error Log
|
||||
if (logged.options.errorLogLevel !== 'skip') {
|
||||
injectedLogger[logged.options.errorLogLevel](`${(0, utils_1.createCallLogIdentifyMessage)('ERROR', type, key, route)} ${e}`);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.overrideBuild = overrideBuild;
|
18
dist/lib/logged/utils.d.ts
vendored
18
dist/lib/logged/utils.d.ts
vendored
@ -1,18 +0,0 @@
|
||||
import { LogLevel } from '@nestjs/common';
|
||||
export declare const RevRequestMethod: string[];
|
||||
export declare function loggerInit(_target: any): void;
|
||||
export type BuildType = 'route' | 'function' | 'guard' | 'interceptor' | 'middleware';
|
||||
export declare function createCallLogIdentifyMessage(message: 'HIT' | 'RETURNED' | 'ERROR', type: BuildType, key?: string, route?: string): string;
|
||||
export declare const REQUEST_LOG_ID = "__nestlogged_request_log_id__";
|
||||
export interface OverrideBuildOptions {
|
||||
callLogLevel: LogLevel | 'skip';
|
||||
returnLogLevel: LogLevel | 'skip';
|
||||
errorLogLevel: LogLevel | 'skip';
|
||||
/** @deprecated use `callLogLevel: 'skip'` instead */
|
||||
skipCallLog: boolean;
|
||||
/** @deprecated use `returnLogLevel: 'skip'` instead */
|
||||
skipReturnLog: boolean;
|
||||
/** @deprecated use `errorLogLevel: 'skip'` instead */
|
||||
skipErrorLog: boolean;
|
||||
}
|
||||
export declare const defaultOverrideBuildOptions: OverrideBuildOptions;
|
57
dist/lib/logged/utils.js
vendored
57
dist/lib/logged/utils.js
vendored
@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.defaultOverrideBuildOptions = exports.REQUEST_LOG_ID = exports.createCallLogIdentifyMessage = exports.loggerInit = exports.RevRequestMethod = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
exports.RevRequestMethod = [
|
||||
'GET',
|
||||
'POST',
|
||||
'PUT',
|
||||
'DELETE',
|
||||
'PATCH',
|
||||
'ALL',
|
||||
'OPTIONS',
|
||||
'HEAD',
|
||||
'SEARCH',
|
||||
];
|
||||
function loggerInit(_target) {
|
||||
if (!Object.getOwnPropertyNames(_target).includes('logger')) {
|
||||
const newTargetLogger = new common_1.Logger(_target.constructor.name);
|
||||
newTargetLogger.log('Logger Initialized.');
|
||||
Object.defineProperty(_target, 'logger', {
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
value: newTargetLogger,
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.loggerInit = loggerInit;
|
||||
const callLogIdentifyMessageDictionary = {
|
||||
route: 'ENDPOINT',
|
||||
function: 'FUNCTION',
|
||||
guard: 'GUARD',
|
||||
interceptor: 'INTERCEPTOR',
|
||||
middleware: 'MIDDLEWARE',
|
||||
};
|
||||
function createCallLogIdentifyMessage(message, type, key, route) {
|
||||
if (message === 'ERROR')
|
||||
return `ERROR WHILE ${callLogIdentifyMessageDictionary[type]} ${key} (${route}): `;
|
||||
if (type === 'guard' ||
|
||||
type === 'interceptor' ||
|
||||
type === 'middleware' ||
|
||||
type === 'route')
|
||||
return `${message} ${callLogIdentifyMessageDictionary[type]} ${key} (${route})`;
|
||||
if (type === 'function')
|
||||
return `${message} ${callLogIdentifyMessageDictionary[type]} ${key}`;
|
||||
return `${message} ${callLogIdentifyMessageDictionary[type]}`;
|
||||
}
|
||||
exports.createCallLogIdentifyMessage = createCallLogIdentifyMessage;
|
||||
exports.REQUEST_LOG_ID = '__nestlogged_request_log_id__';
|
||||
exports.defaultOverrideBuildOptions = {
|
||||
callLogLevel: 'log',
|
||||
returnLogLevel: 'log',
|
||||
errorLogLevel: 'error',
|
||||
skipCallLog: false,
|
||||
skipReturnLog: false,
|
||||
skipErrorLog: false,
|
||||
};
|
17
dist/lib/logger.d.ts
vendored
17
dist/lib/logger.d.ts
vendored
@ -1,17 +0,0 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
export declare class ScopedLogger extends Logger {
|
||||
private logger;
|
||||
private scope;
|
||||
private scopeId;
|
||||
constructor(logger: Logger, scope: string[], scopeId?: string);
|
||||
private scopedLog;
|
||||
debug: (message: string) => void;
|
||||
log: (message: string) => void;
|
||||
warn: (message: string) => void;
|
||||
verbose: (message: string) => void;
|
||||
error: (message: string) => void;
|
||||
fatal: (message: string) => void;
|
||||
static fromSuper(baseLogger: Logger, logger: ScopedLogger, scope: string): ScopedLogger;
|
||||
static fromRoot(logger: Logger, scope: string, scopeId?: string): ScopedLogger;
|
||||
static createScopeId(): string;
|
||||
}
|
35
dist/lib/logger.js
vendored
35
dist/lib/logger.js
vendored
@ -1,35 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ScopedLogger = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const hyperid = require("hyperid");
|
||||
const createId = hyperid({ fixedLength: true });
|
||||
class ScopedLogger extends common_1.Logger {
|
||||
constructor(logger, scope, scopeId = createId()) {
|
||||
super();
|
||||
this.logger = logger;
|
||||
this.scope = scope;
|
||||
this.scopeId = scopeId;
|
||||
this.debug = this.scopedLog('debug');
|
||||
this.log = this.scopedLog('log');
|
||||
this.warn = this.scopedLog('warn');
|
||||
this.verbose = this.scopedLog('verbose');
|
||||
this.error = this.scopedLog('error');
|
||||
this.fatal = this.scopedLog('fatal');
|
||||
}
|
||||
scopedLog(method) {
|
||||
return (message) => {
|
||||
this.logger[method](`${this.scopeId ? `(ID ${this.scopeId}) | ` : ''}${this.scope.join(' -> ')}: ${message}`);
|
||||
};
|
||||
}
|
||||
static fromSuper(baseLogger, logger, scope) {
|
||||
return new ScopedLogger(baseLogger, [...logger.scope, scope], logger.scopeId);
|
||||
}
|
||||
static fromRoot(logger, scope, scopeId) {
|
||||
return new ScopedLogger(logger, [scope], scopeId);
|
||||
}
|
||||
static createScopeId() {
|
||||
return createId();
|
||||
}
|
||||
}
|
||||
exports.ScopedLogger = ScopedLogger;
|
45
dist/lib/reflected.d.ts
vendored
45
dist/lib/reflected.d.ts
vendored
@ -1,45 +0,0 @@
|
||||
import { Type, PipeTransform } from './internals/nest';
|
||||
export type Path = string | string[];
|
||||
export type Paths = Path[];
|
||||
export interface IncludeExcludePath {
|
||||
includePath?: Paths;
|
||||
excludePath?: Paths;
|
||||
}
|
||||
export interface LoggedParamReflectData {
|
||||
name: string;
|
||||
index: number;
|
||||
include?: string[];
|
||||
exclude?: string[];
|
||||
}
|
||||
export interface ScopeKeyReflectData {
|
||||
name: string;
|
||||
index: number;
|
||||
path?: string[];
|
||||
priority?: number;
|
||||
}
|
||||
export interface ReturnsReflectData {
|
||||
name: string;
|
||||
path: string;
|
||||
}
|
||||
export declare const scopedLogger: unique symbol;
|
||||
export declare const loggedParam: unique symbol;
|
||||
export declare const returns: unique symbol;
|
||||
export declare function InjectLogger(target: any, propertyKey: string | symbol, parameterIndex: number): void;
|
||||
type ParameterDecoratorType = (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
||||
type LoggedParamReturns = (name: string, options?: IncludeExcludePath) => ParameterDecoratorType;
|
||||
export declare const Logged: LoggedParamReturns;
|
||||
type Pipe = Type<PipeTransform> | PipeTransform;
|
||||
export declare function LoggedParam(): LoggedParamReturns;
|
||||
export declare function LoggedParam(...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedParam(property: string, ...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedQuery(): LoggedParamReturns;
|
||||
export declare function LoggedQuery(...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedQuery(property: string, ...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedBody(): LoggedParamReturns;
|
||||
export declare function LoggedBody(...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedBody(property: string, ...pipes: Pipe[]): LoggedParamReturns;
|
||||
export declare function LoggedHeaders(property?: string): LoggedParamReturns;
|
||||
export declare function Returns<F extends Array<any>, R>(namePaths?: {
|
||||
[name: string]: string;
|
||||
} | string): (_target: any, _key: string | symbol, descriptor: TypedPropertyDescriptor<(...args: F) => Promise<R> | R>) => void;
|
||||
export {};
|
76
dist/lib/reflected.js
vendored
76
dist/lib/reflected.js
vendored
@ -1,76 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Returns = exports.LoggedHeaders = exports.LoggedBody = exports.LoggedQuery = exports.LoggedParam = exports.Logged = exports.InjectLogger = exports.returns = exports.loggedParam = exports.scopedLogger = void 0;
|
||||
const nest_1 = require("./internals/nest");
|
||||
exports.scopedLogger = Symbol('nlogdec-scopedLogger');
|
||||
exports.loggedParam = Symbol('nlogdec-loggedParam');
|
||||
exports.returns = Symbol('nlogdec-returns');
|
||||
function InjectLogger(target, propertyKey, parameterIndex) {
|
||||
Reflect.defineMetadata(exports.scopedLogger, parameterIndex, target, propertyKey);
|
||||
}
|
||||
exports.InjectLogger = InjectLogger;
|
||||
function createLoggedFunctionParam(name, options) {
|
||||
return (target, propertyKey, parameterIndex) => {
|
||||
const existingLoggedParams = Reflect.getOwnMetadata(exports.loggedParam, target, propertyKey) || [];
|
||||
existingLoggedParams.push({
|
||||
name,
|
||||
index: parameterIndex,
|
||||
// If path is provided in string[] type, convert it to string path because it is used in string type
|
||||
include: options &&
|
||||
options.includePath &&
|
||||
options.includePath.map((v) => (Array.isArray(v) ? v.join('.') : v)),
|
||||
exclude: options &&
|
||||
options.excludePath &&
|
||||
options.excludePath.map((v) => (Array.isArray(v) ? v.join('.') : v)),
|
||||
});
|
||||
Reflect.defineMetadata(exports.loggedParam, existingLoggedParams, target, propertyKey);
|
||||
};
|
||||
}
|
||||
const Logged = (name, options) => createLoggedFunctionParam(name, options);
|
||||
exports.Logged = Logged;
|
||||
function LoggedParam(property, ...pipes) {
|
||||
return (name, options) => {
|
||||
return (target, propertyKey, parameterIndex) => {
|
||||
(0, nest_1.createPipesRouteParamDecorator)(nest_1.RouteParamtypes.PARAM)(property, ...pipes)(target, propertyKey, parameterIndex);
|
||||
createLoggedFunctionParam(name, options)(target, propertyKey, parameterIndex);
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.LoggedParam = LoggedParam;
|
||||
function LoggedQuery(property, ...pipes) {
|
||||
return (name, options) => {
|
||||
return (target, propertyKey, parameterIndex) => {
|
||||
(0, nest_1.createPipesRouteParamDecorator)(nest_1.RouteParamtypes.QUERY)(property, ...pipes)(target, propertyKey, parameterIndex);
|
||||
createLoggedFunctionParam(name, options)(target, propertyKey, parameterIndex);
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.LoggedQuery = LoggedQuery;
|
||||
function LoggedBody(property, ...pipes) {
|
||||
return (name, options) => {
|
||||
return (target, propertyKey, parameterIndex) => {
|
||||
(0, nest_1.createPipesRouteParamDecorator)(nest_1.RouteParamtypes.BODY)(property, ...pipes)(target, propertyKey, parameterIndex);
|
||||
createLoggedFunctionParam(name, options)(target, propertyKey, parameterIndex);
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.LoggedBody = LoggedBody;
|
||||
function LoggedHeaders(property) {
|
||||
return (name, options) => {
|
||||
return (target, propertyKey, parameterIndex) => {
|
||||
(0, nest_1.createRouteParamDecorator)(nest_1.RouteParamtypes.HEADERS)(property)(target, propertyKey, parameterIndex);
|
||||
createLoggedFunctionParam(name, options)(target, propertyKey, parameterIndex);
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.LoggedHeaders = LoggedHeaders;
|
||||
function Returns(namePaths) {
|
||||
return (_target, _key, descriptor) => {
|
||||
Reflect.defineMetadata(exports.returns, namePaths
|
||||
? typeof namePaths === 'string'
|
||||
? namePaths
|
||||
: Object.entries(namePaths).reduce((prev, curr) => [...prev, { name: curr[0], path: curr[1] }], [])
|
||||
: true, descriptor.value);
|
||||
};
|
||||
}
|
||||
exports.Returns = Returns;
|
2
dist/lib/utils.d.ts
vendored
2
dist/lib/utils.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
import { ScopedLogger } from './logger';
|
||||
export declare function getRequestLogger(functionName: string, req: any): ScopedLogger;
|
11
dist/lib/utils.js
vendored
11
dist/lib/utils.js
vendored
@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRequestLogger = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
const logger_1 = require("./logger");
|
||||
const utils_1 = require("./logged/utils");
|
||||
const logger = new common_1.Logger();
|
||||
function getRequestLogger(functionName, req) {
|
||||
return new logger_1.ScopedLogger(logger, [functionName], req[utils_1.REQUEST_LOG_ID]);
|
||||
}
|
||||
exports.getRequestLogger = getRequestLogger;
|
173
dist/yarn.lock
vendored
173
dist/yarn.lock
vendored
@ -1,173 +0,0 @@
|
||||
# This file is generated by running "yarn install" inside your project.
|
||||
# Manual changes might be lost - proceed with caution!
|
||||
|
||||
__metadata:
|
||||
version: 8
|
||||
cacheKey: 10c0
|
||||
|
||||
"@lukeed/csprng@npm:^1.0.0":
|
||||
version: 1.1.0
|
||||
resolution: "@lukeed/csprng@npm:1.1.0"
|
||||
checksum: 10c0/5d6dcf478af732972083ab2889c294b57f1028fa13c2c240d7a4aaa079c2c75df7ef0dcbdda5419147fc6704b4adf96b2de92f1a9a72ac21c6350c4014fffe6c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@nestjs/common@npm:^10.2.8":
|
||||
version: 10.4.15
|
||||
resolution: "@nestjs/common@npm:10.4.15"
|
||||
dependencies:
|
||||
iterare: "npm:1.2.1"
|
||||
tslib: "npm:2.8.1"
|
||||
uid: "npm:2.0.2"
|
||||
peerDependencies:
|
||||
class-transformer: "*"
|
||||
class-validator: "*"
|
||||
reflect-metadata: ^0.1.12 || ^0.2.0
|
||||
rxjs: ^7.1.0
|
||||
peerDependenciesMeta:
|
||||
class-transformer:
|
||||
optional: true
|
||||
class-validator:
|
||||
optional: true
|
||||
checksum: 10c0/9566993fd3f805df2be632f5a16ca90d81b0deeb50e1e7cde4a49d4948c0d8d7db58b42ded70f35061e95e91a40d2adcd9e19cb2771090114eb737f62d2ea4c6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:^20.9.1":
|
||||
version: 20.17.24
|
||||
resolution: "@types/node@npm:20.17.24"
|
||||
dependencies:
|
||||
undici-types: "npm:~6.19.2"
|
||||
checksum: 10c0/2a39ce4c4cd4588a05b2a485cc0a1407cbea608dd1ab03e36add59d61712718d95c84b492ca5190753f0be2bce748aeeb0f2a1412e712775462befe3820b3ff9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"base64-js@npm:^1.3.1":
|
||||
version: 1.5.1
|
||||
resolution: "base64-js@npm:1.5.1"
|
||||
checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"buffer@npm:^5.2.1":
|
||||
version: 5.7.1
|
||||
resolution: "buffer@npm:5.7.1"
|
||||
dependencies:
|
||||
base64-js: "npm:^1.3.1"
|
||||
ieee754: "npm:^1.1.13"
|
||||
checksum: 10c0/27cac81cff434ed2876058d72e7c4789d11ff1120ef32c9de48f59eab58179b66710c488987d295ae89a228f835fc66d088652dffeb8e3ba8659f80eb091d55e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"hyperid@npm:^3.1.1":
|
||||
version: 3.3.0
|
||||
resolution: "hyperid@npm:3.3.0"
|
||||
dependencies:
|
||||
buffer: "npm:^5.2.1"
|
||||
uuid: "npm:^8.3.2"
|
||||
uuid-parse: "npm:^1.1.0"
|
||||
checksum: 10c0/709dafd2a25e21086a2d881adb3436a16eafd28692ebd967829ca1d5f10adf001925feb23b6aadfee464ea313d851e7ba7a5452869aaf6cde15e9149793a09e0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ieee754@npm:^1.1.13":
|
||||
version: 1.2.1
|
||||
resolution: "ieee754@npm:1.2.1"
|
||||
checksum: 10c0/b0782ef5e0935b9f12883a2e2aa37baa75da6e66ce6515c168697b42160807d9330de9a32ec1ed73149aea02e0d822e572bca6f1e22bdcbd2149e13b050b17bb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"iterare@npm:1.2.1":
|
||||
version: 1.2.1
|
||||
resolution: "iterare@npm:1.2.1"
|
||||
checksum: 10c0/02667d486e3e83ead028ba8484d927498c2ceab7e8c6a69dd881fd02abc4114f00b13abb36b592252fbb578b6e6f99ca1dfc2835408b9158c9a112a9964f453f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"nestlogged@workspace:.":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "nestlogged@workspace:."
|
||||
dependencies:
|
||||
"@nestjs/common": "npm:^10.2.8"
|
||||
"@types/node": "npm:^20.9.1"
|
||||
hyperid: "npm:^3.1.1"
|
||||
reflect-metadata: "npm:^0.1.13"
|
||||
rxjs: "npm:^7.8.1"
|
||||
typescript: "npm:^5.2.2"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"reflect-metadata@npm:^0.1.13":
|
||||
version: 0.1.14
|
||||
resolution: "reflect-metadata@npm:0.1.14"
|
||||
checksum: 10c0/3a6190c7f6cb224f26a012d11f9e329360c01c1945e2cbefea23976a8bacf9db6b794aeb5bf18adcb673c448a234fbc06fc41853c00a6c206b30f0777ecf019e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rxjs@npm:^7.8.1":
|
||||
version: 7.8.2
|
||||
resolution: "rxjs@npm:7.8.2"
|
||||
dependencies:
|
||||
tslib: "npm:^2.1.0"
|
||||
checksum: 10c0/1fcd33d2066ada98ba8f21fcbbcaee9f0b271de1d38dc7f4e256bfbc6ffcdde68c8bfb69093de7eeb46f24b1fb820620bf0223706cff26b4ab99a7ff7b2e2c45
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:2.8.1, tslib@npm:^2.1.0":
|
||||
version: 2.8.1
|
||||
resolution: "tslib@npm:2.8.1"
|
||||
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@npm:^5.2.2":
|
||||
version: 5.8.2
|
||||
resolution: "typescript@npm:5.8.2"
|
||||
bin:
|
||||
tsc: bin/tsc
|
||||
tsserver: bin/tsserver
|
||||
checksum: 10c0/5c4f6fbf1c6389b6928fe7b8fcd5dc73bb2d58cd4e3883f1d774ed5bd83b151cbac6b7ecf11723de56d4676daeba8713894b1e9af56174f2f9780ae7848ec3c6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@patch:typescript@npm%3A^5.2.2#optional!builtin<compat/typescript>":
|
||||
version: 5.8.2
|
||||
resolution: "typescript@patch:typescript@npm%3A5.8.2#optional!builtin<compat/typescript>::version=5.8.2&hash=5786d5"
|
||||
bin:
|
||||
tsc: bin/tsc
|
||||
tsserver: bin/tsserver
|
||||
checksum: 10c0/5448a08e595cc558ab321e49d4cac64fb43d1fa106584f6ff9a8d8e592111b373a995a1d5c7f3046211c8a37201eb6d0f1566f15cdb7a62a5e3be01d087848e2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uid@npm:2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "uid@npm:2.0.2"
|
||||
dependencies:
|
||||
"@lukeed/csprng": "npm:^1.0.0"
|
||||
checksum: 10c0/e9d02d0562c74e74b5a2519e586db9d7f8204978e476cddd191ee1a9efb85efafdbab2dbf3fc3dde0f5da01fd9da161f37d604dabf513447fd2c03d008f1324c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"undici-types@npm:~6.19.2":
|
||||
version: 6.19.8
|
||||
resolution: "undici-types@npm:6.19.8"
|
||||
checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uuid-parse@npm:^1.1.0":
|
||||
version: 1.1.0
|
||||
resolution: "uuid-parse@npm:1.1.0"
|
||||
checksum: 10c0/513d5b0407b8929c54d452e8e286a1f6f00d40a2ebf6607fc7297b9caa40eee35230dcc4ce3f178f84d89704e8147e24d1a33d680a8afb7e12a5700714db7f51
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uuid@npm:^8.3.2":
|
||||
version: 8.3.2
|
||||
resolution: "uuid@npm:8.3.2"
|
||||
bin:
|
||||
uuid: dist/bin/uuid
|
||||
checksum: 10c0/bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
|
||||
languageName: node
|
||||
linkType: hard
|
21
package.json
21
package.json
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "nestlogged",
|
||||
"name": "nestlogged-root",
|
||||
"version": "3.2.3",
|
||||
"description": "A NestJS Logger Decorator Library",
|
||||
"main": "./dist/lib/index.js",
|
||||
@ -7,26 +7,19 @@
|
||||
"author": "Shinwoo PARK",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.12",
|
||||
"hyperid": "^3.1.1",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.9.1",
|
||||
"prettier": "^3.5.3",
|
||||
"rimraf": "^5.0.5",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
"docs": "cp ./README.md ./dist/README.md",
|
||||
"build": "rimraf ./dist/lib && tsc --project tsconfig.build.json",
|
||||
"up": "yarn docs && yarn build && yarn npm publish dist",
|
||||
"up:beta": "yarn docs && yarn build && yarn npm publish dist --tag beta",
|
||||
"test": "ts-node ./src/test/index.ts",
|
||||
"format": "prettier --write \"./src/**/*.ts\""
|
||||
"build": "rimraf packages/nestlogged/lib && yarn workspace nestlogged tsc",
|
||||
"fastify:build": "rimraf packages/nestlogged-fastify/lib && yarn workspace nestlogged-fastify tsc",
|
||||
"format": "prettier --write \"./packages/**/*.ts\""
|
||||
},
|
||||
"packageManager": "yarn@4.7.0+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9"
|
||||
}
|
||||
|
3
packages/nestlogged-fastify/.npmignore
Normal file
3
packages/nestlogged-fastify/.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
src/
|
||||
tsconfig.build.json
|
||||
tsconfig.json
|
22
packages/nestlogged-fastify/README.md
Normal file
22
packages/nestlogged-fastify/README.md
Normal file
@ -0,0 +1,22 @@
|
||||
# NestJS Logging Decorators
|
||||
|
||||
This package provides some decorations to make NestJS logging simpler.
|
||||
It only uses Logger provided by @nestjs/common package and some dependencies required for nestjs.
|
||||
|
||||
This package wraps [`nestlogged`](https://www.npmjs.com/package/nestlogged), but with additional decorator to fix bugs with Fastify.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install nestlogged-fastify
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```sh
|
||||
yarn add nestlogged-fastify
|
||||
```
|
||||
|
||||
## More Info
|
||||
|
||||
[Wiki](https://nestlogged.psw.kr)
|
23
packages/nestlogged-fastify/package.json
Normal file
23
packages/nestlogged-fastify/package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "nestlogged-fastify",
|
||||
"version": "3.2.5",
|
||||
"description": "A NestJS Logger Decorator Library With Fastify Support",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"repository": "https://git.psw.kr/p-sw/nestlogged",
|
||||
"author": "Shinwoo PARK",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^11.0.12",
|
||||
"fastify": "^5.2.2",
|
||||
"hyperid": "^3.1.1",
|
||||
"nestlogged": "^3.2.5",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"packageManager": "yarn@4.7.0+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9"
|
||||
}
|
20
packages/nestlogged-fastify/src/index.ts
Normal file
20
packages/nestlogged-fastify/src/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
export {
|
||||
ScopedLogger,
|
||||
InjectLogger,
|
||||
LoggedParam,
|
||||
LoggedHeaders,
|
||||
LoggedBody,
|
||||
LoggedQuery,
|
||||
Logged,
|
||||
Returns,
|
||||
getRequestLogger
|
||||
} from 'nestlogged';
|
||||
export {
|
||||
LoggedRoute,
|
||||
LoggedFunction,
|
||||
LoggedController,
|
||||
LoggedInjectable,
|
||||
LoggedGuard,
|
||||
LoggedInterceptor,
|
||||
LoggedMiddleware,
|
||||
} from './logged'
|
@ -4,17 +4,14 @@ import {
|
||||
ControllerOptions,
|
||||
ScopeOptions,
|
||||
} from '@nestjs/common';
|
||||
import { loggerInit, RevRequestMethod } from './utils';
|
||||
import { RevRequestMethod } from 'nestlogged/lib/logged/utils';
|
||||
import { LoggedRoute, LoggedFunction } from './methods';
|
||||
import { logger } from 'nestlogged/lib/internals/utils';
|
||||
|
||||
export function LoggedInjectable(
|
||||
options?: ScopeOptions & { verbose?: boolean },
|
||||
) {
|
||||
return (target: any) => {
|
||||
loggerInit(target.prototype);
|
||||
|
||||
const logger = target.prototype.logger;
|
||||
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
|
||||
methods.forEach((method) => {
|
||||
@ -23,7 +20,7 @@ export function LoggedInjectable(
|
||||
typeof target.prototype[method] === 'function'
|
||||
) {
|
||||
if (options && options.verbose)
|
||||
logger.log(`LoggedFunction applied to ${method}`);
|
||||
logger.log(`LoggedFunction applied to ${target.name}.${method}`);
|
||||
LoggedFunction()(target.prototype, method, {
|
||||
value: target.prototype[method],
|
||||
});
|
||||
@ -44,10 +41,6 @@ export function LoggedController(
|
||||
|
||||
export function LoggedController(param?: any): (target: any) => void {
|
||||
return (target: any) => {
|
||||
loggerInit(target.prototype);
|
||||
|
||||
const logger = target.prototype.logger;
|
||||
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
|
||||
let verbose =
|
||||
@ -67,7 +60,7 @@ export function LoggedController(param?: any): (target: any) => void {
|
||||
target.prototype[method],
|
||||
);
|
||||
logger.log(
|
||||
`LoggedRoute applied to ${method} (${RevRequestMethod[httpMethod]} ${path})`,
|
||||
`LoggedRoute applied to ${target.name}.${method} (${RevRequestMethod[httpMethod]} ${path})`,
|
||||
);
|
||||
}
|
||||
LoggedRoute()(target.prototype, method, {
|
85
packages/nestlogged-fastify/src/logged/methods/function.ts
Normal file
85
packages/nestlogged-fastify/src/logged/methods/function.ts
Normal file
@ -0,0 +1,85 @@
|
||||
import { OverrideBuildOptions } from 'nestlogged/lib/logged/utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import {
|
||||
loggedParam,
|
||||
scopedLogger,
|
||||
returns,
|
||||
ReturnsReflectData,
|
||||
LoggedParamReflectData,
|
||||
} from 'nestlogged/lib/reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
|
||||
export function LoggedFunction<F extends Array<any>, R>(
|
||||
options?: Partial<OverrideBuildOptions>,
|
||||
) {
|
||||
return (
|
||||
_target: any,
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<(...args: F) => R | Promise<R>>,
|
||||
) => {
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
console.warn(
|
||||
`LoggedFunction decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const logMetadata: LoggedMetadata | undefined = Reflect.getOwnMetadata(
|
||||
nestLoggedMetadata,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new LoggedMetadata(options);
|
||||
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
|
||||
const scopedLoggerInjectableParam: number = Reflect.getOwnMetadata(
|
||||
scopedLogger,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const loggedParams: LoggedParamReflectData[] = Reflect.getOwnMetadata(
|
||||
loggedParam,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const returnsData: ReturnsReflectData[] | true = Reflect.getOwnMetadata(
|
||||
returns,
|
||||
fn,
|
||||
);
|
||||
|
||||
const overrideFunction = overrideBuild(
|
||||
'function',
|
||||
fn,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
||||
},
|
||||
key,
|
||||
returnsData,
|
||||
newMetadata,
|
||||
);
|
||||
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
|
||||
Reflect.defineMetadata(nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
76
packages/nestlogged-fastify/src/logged/methods/guard.ts
Normal file
76
packages/nestlogged-fastify/src/logged/methods/guard.ts
Normal file
@ -0,0 +1,76 @@
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
import { OverrideBuildOptions } from 'nestlogged/lib/logged/utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from 'nestlogged/lib/reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
|
||||
export function LoggedGuard<F extends Array<any>, R>(
|
||||
options?: Partial<OverrideBuildOptions>,
|
||||
) {
|
||||
return (
|
||||
_target: any,
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<
|
||||
(context: ExecutionContext, ...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
console.warn(
|
||||
`LoggedGuard decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const logMetadata: LoggedMetadata | undefined = Reflect.getOwnMetadata(
|
||||
nestLoggedMetadata,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new LoggedMetadata(options);
|
||||
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
|
||||
const scopedLoggerInjectableParam: number = Reflect.getOwnMetadata(
|
||||
scopedLogger,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const returnsData: ReturnsReflectData[] | true = Reflect.getOwnMetadata(
|
||||
returns,
|
||||
fn,
|
||||
);
|
||||
|
||||
const overrideFunction = overrideBuild(
|
||||
'guard',
|
||||
fn,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
},
|
||||
_target.constructor.name,
|
||||
returnsData,
|
||||
newMetadata,
|
||||
);
|
||||
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
|
||||
Reflect.defineMetadata(nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
import { OverrideBuildOptions } from 'nestlogged/lib/logged/utils';
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from 'nestlogged/lib/reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
|
||||
export function LoggedInterceptor<F extends Array<any>, R>(
|
||||
options?: Partial<OverrideBuildOptions>,
|
||||
) {
|
||||
return (
|
||||
_target: any,
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<
|
||||
(context: ExecutionContext, ...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
console.warn(
|
||||
`LoggedInterceptor decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const logMetadata: LoggedMetadata | undefined = Reflect.getOwnMetadata(
|
||||
nestLoggedMetadata,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new LoggedMetadata(options);
|
||||
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
|
||||
const scopedLoggerInjectableParam: number = Reflect.getOwnMetadata(
|
||||
scopedLogger,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const returnsData: ReturnsReflectData[] | true = Reflect.getOwnMetadata(
|
||||
returns,
|
||||
fn,
|
||||
);
|
||||
|
||||
const overrideFunction = overrideBuild(
|
||||
'interceptor',
|
||||
fn,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
},
|
||||
_target.constructor.name,
|
||||
returnsData,
|
||||
newMetadata,
|
||||
);
|
||||
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
|
||||
Reflect.defineMetadata(nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
75
packages/nestlogged-fastify/src/logged/methods/middleware.ts
Normal file
75
packages/nestlogged-fastify/src/logged/methods/middleware.ts
Normal file
@ -0,0 +1,75 @@
|
||||
import { OverrideBuildOptions } from 'nestlogged/lib/logged/utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from 'nestlogged/lib/reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
|
||||
export function LoggedMiddleware<F extends Array<any>, R>(
|
||||
options?: Partial<OverrideBuildOptions>,
|
||||
) {
|
||||
return (
|
||||
_target: any,
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<
|
||||
(...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
console.warn(
|
||||
`LoggedMiddleware decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const logMetadata: LoggedMetadata | undefined = Reflect.getOwnMetadata(
|
||||
nestLoggedMetadata,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new LoggedMetadata(options);
|
||||
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
|
||||
const scopedLoggerInjectableParam: number = Reflect.getOwnMetadata(
|
||||
scopedLogger,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const returnsData: ReturnsReflectData[] | true = Reflect.getOwnMetadata(
|
||||
returns,
|
||||
fn,
|
||||
);
|
||||
|
||||
const overrideFunction = overrideBuild(
|
||||
'middleware',
|
||||
fn,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
||||
},
|
||||
_target.constructor.name,
|
||||
returnsData,
|
||||
newMetadata,
|
||||
);
|
||||
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
|
||||
Reflect.defineMetadata(nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
100
packages/nestlogged-fastify/src/logged/methods/route.ts
Normal file
100
packages/nestlogged-fastify/src/logged/methods/route.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import { RequestMethod } from '@nestjs/common';
|
||||
import { OverrideBuildOptions, RevRequestMethod } from 'nestlogged/lib/logged/utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import {
|
||||
loggedParam,
|
||||
scopedLogger,
|
||||
returns,
|
||||
ReturnsReflectData,
|
||||
LoggedParamReflectData,
|
||||
} from 'nestlogged/lib/reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
import { createRouteParamDecorator } from 'nestlogged/lib/internals/nest';
|
||||
|
||||
export function LoggedRoute<F extends Array<any>, R>(
|
||||
route?: string,
|
||||
options?: Partial<OverrideBuildOptions>,
|
||||
) {
|
||||
return (
|
||||
_target: any,
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<(...args: F) => R>,
|
||||
) => {
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
console.warn(
|
||||
`LoggedRoute decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const logMetadata: LoggedMetadata | undefined = Reflect.getOwnMetadata(
|
||||
nestLoggedMetadata,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
if (logMetadata) {
|
||||
// already applied, override instead
|
||||
logMetadata.updateOption(options);
|
||||
return;
|
||||
}
|
||||
const newMetadata = new LoggedMetadata(options);
|
||||
|
||||
const all = Reflect.getMetadataKeys(fn).map((k) => [
|
||||
k,
|
||||
Reflect.getMetadata(k, fn),
|
||||
]);
|
||||
|
||||
const httpPath: string = Reflect.getMetadata('path', fn);
|
||||
const httpMethod: RequestMethod = Reflect.getMetadata('method', fn);
|
||||
|
||||
const fullRoute = `${_target.constructor.name}::${route ?? httpPath}[${
|
||||
RevRequestMethod[httpMethod]
|
||||
}]`;
|
||||
|
||||
const scopedLoggerInjectableParam: number = Reflect.getOwnMetadata(
|
||||
scopedLogger,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
// if @InjectLogger exists, fake nestjs as it is @Req()
|
||||
if (scopedLoggerInjectableParam !== undefined) {
|
||||
createRouteParamDecorator(0)()(_target, key, scopedLoggerInjectableParam);
|
||||
}
|
||||
|
||||
const loggedParams: LoggedParamReflectData[] = Reflect.getOwnMetadata(
|
||||
loggedParam,
|
||||
_target,
|
||||
key,
|
||||
);
|
||||
|
||||
const returnsData: ReturnsReflectData[] | true = Reflect.getOwnMetadata(
|
||||
returns,
|
||||
fn,
|
||||
);
|
||||
|
||||
const overrideFunction = overrideBuild(
|
||||
'route',
|
||||
fn,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
||||
},
|
||||
key,
|
||||
returnsData,
|
||||
newMetadata,
|
||||
fullRoute,
|
||||
);
|
||||
|
||||
_target[key] = overrideFunction;
|
||||
descriptor.value = overrideFunction;
|
||||
|
||||
Reflect.defineMetadata(nestLoggedMetadata, newMetadata, _target, key);
|
||||
all.forEach(([k, v]) => {
|
||||
Reflect.defineMetadata(k, v, _target[key]);
|
||||
Reflect.defineMetadata(k, v, descriptor.value);
|
||||
});
|
||||
};
|
||||
}
|
236
packages/nestlogged-fastify/src/logged/override.ts
Normal file
236
packages/nestlogged-fastify/src/logged/override.ts
Normal file
@ -0,0 +1,236 @@
|
||||
import { Logger, ExecutionContext } from '@nestjs/common';
|
||||
import { LoggedParamReflectData, ReturnsReflectData } from 'nestlogged/lib/reflected';
|
||||
import { LoggedMetadata } from 'nestlogged/lib/logged/metadata';
|
||||
import {
|
||||
BuildType,
|
||||
REQUEST_LOG_ID,
|
||||
createCallLogIdentifyMessage,
|
||||
loggerInit,
|
||||
} from 'nestlogged/lib/logged/utils';
|
||||
import { objectContainedLogSync, getItemByPathSync } from 'nestlogged/lib/internals/utils';
|
||||
import { ScopedLogger } from 'nestlogged/lib/logger';
|
||||
import { kRequestPayloadStream } from 'fastify/lib/symbols';
|
||||
|
||||
interface FunctionMetadata {
|
||||
scopedLoggerInjectableParam?: number;
|
||||
loggedParams?: LoggedParamReflectData[];
|
||||
}
|
||||
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: 'route',
|
||||
originalFunction: (...args: F) => R,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
logged: LoggedMetadata,
|
||||
route: string,
|
||||
): (...args: F) => R;
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: 'function' | 'guard' | 'interceptor' | 'middleware',
|
||||
originalFunction: (...args: F) => R,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
logged: LoggedMetadata,
|
||||
): (...args: F) => R;
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: BuildType,
|
||||
originalFunction: (...args: F) => R,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
logged: LoggedMetadata,
|
||||
route?: string,
|
||||
): (...args: F) => R {
|
||||
return function (...args: F): R {
|
||||
const baseLogger: Logger = loggerInit(_target);
|
||||
|
||||
// Creating ScopedLogger
|
||||
let injectedLogger: Logger = baseLogger;
|
||||
if (typeof metadatas.scopedLoggerInjectableParam !== 'undefined') {
|
||||
if (type === 'function') {
|
||||
if (
|
||||
args.length <= metadatas.scopedLoggerInjectableParam ||
|
||||
!(args[metadatas.scopedLoggerInjectableParam] instanceof ScopedLogger)
|
||||
) {
|
||||
args[metadatas.scopedLoggerInjectableParam] = ScopedLogger.fromRoot(
|
||||
baseLogger,
|
||||
key,
|
||||
);
|
||||
} else {
|
||||
args[metadatas.scopedLoggerInjectableParam] = ScopedLogger.fromSuper(
|
||||
baseLogger,
|
||||
args[metadatas.scopedLoggerInjectableParam],
|
||||
key,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// special, can access to request object
|
||||
if (type === 'guard' || type === 'interceptor') {
|
||||
// args[0] == ExecutionContext
|
||||
const ctx = args[0] as ExecutionContext;
|
||||
if (ctx.getType() !== 'http') {
|
||||
injectedLogger.error(
|
||||
'Cannot inject logger: Request type is not http',
|
||||
);
|
||||
} else {
|
||||
let req = ctx.switchToHttp().getRequest()[kRequestPayloadStream];
|
||||
if (req[REQUEST_LOG_ID] === undefined) {
|
||||
req[REQUEST_LOG_ID] = ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = ScopedLogger.fromRoot(
|
||||
baseLogger,
|
||||
key,
|
||||
req[REQUEST_LOG_ID],
|
||||
);
|
||||
}
|
||||
} else if (type === 'middleware') {
|
||||
let req = args[0];
|
||||
if (req[REQUEST_LOG_ID] === undefined) {
|
||||
req[REQUEST_LOG_ID] = ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = ScopedLogger.fromRoot(
|
||||
baseLogger,
|
||||
key,
|
||||
req[REQUEST_LOG_ID],
|
||||
);
|
||||
} else if (type === 'route') {
|
||||
// args[metadatas.scopedLoggerInjectableParam] is now Request object, thanks to code in @LoggedRoute!!!!
|
||||
let req = args[metadatas.scopedLoggerInjectableParam][kRequestPayloadStream];
|
||||
if (req[REQUEST_LOG_ID] === undefined) {
|
||||
req[REQUEST_LOG_ID] = ScopedLogger.createScopeId();
|
||||
}
|
||||
args[metadatas.scopedLoggerInjectableParam] = ScopedLogger.fromRoot(
|
||||
baseLogger,
|
||||
key,
|
||||
req[REQUEST_LOG_ID],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
injectedLogger = args[metadatas.scopedLoggerInjectableParam];
|
||||
}
|
||||
|
||||
// If this is ExecutionContext based function (e.g. Guard, Interceptor) get Request from Context
|
||||
if (type === 'guard' || type === 'interceptor') {
|
||||
const context = args[0] as ExecutionContext;
|
||||
if (context.getType() === 'http') {
|
||||
const req = context.switchToHttp().getRequest();
|
||||
route = req.raw.url;
|
||||
}
|
||||
} else if (type === 'middleware') {
|
||||
const req = args[0];
|
||||
route = req.originalUrl;
|
||||
}
|
||||
|
||||
// Start Log
|
||||
if (logged.options.callLogLevel !== 'skip') {
|
||||
const callLogIdentifyMessage =
|
||||
type === 'middleware' ||
|
||||
type === 'guard' ||
|
||||
type === 'interceptor' ||
|
||||
type === 'route'
|
||||
? createCallLogIdentifyMessage('HIT', type, key, route)
|
||||
: createCallLogIdentifyMessage('HIT', type, key);
|
||||
injectedLogger[logged.options.callLogLevel](
|
||||
`${callLogIdentifyMessage} ${
|
||||
metadatas.loggedParams && metadatas.loggedParams.length > 0
|
||||
? 'WITH ' +
|
||||
metadatas.loggedParams
|
||||
.map(
|
||||
({ name, index, include, exclude }) =>
|
||||
name +
|
||||
'=' +
|
||||
objectContainedLogSync(args[index], {
|
||||
include,
|
||||
exclude,
|
||||
}),
|
||||
)
|
||||
.join(', ')
|
||||
: ''
|
||||
}`,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const r: R = originalFunction.call(this, ...args); // Try to call original function
|
||||
|
||||
// Return Log
|
||||
if (logged.options.returnLogLevel !== 'skip') {
|
||||
if (
|
||||
originalFunction.constructor.name === 'AsyncFunction' ||
|
||||
(r && typeof r === 'object' && typeof r['then'] === 'function')
|
||||
) {
|
||||
return r['then']((r: any) => {
|
||||
const resultLogged = Array.isArray(returnsData)
|
||||
? typeof r === 'object' && r !== null
|
||||
? 'WITH ' +
|
||||
returnsData
|
||||
.map(({ name, path }) => {
|
||||
const value = getItemByPathSync(r, path);
|
||||
|
||||
return value !== undefined ? `${name}=${value}` : '';
|
||||
})
|
||||
.filter((v) => v.length > 0)
|
||||
.join(', ')
|
||||
: ''
|
||||
: typeof returnsData === 'string'
|
||||
? 'WITH ' + returnsData + '=' + typeof r === 'object'
|
||||
? JSON.stringify(r)
|
||||
: r
|
||||
: returnsData
|
||||
? typeof r === 'object'
|
||||
? 'WITH ' + JSON.stringify(r)
|
||||
: 'WITH ' + r
|
||||
: '';
|
||||
|
||||
injectedLogger[logged.options.returnLogLevel](
|
||||
`${createCallLogIdentifyMessage('RETURNED', type, key, route)} ${resultLogged}`,
|
||||
);
|
||||
return r;
|
||||
});
|
||||
} else {
|
||||
const resultLogged = Array.isArray(returnsData)
|
||||
? typeof r === 'object' && r !== null
|
||||
? 'WITH ' +
|
||||
returnsData
|
||||
.map(({ name, path }) => {
|
||||
const value = getItemByPathSync(r, path);
|
||||
|
||||
return value !== undefined ? `${name}=${value}` : '';
|
||||
})
|
||||
.filter((v) => v.length > 0)
|
||||
.join(', ')
|
||||
: ''
|
||||
: typeof returnsData === 'string'
|
||||
? 'WITH ' + returnsData + '=' + typeof r === 'object'
|
||||
? JSON.stringify(r)
|
||||
: r
|
||||
: returnsData
|
||||
? typeof r === 'object'
|
||||
? 'WITH ' + JSON.stringify(r)
|
||||
: 'WITH ' + r
|
||||
: '';
|
||||
|
||||
injectedLogger[logged.options.returnLogLevel](
|
||||
`${createCallLogIdentifyMessage('RETURNED', type, key, route)} ${resultLogged}`,
|
||||
);
|
||||
return r;
|
||||
}
|
||||
} else {
|
||||
return r;
|
||||
}
|
||||
} catch (e) {
|
||||
// Error Log
|
||||
if (logged.options.errorLogLevel !== 'skip') {
|
||||
injectedLogger[logged.options.errorLogLevel](
|
||||
`${createCallLogIdentifyMessage('ERROR', type, key, route)} ${e}`,
|
||||
);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"lib",
|
||||
"src/test",
|
||||
],
|
||||
"compilerOptions": {
|
@ -3,7 +3,7 @@
|
||||
"module": "commonjs",
|
||||
"target": "ES2021",
|
||||
"sourceMap": false,
|
||||
"outDir": "./dist/lib",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": false,
|
||||
@ -12,6 +12,6 @@
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"lib",
|
||||
],
|
||||
}
|
3
packages/nestlogged/.npmignore
Normal file
3
packages/nestlogged/.npmignore
Normal file
@ -0,0 +1,3 @@
|
||||
src/
|
||||
tsconfig.build.json
|
||||
tsconfig.json
|
@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "nestlogged",
|
||||
"version": "3.2.3",
|
||||
"version": "3.2.5",
|
||||
"description": "A NestJS Logger Decorator Library",
|
||||
"main": "lib/index.js",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
"repository": "https://git.psw.kr/p-sw/nestlogged",
|
||||
"author": "Shinwoo PARK",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^10.2.8",
|
||||
"@nestjs/common": "^11.0.12",
|
||||
"hyperid": "^3.1.1",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.1"
|
||||
@ -16,10 +17,5 @@
|
||||
"@types/node": "^20.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"keywords": [
|
||||
"nest",
|
||||
"nestjs",
|
||||
"log",
|
||||
"logging"
|
||||
]
|
||||
"packageManager": "yarn@4.7.0+sha512.5a0afa1d4c1d844b3447ee3319633797bcd6385d9a44be07993ae52ff4facabccafb4af5dcd1c2f9a94ac113e5e9ff56f6130431905884414229e284e37bb7c9"
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import { Logger } from "@nestjs/common";
|
||||
|
||||
export const notIncludedSymbol = Symbol('notIncluded');
|
||||
|
||||
export function includeObjectSync(
|
||||
@ -95,3 +97,5 @@ export function getItemByPathSync(obj: object, path: string | string[]) {
|
||||
: obj[paths[0]]
|
||||
: undefined;
|
||||
}
|
||||
|
||||
export const logger = new Logger('NestLogged');
|
74
packages/nestlogged/src/logged/class.ts
Normal file
74
packages/nestlogged/src/logged/class.ts
Normal file
@ -0,0 +1,74 @@
|
||||
import {
|
||||
Injectable,
|
||||
Controller,
|
||||
ControllerOptions,
|
||||
ScopeOptions,
|
||||
} from '@nestjs/common';
|
||||
import { RevRequestMethod } from './utils';
|
||||
import { LoggedRoute, LoggedFunction } from './methods';
|
||||
import { logger } from '../internals/utils';
|
||||
|
||||
export function LoggedInjectable(
|
||||
options?: ScopeOptions & { verbose?: boolean },
|
||||
) {
|
||||
return (target: any) => {
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
|
||||
methods.forEach((method) => {
|
||||
if (
|
||||
method !== 'constructor' &&
|
||||
typeof target.prototype[method] === 'function'
|
||||
) {
|
||||
if (options && options.verbose)
|
||||
logger.log(`LoggedFunction applied to ${target.name}.${method}`);
|
||||
LoggedFunction()(target.prototype, method, {
|
||||
value: target.prototype[method],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Injectable(options)(target);
|
||||
};
|
||||
}
|
||||
|
||||
export function LoggedController(): (target: any) => void;
|
||||
export function LoggedController(
|
||||
prefix: string | string[],
|
||||
): (target: any) => void;
|
||||
export function LoggedController(
|
||||
options: ControllerOptions & { verbose?: boolean },
|
||||
): (target: any) => void;
|
||||
|
||||
export function LoggedController(param?: any): (target: any) => void {
|
||||
return (target: any) => {
|
||||
const methods = Object.getOwnPropertyNames(target.prototype);
|
||||
|
||||
let verbose =
|
||||
typeof param === 'object' && Object.keys(param).includes('verbose')
|
||||
? param.verbose
|
||||
: false;
|
||||
|
||||
methods.forEach((method) => {
|
||||
if (
|
||||
method !== 'constructor' &&
|
||||
typeof target.prototype[method] === 'function'
|
||||
) {
|
||||
if (verbose) {
|
||||
const path = Reflect.getMetadata('path', target.prototype[method]);
|
||||
const httpMethod = Reflect.getMetadata(
|
||||
'method',
|
||||
target.prototype[method],
|
||||
);
|
||||
console.log(
|
||||
`LoggedRoute applied to ${target.name}.${method} (${RevRequestMethod[httpMethod]} ${path})`,
|
||||
);
|
||||
}
|
||||
LoggedRoute()(target.prototype, method, {
|
||||
value: target.prototype[method],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Controller(param)(target);
|
||||
};
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { OverrideBuildOptions, loggerInit } from '../utils';
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from '../metadata';
|
||||
import {
|
||||
loggedParam,
|
||||
@ -18,14 +17,10 @@ export function LoggedFunction<F extends Array<any>, R>(
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<(...args: F) => R | Promise<R>>,
|
||||
) => {
|
||||
loggerInit(_target);
|
||||
|
||||
const logger: Logger = _target.logger;
|
||||
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
`LoggedFunction decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
@ -68,7 +63,7 @@ export function LoggedFunction<F extends Array<any>, R>(
|
||||
const overrideFunction = overrideBuild(
|
||||
'function',
|
||||
fn,
|
||||
logger,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
@ -1,5 +1,5 @@
|
||||
import { ExecutionContext, Logger } from '@nestjs/common';
|
||||
import { OverrideBuildOptions, loggerInit } from '../utils';
|
||||
import { ExecutionContext } from '@nestjs/common';
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from '../metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from '../../reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
@ -14,14 +14,10 @@ export function LoggedGuard<F extends Array<any>, R>(
|
||||
(context: ExecutionContext, ...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
loggerInit(_target);
|
||||
|
||||
const logger: Logger = _target.logger;
|
||||
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
`LoggedGuard decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
@ -58,7 +54,7 @@ export function LoggedGuard<F extends Array<any>, R>(
|
||||
const overrideFunction = overrideBuild(
|
||||
'guard',
|
||||
fn,
|
||||
logger,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
@ -1,6 +1,5 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
import { ExecutionContext, Logger } from '@nestjs/common';
|
||||
import { loggerInit } from '../utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from '../metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from '../../reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
@ -15,14 +14,10 @@ export function LoggedInterceptor<F extends Array<any>, R>(
|
||||
(context: ExecutionContext, ...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
loggerInit(_target);
|
||||
|
||||
const logger: Logger = _target.logger;
|
||||
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
`LoggedInterceptor decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
@ -59,7 +54,7 @@ export function LoggedInterceptor<F extends Array<any>, R>(
|
||||
const overrideFunction = overrideBuild(
|
||||
'interceptor',
|
||||
fn,
|
||||
logger,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
@ -1,6 +1,4 @@
|
||||
import { OverrideBuildOptions } from '../utils';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { loggerInit } from '../utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from '../metadata';
|
||||
import { scopedLogger, returns, ReturnsReflectData } from '../../reflected';
|
||||
import { overrideBuild } from '../override';
|
||||
@ -15,14 +13,10 @@ export function LoggedMiddleware<F extends Array<any>, R>(
|
||||
(...args: F) => R
|
||||
>,
|
||||
) => {
|
||||
loggerInit(_target);
|
||||
|
||||
const logger: Logger = _target.logger;
|
||||
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
`LoggedMiddleware decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
@ -59,7 +53,7 @@ export function LoggedMiddleware<F extends Array<any>, R>(
|
||||
const overrideFunction = overrideBuild(
|
||||
'middleware',
|
||||
fn,
|
||||
logger,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams: [],
|
@ -1,5 +1,5 @@
|
||||
import { RequestMethod } from '@nestjs/common';
|
||||
import { OverrideBuildOptions, loggerInit, RevRequestMethod } from '../utils';
|
||||
import { OverrideBuildOptions, RevRequestMethod } from '../utils';
|
||||
import { LoggedMetadata, nestLoggedMetadata } from '../metadata';
|
||||
import {
|
||||
loggedParam,
|
||||
@ -20,14 +20,10 @@ export function LoggedRoute<F extends Array<any>, R>(
|
||||
key: string,
|
||||
descriptor: TypedPropertyDescriptor<(...args: F) => R>,
|
||||
) => {
|
||||
loggerInit(_target);
|
||||
|
||||
const logger = _target.logger;
|
||||
|
||||
const fn = descriptor.value;
|
||||
|
||||
if (!fn || typeof fn !== 'function') {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
`LoggedRoute decorator applied to non-function property: ${key}`,
|
||||
);
|
||||
return;
|
||||
@ -81,7 +77,7 @@ export function LoggedRoute<F extends Array<any>, R>(
|
||||
const overrideFunction = overrideBuild(
|
||||
'route',
|
||||
fn,
|
||||
logger,
|
||||
_target,
|
||||
{
|
||||
scopedLoggerInjectableParam,
|
||||
loggedParams,
|
@ -5,6 +5,7 @@ import {
|
||||
BuildType,
|
||||
REQUEST_LOG_ID,
|
||||
createCallLogIdentifyMessage,
|
||||
loggerInit,
|
||||
} from './utils';
|
||||
import { objectContainedLogSync, getItemByPathSync } from '../internals/utils';
|
||||
import { ScopedLogger } from '../logger';
|
||||
@ -17,7 +18,7 @@ interface FunctionMetadata {
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: 'route',
|
||||
originalFunction: (...args: F) => R,
|
||||
baseLogger: Logger,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
@ -27,7 +28,7 @@ export function overrideBuild<F extends Array<any>, R>(
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: 'function' | 'guard' | 'interceptor' | 'middleware',
|
||||
originalFunction: (...args: F) => R,
|
||||
baseLogger: Logger,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
@ -36,7 +37,7 @@ export function overrideBuild<F extends Array<any>, R>(
|
||||
export function overrideBuild<F extends Array<any>, R>(
|
||||
type: BuildType,
|
||||
originalFunction: (...args: F) => R,
|
||||
baseLogger: Logger,
|
||||
_target: any,
|
||||
metadatas: FunctionMetadata,
|
||||
key: string,
|
||||
returnsData: ReturnsReflectData[] | string | true,
|
||||
@ -44,6 +45,8 @@ export function overrideBuild<F extends Array<any>, R>(
|
||||
route?: string,
|
||||
): (...args: F) => R {
|
||||
return function (...args: F): R {
|
||||
const baseLogger: Logger = loggerInit(_target);
|
||||
|
||||
// Creating ScopedLogger
|
||||
let injectedLogger: Logger = baseLogger;
|
||||
if (typeof metadatas.scopedLoggerInjectableParam !== 'undefined') {
|
||||
@ -111,11 +114,11 @@ export function overrideBuild<F extends Array<any>, R>(
|
||||
}
|
||||
|
||||
// If this is ExecutionContext based function (e.g. Guard, Interceptor) get Request from Context
|
||||
if (type === 'guard' || type === 'interceptor') {
|
||||
if (type === 'guard' || type === 'interceptor' || type === 'middleware') {
|
||||
const context = args[0] as ExecutionContext;
|
||||
if (context.getType() === 'http') {
|
||||
const req = context.switchToHttp().getRequest();
|
||||
route = /* supporting FastifyRequest */ req.raw ? req.raw.url : req.url;
|
||||
route = req.url;
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ export function loggerInit(_target: any) {
|
||||
value: newTargetLogger,
|
||||
});
|
||||
}
|
||||
|
||||
return _target.logger as Logger;
|
||||
}
|
||||
|
||||
export type BuildType =
|
12
packages/nestlogged/tsconfig.build.json
Normal file
12
packages/nestlogged/tsconfig.build.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"lib",
|
||||
"src/test",
|
||||
],
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": false,
|
||||
"emitDecoratorMetadata": false,
|
||||
}
|
||||
}
|
17
packages/nestlogged/tsconfig.json
Normal file
17
packages/nestlogged/tsconfig.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ES2021",
|
||||
"sourceMap": false,
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": false,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"lib",
|
||||
],
|
||||
}
|
@ -1,402 +0,0 @@
|
||||
import { LoggedFunction, LoggedInjectable } from '../logged';
|
||||
import { ScopedLogger } from '../logger';
|
||||
import { InjectLogger, Logged, Returns } from '../reflected';
|
||||
|
||||
type TestObject = {
|
||||
a: string;
|
||||
b: { c: string; f: number };
|
||||
d: [number, string];
|
||||
e: { p: string; g: number };
|
||||
};
|
||||
|
||||
@LoggedInjectable()
|
||||
class TestService {
|
||||
public async service(paramA: string, @InjectLogger logger: ScopedLogger) {
|
||||
logger.log(`received paramA ${paramA}`);
|
||||
return paramA;
|
||||
}
|
||||
}
|
||||
|
||||
@LoggedInjectable()
|
||||
class LoggedClass {
|
||||
constructor(private service: TestService) {}
|
||||
|
||||
async testParameterLoggingWithoutInjection(@Logged('key') key: number) {
|
||||
console.log(key);
|
||||
}
|
||||
|
||||
async testMultiParameterLoggingWithoutInjection(
|
||||
@Logged('key') key: number,
|
||||
@Logged('key2') key2: string,
|
||||
) {
|
||||
console.log(key, key2);
|
||||
}
|
||||
|
||||
async testParameterLoggingWithInjection(
|
||||
@Logged('key') key: number,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(key.toString());
|
||||
}
|
||||
|
||||
async testMultiParameterLoggingWithInjection(
|
||||
@Logged('key') key: number,
|
||||
@Logged('key2') key2: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(key.toString() + key2);
|
||||
}
|
||||
|
||||
async testObjectParameterLogging(
|
||||
@Logged('key') key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
async testObjectParameterDotIncludeLogging(
|
||||
@Logged('key', { includePath: ['a', 'b.c', 'd.0', 'e'] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
async testObjectParameterArrayIncludeLogging(
|
||||
@Logged('key', { includePath: [['a'], ['b', 'c'], ['d', '0'], ['e']] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
async testObjectParameterDotExcludeLogging(
|
||||
@Logged('key', { excludePath: ['a', 'b.c', 'd.0', 'e'] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
async testObjectParameterArrayExcludeLogging(
|
||||
@Logged('key', { excludePath: [['a'], ['b', 'c'], ['d', '0'], ['e']] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@Returns({ result: 'http.result', userId: 'body.user.id' })
|
||||
async testReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return {
|
||||
http: {
|
||||
result: 'success',
|
||||
code: 200,
|
||||
},
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@Returns({ result: 'http.result', userId: 'body.user.id' })
|
||||
async testMissingReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return {
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@Returns()
|
||||
async testRawObjectReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return {
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@Returns()
|
||||
async testRawValueReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return true;
|
||||
}
|
||||
|
||||
async testLoggerRootLogging2(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('2');
|
||||
}
|
||||
|
||||
async testLoggerRootLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
await this.testLoggerRootLogging2(logger);
|
||||
}
|
||||
|
||||
testSyncLoggerRootLogging2(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('2');
|
||||
return 2;
|
||||
}
|
||||
|
||||
testSyncLoggerRootLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log(this.testSyncLoggerRootLogging2(logger).toString());
|
||||
}
|
||||
|
||||
testSyncLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('synced yay');
|
||||
}
|
||||
|
||||
async testService(@InjectLogger logger?: ScopedLogger) {
|
||||
this.service.service('A', logger);
|
||||
}
|
||||
|
||||
@LoggedFunction({ skipCallLog: true, skipReturnLog: true })
|
||||
testOptionOverriding(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('testOptionOverriding');
|
||||
}
|
||||
}
|
||||
|
||||
class LoggedMethodsClass {
|
||||
constructor(private service: TestService) {}
|
||||
|
||||
@LoggedFunction()
|
||||
async testParameterLoggingWithoutInjection(@Logged('key') key: number) {
|
||||
console.log(key);
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testMultiParameterLoggingWithoutInjection(
|
||||
@Logged('key') key: number,
|
||||
@Logged('key2') key2: string,
|
||||
) {
|
||||
console.log(key, key2);
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testParameterLoggingWithInjection(
|
||||
@Logged('key') key: number,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(key.toString());
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testMultiParameterLoggingWithInjection(
|
||||
@Logged('key') key: number,
|
||||
@Logged('key2') key2: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(key.toString() + key2);
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testObjectParameterLogging(
|
||||
@Logged('key') key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testObjectParameterDotIncludeLogging(
|
||||
@Logged('key', { includePath: ['a', 'b.c', 'd.0', 'e'] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testObjectParameterArrayIncludeLogging(
|
||||
@Logged('key', { includePath: [['a'], ['b', 'c'], ['d', '0'], ['e']] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testObjectParameterDotExcludeLogging(
|
||||
@Logged('key', { excludePath: ['a', 'b.c', 'd.0', 'e'] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testObjectParameterArrayExcludeLogging(
|
||||
@Logged('key', { excludePath: [['a'], ['b', 'c'], ['d', '0'], ['e']] })
|
||||
key: TestObject,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(JSON.stringify(key));
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
@Returns({ result: 'http.result', userId: 'body.user.id' })
|
||||
async testReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
|
||||
return {
|
||||
http: {
|
||||
result: 'success',
|
||||
code: 200,
|
||||
},
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
@Returns({ result: 'http.result', userId: 'body.user.id' })
|
||||
async testMissingReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return {
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
@Returns()
|
||||
async testRawObjectReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return {
|
||||
body: {
|
||||
user: {
|
||||
id: userId,
|
||||
name: 'tester',
|
||||
},
|
||||
secret: 'supersecret',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
@Returns()
|
||||
async testRawValueReturnLogging(
|
||||
@Logged('userId')
|
||||
userId: string,
|
||||
@InjectLogger logger?: ScopedLogger,
|
||||
) {
|
||||
logger.log(userId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testLoggerRootLogging2(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('2');
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testLoggerRootLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
await this.testLoggerRootLogging2(logger);
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
testSyncLoggerRootLogging2(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('2');
|
||||
return 2;
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
testSyncLoggerRootLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log(this.testSyncLoggerRootLogging2(logger).toString());
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
testSyncLogging(@InjectLogger logger?: ScopedLogger) {
|
||||
logger.log('synced yay');
|
||||
}
|
||||
|
||||
@LoggedFunction()
|
||||
async testService(@InjectLogger logger?: ScopedLogger) {
|
||||
this.service.service('A', logger);
|
||||
}
|
||||
}
|
||||
|
||||
// const service = new TestService();
|
||||
|
||||
/**
|
||||
* Choose Class to Test
|
||||
*/
|
||||
// const tester = new LoggedClass(service);
|
||||
// const tester = new LoggedMethodsClass(service);
|
||||
|
||||
/**
|
||||
* Choose Method to Test
|
||||
*/
|
||||
// void tester.testParameterLoggingWithoutInjection(1);
|
||||
// void tester.testMultiParameterLoggingWithoutInjection(1, "asdf");
|
||||
// void tester.testParameterLoggingWithInjection(1);
|
||||
// void tester.testMultiParameterLoggingWithInjection(1, "asdf");
|
||||
// void tester.testObjectParameterLogging(testObject);
|
||||
// void tester.testObjectParameterDotIncludeLogging(testObject);
|
||||
// void tester.testObjectParameterArrayIncludeLogging(testObject);
|
||||
// void tester.testObjectParameterDotExcludeLogging(testObject);
|
||||
// void tester.testObjectParameterArrayExcludeLogging(testObject);
|
||||
// void tester.testReturnLogging("asdf");
|
||||
// void tester.testMissingReturnLogging("asdf");
|
||||
// void tester.testRawObjectReturnLogging("asdf");
|
||||
// void tester.testRawValueReturnLogging("asdf");
|
||||
// void tester.testLoggerRootLogging();
|
||||
// tester.testSyncLoggerRootLogging();
|
||||
// tester.testSyncLogging();
|
||||
// void tester.testService();
|
||||
// tester.testOptionOverriding();
|
||||
|
||||
/**
|
||||
* Then run `yarn test`
|
||||
*/
|
508
yarn.lock
508
yarn.lock
@ -14,6 +14,59 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/ajv-compiler@npm:^4.0.0":
|
||||
version: 4.0.2
|
||||
resolution: "@fastify/ajv-compiler@npm:4.0.2"
|
||||
dependencies:
|
||||
ajv: "npm:^8.12.0"
|
||||
ajv-formats: "npm:^3.0.1"
|
||||
fast-uri: "npm:^3.0.0"
|
||||
checksum: 10c0/ca048db219cc958fb1b962f5dfc141f29e067ecb28a8dbe782bbef80ae3c920021468009cad613f0ed68db410890bb09c773ba2f33cb13e055b48c9c338bd8fa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/error@npm:^4.0.0":
|
||||
version: 4.1.0
|
||||
resolution: "@fastify/error@npm:4.1.0"
|
||||
checksum: 10c0/11215eb80ec0bd0a6333d8e939461123269cdbb2eb9ec853faee50f2b8284cbd7a826e654665ff37c120bdfc4a6e0f2f17f33f84f2255291a234b012dd129d53
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/fast-json-stringify-compiler@npm:^5.0.0":
|
||||
version: 5.0.2
|
||||
resolution: "@fastify/fast-json-stringify-compiler@npm:5.0.2"
|
||||
dependencies:
|
||||
fast-json-stringify: "npm:^6.0.0"
|
||||
checksum: 10c0/835f91cdb4911bbf50884ce60fa6937564e50f81cb134e81e251344ad7ec022ac500a54843e5167819a214828a369c996e68fbd5347965d336908b44904812e3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/forwarded@npm:^3.0.0":
|
||||
version: 3.0.0
|
||||
resolution: "@fastify/forwarded@npm:3.0.0"
|
||||
checksum: 10c0/bd139ee46c193ed9e04af2539f31fcb9e542b91917820f6cf401d5715c4c8bcccaae4a148e0ca14eeddee077ad8a3ab73e6f0f1ad769aff861fcef5f0a28e0d2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/merge-json-schemas@npm:^0.2.0":
|
||||
version: 0.2.1
|
||||
resolution: "@fastify/merge-json-schemas@npm:0.2.1"
|
||||
dependencies:
|
||||
dequal: "npm:^2.0.3"
|
||||
checksum: 10c0/dfa884a8f62d53f71de273fdcd0e501b213367767a7d8c522ae87ba6fb571b3eea85175d6e019036d7c0c5419be60305abe54899b9459f76ed5333358699efcb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@fastify/proxy-addr@npm:^5.0.0":
|
||||
version: 5.0.0
|
||||
resolution: "@fastify/proxy-addr@npm:5.0.0"
|
||||
dependencies:
|
||||
"@fastify/forwarded": "npm:^3.0.0"
|
||||
ipaddr.js: "npm:^2.1.0"
|
||||
checksum: 10c0/5a7d667480c3699015aa9bc12a47b6044106f412725d91a1b90f4a7845390c710486f05d322a895c633fb32a5ba1a17e598cb72e727337862034034443d59bcd
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@isaacs/cliui@npm:^8.0.2":
|
||||
version: 8.0.2
|
||||
resolution: "@isaacs/cliui@npm:8.0.2"
|
||||
@ -116,11 +169,18 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:^20.9.1":
|
||||
version: 20.9.1
|
||||
resolution: "@types/node@npm:20.9.1"
|
||||
version: 20.17.27
|
||||
resolution: "@types/node@npm:20.17.27"
|
||||
dependencies:
|
||||
undici-types: "npm:~5.26.4"
|
||||
checksum: 10c0/0cb52c0840fe9a2e8f988564da6823bb3141e34fef8cb7264762c851c0dac5d9ef4859db422dfa41cd1a864ad126a9bd3b588d0285bc9af6de814de3280da9b3
|
||||
undici-types: "npm:~6.19.2"
|
||||
checksum: 10c0/09f30c65e5f2a082eddf26a7ffa859bf2b77e1123829309823e7691227fd5a691b30cd3ac413d65829aa25c1eebd2f717bed80f2f8a7f83aaa6c2c3a047b3504
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"abstract-logging@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "abstract-logging@npm:2.0.1"
|
||||
checksum: 10c0/304879d9babcf6772260e5ddde632e6428e1f42f7a7a116d4689e97ad813a20e0ec2dd1e0a122f3617557f40091b9ca85735de4b48c17a2041268cb47b3f8ef1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -140,6 +200,32 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv-formats@npm:^3.0.1":
|
||||
version: 3.0.1
|
||||
resolution: "ajv-formats@npm:3.0.1"
|
||||
dependencies:
|
||||
ajv: "npm:^8.0.0"
|
||||
peerDependencies:
|
||||
ajv: ^8.0.0
|
||||
peerDependenciesMeta:
|
||||
ajv:
|
||||
optional: true
|
||||
checksum: 10c0/168d6bca1ea9f163b41c8147bae537e67bd963357a5488a1eaf3abe8baa8eec806d4e45f15b10767e6020679315c7e1e5e6803088dfb84efa2b4e9353b83dd0a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ajv@npm:^8.0.0, ajv@npm:^8.12.0":
|
||||
version: 8.17.1
|
||||
resolution: "ajv@npm:8.17.1"
|
||||
dependencies:
|
||||
fast-deep-equal: "npm:^3.1.3"
|
||||
fast-uri: "npm:^3.0.1"
|
||||
json-schema-traverse: "npm:^1.0.0"
|
||||
require-from-string: "npm:^2.0.2"
|
||||
checksum: 10c0/ec3ba10a573c6b60f94639ffc53526275917a2df6810e4ab5a6b959d87459f9ef3f00d5e7865b82677cb7d21590355b34da14d1d0b9c32d75f95a187e76fff35
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ansi-regex@npm:^5.0.1":
|
||||
version: 5.0.1
|
||||
resolution: "ansi-regex@npm:5.0.1"
|
||||
@ -177,6 +263,23 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"atomic-sleep@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "atomic-sleep@npm:1.0.0"
|
||||
checksum: 10c0/e329a6665512736a9bbb073e1761b4ec102f7926cce35037753146a9db9c8104f5044c1662e4a863576ce544fb8be27cd2be6bc8c1a40147d03f31eb1cfb6e8a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"avvio@npm:^9.0.0":
|
||||
version: 9.1.0
|
||||
resolution: "avvio@npm:9.1.0"
|
||||
dependencies:
|
||||
"@fastify/error": "npm:^4.0.0"
|
||||
fastq: "npm:^1.17.1"
|
||||
checksum: 10c0/bdc294a7e8f38e1e21f9d338d97d7240025db54f1005fc419cfe0499a35edf2276ab1fe91135739faa3a9437358ec6912d5a56f23361b061880333cb4f1c7884
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"balanced-match@npm:^1.0.0":
|
||||
version: 1.0.2
|
||||
resolution: "balanced-match@npm:1.0.2"
|
||||
@ -184,6 +287,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"base64-js@npm:^1.3.1":
|
||||
version: 1.5.1
|
||||
resolution: "base64-js@npm:1.5.1"
|
||||
checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"brace-expansion@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "brace-expansion@npm:2.0.1"
|
||||
@ -193,6 +303,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"buffer@npm:^5.2.1":
|
||||
version: 5.7.1
|
||||
resolution: "buffer@npm:5.7.1"
|
||||
dependencies:
|
||||
base64-js: "npm:^1.3.1"
|
||||
ieee754: "npm:^1.1.13"
|
||||
checksum: 10c0/27cac81cff434ed2876058d72e7c4789d11ff1120ef32c9de48f59eab58179b66710c488987d295ae89a228f835fc66d088652dffeb8e3ba8659f80eb091d55e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"color-convert@npm:^2.0.1":
|
||||
version: 2.0.1
|
||||
resolution: "color-convert@npm:2.0.1"
|
||||
@ -209,6 +329,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"cookie@npm:^1.0.1":
|
||||
version: 1.0.2
|
||||
resolution: "cookie@npm:1.0.2"
|
||||
checksum: 10c0/fd25fe79e8fbcfcaf6aa61cd081c55d144eeeba755206c058682257cb38c4bd6795c6620de3f064c740695bb65b7949ebb1db7a95e4636efb8357a335ad3f54b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"create-require@npm:^1.1.0":
|
||||
version: 1.1.1
|
||||
resolution: "create-require@npm:1.1.1"
|
||||
@ -227,6 +354,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"dequal@npm:^2.0.3":
|
||||
version: 2.0.3
|
||||
resolution: "dequal@npm:2.0.3"
|
||||
checksum: 10c0/f98860cdf58b64991ae10205137c0e97d384c3a4edc7f807603887b7c4b850af1224a33d88012009f150861cbee4fa2d322c4cc04b9313bee312e47f6ecaa888
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"diff@npm:^4.0.1":
|
||||
version: 4.0.2
|
||||
resolution: "diff@npm:4.0.2"
|
||||
@ -255,6 +389,100 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-decode-uri-component@npm:^1.0.1":
|
||||
version: 1.0.1
|
||||
resolution: "fast-decode-uri-component@npm:1.0.1"
|
||||
checksum: 10c0/039d50c2e99d64f999c3f2126c23fbf75a04a4117e218a149ca0b1d2aeb8c834b7b19d643b9d35d4eabce357189a6a94085f78cf48869e6e26cc59b036284bc3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-deep-equal@npm:^3.1.3":
|
||||
version: 3.1.3
|
||||
resolution: "fast-deep-equal@npm:3.1.3"
|
||||
checksum: 10c0/40dedc862eb8992c54579c66d914635afbec43350afbbe991235fdcb4e3a8d5af1b23ae7e79bef7d4882d0ecee06c3197488026998fb19f72dc95acff1d1b1d0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-json-stringify@npm:^6.0.0":
|
||||
version: 6.0.1
|
||||
resolution: "fast-json-stringify@npm:6.0.1"
|
||||
dependencies:
|
||||
"@fastify/merge-json-schemas": "npm:^0.2.0"
|
||||
ajv: "npm:^8.12.0"
|
||||
ajv-formats: "npm:^3.0.1"
|
||||
fast-uri: "npm:^3.0.0"
|
||||
json-schema-ref-resolver: "npm:^2.0.0"
|
||||
rfdc: "npm:^1.2.0"
|
||||
checksum: 10c0/898aecd164707bced980fef61b0480dd80a47f87674d7643a75a60e5eca346018ba2552de200260030215d89f218d9cd7f342df14eec88ed44d45c81e4aa0eb4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-querystring@npm:^1.0.0":
|
||||
version: 1.1.2
|
||||
resolution: "fast-querystring@npm:1.1.2"
|
||||
dependencies:
|
||||
fast-decode-uri-component: "npm:^1.0.1"
|
||||
checksum: 10c0/e8223273a9b199722f760f5a047a77ad049a14bd444b821502cb8218f5925e3a5fffb56b64389bca73ab2ac6f1aa7aebbe4e203e5f6e53ff5978de97c0fde4e3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-redact@npm:^3.1.1":
|
||||
version: 3.5.0
|
||||
resolution: "fast-redact@npm:3.5.0"
|
||||
checksum: 10c0/7e2ce4aad6e7535e0775bf12bd3e4f2e53d8051d8b630e0fa9e67f68cb0b0e6070d2f7a94b1d0522ef07e32f7c7cda5755e2b677a6538f1e9070ca053c42343a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-uri@npm:^3.0.0, fast-uri@npm:^3.0.1":
|
||||
version: 3.0.6
|
||||
resolution: "fast-uri@npm:3.0.6"
|
||||
checksum: 10c0/74a513c2af0584448aee71ce56005185f81239eab7a2343110e5bad50c39ad4fb19c5a6f99783ead1cac7ccaf3461a6034fda89fffa2b30b6d99b9f21c2f9d29
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fastify@npm:^5.2.2":
|
||||
version: 5.2.2
|
||||
resolution: "fastify@npm:5.2.2"
|
||||
dependencies:
|
||||
"@fastify/ajv-compiler": "npm:^4.0.0"
|
||||
"@fastify/error": "npm:^4.0.0"
|
||||
"@fastify/fast-json-stringify-compiler": "npm:^5.0.0"
|
||||
"@fastify/proxy-addr": "npm:^5.0.0"
|
||||
abstract-logging: "npm:^2.0.1"
|
||||
avvio: "npm:^9.0.0"
|
||||
fast-json-stringify: "npm:^6.0.0"
|
||||
find-my-way: "npm:^9.0.0"
|
||||
light-my-request: "npm:^6.0.0"
|
||||
pino: "npm:^9.0.0"
|
||||
process-warning: "npm:^4.0.0"
|
||||
rfdc: "npm:^1.3.1"
|
||||
secure-json-parse: "npm:^3.0.1"
|
||||
semver: "npm:^7.6.0"
|
||||
toad-cache: "npm:^3.7.0"
|
||||
checksum: 10c0/2925f6b8370f72f86c1461645cdf6895f335c30b3fca37deed70339f568e77f7d69e83656dc11994d70b239319a63615673714db3111363bd5f83a3e56424a88
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fastq@npm:^1.17.1":
|
||||
version: 1.19.1
|
||||
resolution: "fastq@npm:1.19.1"
|
||||
dependencies:
|
||||
reusify: "npm:^1.0.4"
|
||||
checksum: 10c0/ebc6e50ac7048daaeb8e64522a1ea7a26e92b3cee5cd1c7f2316cdca81ba543aa40a136b53891446ea5c3a67ec215fbaca87ad405f102dd97012f62916905630
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"find-my-way@npm:^9.0.0":
|
||||
version: 9.3.0
|
||||
resolution: "find-my-way@npm:9.3.0"
|
||||
dependencies:
|
||||
fast-deep-equal: "npm:^3.1.3"
|
||||
fast-querystring: "npm:^1.0.0"
|
||||
safe-regex2: "npm:^5.0.0"
|
||||
checksum: 10c0/f221bc0c70b2c2a6f9282fd3e0ac1911fcbb68ac718da043ddcefdec3b9d884a54d6ef1bf92e1b2ff83400e50f3c22141206a8ea3308bf0e9e37fd177843425d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"foreground-child@npm:^3.1.0":
|
||||
version: 3.1.1
|
||||
resolution: "foreground-child@npm:3.1.1"
|
||||
@ -281,12 +509,27 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"hyperid@npm:^3.1.1":
|
||||
version: 3.1.1
|
||||
resolution: "hyperid@npm:3.1.1"
|
||||
version: 3.3.0
|
||||
resolution: "hyperid@npm:3.3.0"
|
||||
dependencies:
|
||||
buffer: "npm:^5.2.1"
|
||||
uuid: "npm:^8.3.2"
|
||||
uuid-parse: "npm:^1.1.0"
|
||||
checksum: 10c0/4d8f3641e60a723ea3e4b25b25a611a8d59cb8404cc4f52ee80b9844d2261edbac35c4ab3ff70f0e1ee3712c44ad5edad26aa2f2957db88288623b71e3f61db0
|
||||
checksum: 10c0/709dafd2a25e21086a2d881adb3436a16eafd28692ebd967829ca1d5f10adf001925feb23b6aadfee464ea313d851e7ba7a5452869aaf6cde15e9149793a09e0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ieee754@npm:^1.1.13":
|
||||
version: 1.2.1
|
||||
resolution: "ieee754@npm:1.2.1"
|
||||
checksum: 10c0/b0782ef5e0935b9f12883a2e2aa37baa75da6e66ce6515c168697b42160807d9330de9a32ec1ed73149aea02e0d822e572bca6f1e22bdcbd2149e13b050b17bb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ipaddr.js@npm:^2.1.0":
|
||||
version: 2.2.0
|
||||
resolution: "ipaddr.js@npm:2.2.0"
|
||||
checksum: 10c0/e4ee875dc1bd92ac9d27e06cfd87cdb63ca786ff9fd7718f1d4f7a8ef27db6e5d516128f52d2c560408cbb75796ac2f83ead669e73507c86282d45f84c5abbb6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -324,6 +567,33 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"json-schema-ref-resolver@npm:^2.0.0":
|
||||
version: 2.0.1
|
||||
resolution: "json-schema-ref-resolver@npm:2.0.1"
|
||||
dependencies:
|
||||
dequal: "npm:^2.0.3"
|
||||
checksum: 10c0/3ea894d79dd176b4ef31f1a3b7b335447b854780f2bc49af2918de0502d3eabad1889232a7a72c37f1c7ca429acc2eaad940ca5fd25f8ead044d5fecb00e0378
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"json-schema-traverse@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "json-schema-traverse@npm:1.0.0"
|
||||
checksum: 10c0/71e30015d7f3d6dc1c316d6298047c8ef98a06d31ad064919976583eb61e1018a60a0067338f0f79cabc00d84af3fcc489bd48ce8a46ea165d9541ba17fb30c6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"light-my-request@npm:^6.0.0":
|
||||
version: 6.6.0
|
||||
resolution: "light-my-request@npm:6.6.0"
|
||||
dependencies:
|
||||
cookie: "npm:^1.0.1"
|
||||
process-warning: "npm:^4.0.0"
|
||||
set-cookie-parser: "npm:^2.6.0"
|
||||
checksum: 10c0/1440853cd3822ab83fbb1be4456099082dec8e9e3a4ea35c9d8d7d17a7ab98c83ad0a4c39a73a8c2b31b9ca70c57506e5b7a929495c149463ca0daca0d90dc6f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lru-cache@npm:^6.0.0":
|
||||
version: 6.0.0
|
||||
resolution: "lru-cache@npm:6.0.0"
|
||||
@ -365,22 +635,52 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"nestlogged@workspace:.":
|
||||
"nestlogged-fastify@workspace:packages/nestlogged-fastify":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "nestlogged@workspace:."
|
||||
resolution: "nestlogged-fastify@workspace:packages/nestlogged-fastify"
|
||||
dependencies:
|
||||
"@nestjs/common": "npm:^11.0.12"
|
||||
"@types/node": "npm:^20.9.1"
|
||||
fastify: "npm:^5.2.2"
|
||||
hyperid: "npm:^3.1.1"
|
||||
prettier: "npm:^3.5.3"
|
||||
nestlogged: "npm:^3.2.5"
|
||||
reflect-metadata: "npm:^0.1.13"
|
||||
rimraf: "npm:^5.0.5"
|
||||
rxjs: "npm:^7.8.1"
|
||||
typescript: "npm:^5.2.2"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"nestlogged-root@workspace:.":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "nestlogged-root@workspace:."
|
||||
dependencies:
|
||||
prettier: "npm:^3.5.3"
|
||||
rimraf: "npm:^5.0.5"
|
||||
ts-node: "npm:^10.9.1"
|
||||
typescript: "npm:^5.2.2"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"nestlogged@npm:^3.2.5, nestlogged@workspace:packages/nestlogged":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "nestlogged@workspace:packages/nestlogged"
|
||||
dependencies:
|
||||
"@nestjs/common": "npm:^11.0.12"
|
||||
"@types/node": "npm:^20.9.1"
|
||||
hyperid: "npm:^3.1.1"
|
||||
reflect-metadata: "npm:^0.1.13"
|
||||
rxjs: "npm:^7.8.1"
|
||||
typescript: "npm:^5.2.2"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"on-exit-leak-free@npm:^2.1.0":
|
||||
version: 2.1.2
|
||||
resolution: "on-exit-leak-free@npm:2.1.2"
|
||||
checksum: 10c0/faea2e1c9d696ecee919026c32be8d6a633a7ac1240b3b87e944a380e8a11dc9c95c4a1f8fb0568de7ab8db3823e790f12bda45296b1d111e341aad3922a0570
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-key@npm:^3.1.0":
|
||||
version: 3.1.1
|
||||
resolution: "path-key@npm:3.1.1"
|
||||
@ -398,6 +698,43 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pino-abstract-transport@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "pino-abstract-transport@npm:2.0.0"
|
||||
dependencies:
|
||||
split2: "npm:^4.0.0"
|
||||
checksum: 10c0/02c05b8f2ffce0d7c774c8e588f61e8b77de8ccb5f8125afd4a7325c9ea0e6af7fb78168999657712ae843e4462bb70ac550dfd6284f930ee57f17f486f25a9f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pino-std-serializers@npm:^7.0.0":
|
||||
version: 7.0.0
|
||||
resolution: "pino-std-serializers@npm:7.0.0"
|
||||
checksum: 10c0/73e694d542e8de94445a03a98396cf383306de41fd75ecc07085d57ed7a57896198508a0dec6eefad8d701044af21eb27253ccc352586a03cf0d4a0bd25b4133
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pino@npm:^9.0.0":
|
||||
version: 9.6.0
|
||||
resolution: "pino@npm:9.6.0"
|
||||
dependencies:
|
||||
atomic-sleep: "npm:^1.0.0"
|
||||
fast-redact: "npm:^3.1.1"
|
||||
on-exit-leak-free: "npm:^2.1.0"
|
||||
pino-abstract-transport: "npm:^2.0.0"
|
||||
pino-std-serializers: "npm:^7.0.0"
|
||||
process-warning: "npm:^4.0.0"
|
||||
quick-format-unescaped: "npm:^4.0.3"
|
||||
real-require: "npm:^0.2.0"
|
||||
safe-stable-stringify: "npm:^2.3.1"
|
||||
sonic-boom: "npm:^4.0.1"
|
||||
thread-stream: "npm:^3.0.0"
|
||||
bin:
|
||||
pino: bin.js
|
||||
checksum: 10c0/bcd1e9d9b301bea13b95689ca9ad7105ae9451928fb6c0b67b3e58c5fe37cea1d40665f3d6641e3da00be0bbc17b89031e67abbc8ea6aac6164f399309fd78e7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"prettier@npm:^3.5.3":
|
||||
version: 3.5.3
|
||||
resolution: "prettier@npm:3.5.3"
|
||||
@ -407,10 +744,59 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"process-warning@npm:^4.0.0":
|
||||
version: 4.0.1
|
||||
resolution: "process-warning@npm:4.0.1"
|
||||
checksum: 10c0/577a268b9fd5c3d9f6dbb4348220099391d830905642845d591e7ee8b1e45043d98b7b9826a3c1379bdd1686cdfe0f6cf349cb812affc5853b662e6a9896579e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"quick-format-unescaped@npm:^4.0.3":
|
||||
version: 4.0.4
|
||||
resolution: "quick-format-unescaped@npm:4.0.4"
|
||||
checksum: 10c0/fe5acc6f775b172ca5b4373df26f7e4fd347975578199e7d74b2ae4077f0af05baa27d231de1e80e8f72d88275ccc6028568a7a8c9ee5e7368ace0e18eff93a4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"real-require@npm:^0.2.0":
|
||||
version: 0.2.0
|
||||
resolution: "real-require@npm:0.2.0"
|
||||
checksum: 10c0/23eea5623642f0477412ef8b91acd3969015a1501ed34992ada0e3af521d3c865bb2fe4cdbfec5fe4b505f6d1ef6a03e5c3652520837a8c3b53decff7e74b6a0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"reflect-metadata@npm:^0.1.13":
|
||||
version: 0.1.13
|
||||
resolution: "reflect-metadata@npm:0.1.13"
|
||||
checksum: 10c0/728bff0b376b05639fd11ed80c648b61f7fe653c5b506d7ca118e58b6752b9b00810fe0c86227ecf02bd88da6251ab3eb19fd403aaf2e9ff5ef36a2fda643026
|
||||
version: 0.1.14
|
||||
resolution: "reflect-metadata@npm:0.1.14"
|
||||
checksum: 10c0/3a6190c7f6cb224f26a012d11f9e329360c01c1945e2cbefea23976a8bacf9db6b794aeb5bf18adcb673c448a234fbc06fc41853c00a6c206b30f0777ecf019e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"require-from-string@npm:^2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "require-from-string@npm:2.0.2"
|
||||
checksum: 10c0/aaa267e0c5b022fc5fd4eef49d8285086b15f2a1c54b28240fdf03599cbd9c26049fee3eab894f2e1f6ca65e513b030a7c264201e3f005601e80c49fb2937ce2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ret@npm:~0.5.0":
|
||||
version: 0.5.0
|
||||
resolution: "ret@npm:0.5.0"
|
||||
checksum: 10c0/220868b194f87bf1998e32e409086eec6b39e860c052bf267f8ad4d0131706a9773d45fd3f91acfb1a7c928fce002b694ab86fdba90bc8d4b8df68fa8645c5cc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"reusify@npm:^1.0.4":
|
||||
version: 1.1.0
|
||||
resolution: "reusify@npm:1.1.0"
|
||||
checksum: 10c0/4eff0d4a5f9383566c7d7ec437b671cc51b25963bd61bf127c3f3d3f68e44a026d99b8d2f1ad344afff8d278a8fe70a8ea092650a716d22287e8bef7126bb2fa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"rfdc@npm:^1.2.0, rfdc@npm:^1.3.1":
|
||||
version: 1.4.1
|
||||
resolution: "rfdc@npm:1.4.1"
|
||||
checksum: 10c0/4614e4292356cafade0b6031527eea9bc90f2372a22c012313be1dcc69a3b90c7338158b414539be863fa95bfcb2ddcd0587be696841af4e6679d85e62c060c7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -426,11 +812,34 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"rxjs@npm:^7.8.1":
|
||||
version: 7.8.1
|
||||
resolution: "rxjs@npm:7.8.1"
|
||||
version: 7.8.2
|
||||
resolution: "rxjs@npm:7.8.2"
|
||||
dependencies:
|
||||
tslib: "npm:^2.1.0"
|
||||
checksum: 10c0/3c49c1ecd66170b175c9cacf5cef67f8914dcbc7cd0162855538d365c83fea631167cacb644b3ce533b2ea0e9a4d0b12175186985f89d75abe73dbd8f7f06f68
|
||||
checksum: 10c0/1fcd33d2066ada98ba8f21fcbbcaee9f0b271de1d38dc7f4e256bfbc6ffcdde68c8bfb69093de7eeb46f24b1fb820620bf0223706cff26b4ab99a7ff7b2e2c45
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"safe-regex2@npm:^5.0.0":
|
||||
version: 5.0.0
|
||||
resolution: "safe-regex2@npm:5.0.0"
|
||||
dependencies:
|
||||
ret: "npm:~0.5.0"
|
||||
checksum: 10c0/83d5b1b60a5a97cb71a6e615518ec4a47761b3600aba389089be59a417498185250db2368080afc2f5e91237d68809c6c634b97a2e1cc8bd56a4c7eef2eeb6cf
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"safe-stable-stringify@npm:^2.3.1":
|
||||
version: 2.5.0
|
||||
resolution: "safe-stable-stringify@npm:2.5.0"
|
||||
checksum: 10c0/baea14971858cadd65df23894a40588ed791769db21bafb7fd7608397dbdce9c5aac60748abae9995e0fc37e15f2061980501e012cd48859740796bea2987f49
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"secure-json-parse@npm:^3.0.1":
|
||||
version: 3.0.2
|
||||
resolution: "secure-json-parse@npm:3.0.2"
|
||||
checksum: 10c0/4c9c005e7fdd8528df35fcdec41dc4e8e15820ce52de19f8102da808f9400a9ed8c0a28971e3efe24b001ee1e60296af553f12bbaab81a152f702dd00af2092d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -445,6 +854,22 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"semver@npm:^7.6.0":
|
||||
version: 7.7.1
|
||||
resolution: "semver@npm:7.7.1"
|
||||
bin:
|
||||
semver: bin/semver.js
|
||||
checksum: 10c0/fd603a6fb9c399c6054015433051bdbe7b99a940a8fb44b85c2b524c4004b023d7928d47cb22154f8d054ea7ee8597f586605e05b52047f048278e4ac56ae958
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"set-cookie-parser@npm:^2.6.0":
|
||||
version: 2.7.1
|
||||
resolution: "set-cookie-parser@npm:2.7.1"
|
||||
checksum: 10c0/060c198c4c92547ac15988256f445eae523f57f2ceefeccf52d30d75dedf6bff22b9c26f756bd44e8e560d44ff4ab2130b178bd2e52ef5571bf7be3bd7632d9a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"shebang-command@npm:^2.0.0":
|
||||
version: 2.0.0
|
||||
resolution: "shebang-command@npm:2.0.0"
|
||||
@ -468,6 +893,22 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"sonic-boom@npm:^4.0.1":
|
||||
version: 4.2.0
|
||||
resolution: "sonic-boom@npm:4.2.0"
|
||||
dependencies:
|
||||
atomic-sleep: "npm:^1.0.0"
|
||||
checksum: 10c0/ae897e6c2cd6d3cb7cdcf608bc182393b19c61c9413a85ce33ffd25891485589f39bece0db1de24381d0a38fc03d08c9862ded0c60f184f1b852f51f97af9684
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"split2@npm:^4.0.0":
|
||||
version: 4.2.0
|
||||
resolution: "split2@npm:4.2.0"
|
||||
checksum: 10c0/b292beb8ce9215f8c642bb68be6249c5a4c7f332fc8ecadae7be5cbdf1ea95addc95f0459ef2e7ad9d45fd1064698a097e4eb211c83e772b49bc0ee423e91534
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0":
|
||||
version: 4.2.3
|
||||
resolution: "string-width@npm:4.2.3"
|
||||
@ -508,6 +949,22 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"thread-stream@npm:^3.0.0":
|
||||
version: 3.1.0
|
||||
resolution: "thread-stream@npm:3.1.0"
|
||||
dependencies:
|
||||
real-require: "npm:^0.2.0"
|
||||
checksum: 10c0/c36118379940b77a6ef3e6f4d5dd31e97b8210c3f7b9a54eb8fe6358ab173f6d0acfaf69b9c3db024b948c0c5fd2a7df93e2e49151af02076b35ada3205ec9a6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"toad-cache@npm:^3.7.0":
|
||||
version: 3.7.0
|
||||
resolution: "toad-cache@npm:3.7.0"
|
||||
checksum: 10c0/7dae2782ee20b22c9798bb8b71dec7ec6a0091021d2ea9dd6e8afccab6b65b358fdba49a02209fac574499702e2c000660721516c87c2538d1b2c0ba03e8c0c3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"ts-node@npm:^10.9.1":
|
||||
version: 10.9.1
|
||||
resolution: "ts-node@npm:10.9.1"
|
||||
@ -546,20 +1003,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:2.8.1":
|
||||
"tslib@npm:2.8.1, tslib@npm:^2.1.0":
|
||||
version: 2.8.1
|
||||
resolution: "tslib@npm:2.8.1"
|
||||
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"tslib@npm:^2.1.0":
|
||||
version: 2.6.2
|
||||
resolution: "tslib@npm:2.6.2"
|
||||
checksum: 10c0/e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript@npm:^5.2.2":
|
||||
version: 5.2.2
|
||||
resolution: "typescript@npm:5.2.2"
|
||||
@ -589,10 +1039,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"undici-types@npm:~5.26.4":
|
||||
version: 5.26.5
|
||||
resolution: "undici-types@npm:5.26.5"
|
||||
checksum: 10c0/bb673d7876c2d411b6eb6c560e0c571eef4a01c1c19925175d16e3a30c4c428181fb8d7ae802a261f283e4166a0ac435e2f505743aa9e45d893f9a3df017b501
|
||||
"undici-types@npm:~6.19.2":
|
||||
version: 6.19.8
|
||||
resolution: "undici-types@npm:6.19.8"
|
||||
checksum: 10c0/078afa5990fba110f6824823ace86073b4638f1d5112ee26e790155f481f2a868cc3e0615505b6f4282bdf74a3d8caad715fd809e870c2bb0704e3ea6082f344
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user