@adatechnology/logger 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { DynamicModule, NestMiddleware } from '@nestjs/common';
1
+ import { DynamicModule, NestMiddleware, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
2
2
  import { LoggerOptions } from 'winston';
3
+ import { Observable } from 'rxjs';
3
4
 
4
5
  interface ObfuscatorKey {
5
6
  key: string;
@@ -72,6 +73,7 @@ interface LoggerConfig extends WinstonModuleConfig {
72
73
  declare const DEFAULT_LOGGER_CONFIG: LoggerConfig;
73
74
 
74
75
  declare const LOGGER_PROVIDER = "LOGGER_PROVIDER";
76
+ declare const HTTP_LOGGING_INTERCEPTOR = "HTTP_LOGGING_INTERCEPTOR";
75
77
 
76
78
  declare class LoggerModule {
77
79
  static forRoot(config?: LoggerConfig): DynamicModule;
@@ -95,9 +97,21 @@ declare class RequestContextMiddleware implements NestMiddleware {
95
97
  use(req: RequestLike, _res: ResponseLike, next: NextFunctionLike): void;
96
98
  }
97
99
 
100
+ declare class HttpLoggingInterceptor implements NestInterceptor {
101
+ private readonly logger;
102
+ constructor(logger: LoggerProviderInterface);
103
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
104
+ }
105
+
106
+ declare const HTTP_LOGGING_INTERCEPTOR_CONTEXT: {
107
+ readonly INTERCEPT: "HttpLoggingInterceptor.intercept";
108
+ readonly ON_RESPONSE: "HttpLoggingInterceptor.onResponse";
109
+ readonly ON_ERROR: "HttpLoggingInterceptor.onError";
110
+ };
111
+
98
112
  type RequestContext = Record<string, unknown> | undefined;
99
113
 
100
114
  declare function getContext(): RequestContext;
101
115
  declare function runWithContext<T>(ctx: Record<string, unknown>, fn: () => T): T;
102
116
 
103
- export { DEFAULT_LOGGER_CONFIG, LOGGER_PROVIDER, type LogPayload, type LoggerConfig, LoggerLevel, LoggerModule, type LoggerProviderInterface, RequestContextMiddleware, getContext, runWithContext };
117
+ export { DEFAULT_LOGGER_CONFIG, HTTP_LOGGING_INTERCEPTOR, HTTP_LOGGING_INTERCEPTOR_CONTEXT, HttpLoggingInterceptor, LOGGER_PROVIDER, type LogPayload, type LoggerConfig, LoggerLevel, LoggerModule, type LoggerProviderInterface, RequestContextMiddleware, getContext, runWithContext };