@serene-dev/la-nest-library 0.0.226 → 0.0.227
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/libs/la-library/src/modules/logger-db/endpoint-logger-db.service.d.ts +2 -0
- package/dist/libs/la-library/src/modules/logger-db/endpoint-logger-db.service.js.map +1 -1
- package/dist/libs/la-library/src/modules/logger-db/endpoint-logger.interceptor.d.ts +1 -1
- package/dist/libs/la-library/src/modules/logger-db/endpoint-logger.interceptor.js +3 -1
- package/dist/libs/la-library/src/modules/logger-db/endpoint-logger.interceptor.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,12 @@ import { EndpointLoggerEntity } from './logger-db.entity';
|
|
|
2
2
|
import { Repository } from 'typeorm';
|
|
3
3
|
import { BaseService } from '../../services/base.service';
|
|
4
4
|
import { CreateEndpointLoggerDTO, SearchEndpointLoggerSearchDTO } from './logger-db.dto';
|
|
5
|
+
import { IAuthParam } from '../authentication/authentication.interface';
|
|
5
6
|
export declare class EndpointLoggerService extends BaseService<EndpointLoggerEntity, SearchEndpointLoggerSearchDTO> {
|
|
6
7
|
protected repo: Repository<EndpointLoggerEntity>;
|
|
7
8
|
static path: string;
|
|
8
9
|
constructor(repo: Repository<EndpointLoggerEntity>);
|
|
10
|
+
skipCondition: (user: IAuthParam) => Promise<boolean>;
|
|
9
11
|
_create(data: CreateEndpointLoggerDTO): Promise<EndpointLoggerEntity>;
|
|
10
12
|
searchV2: ({ date, ...query }: SearchEndpointLoggerSearchDTO) => Promise<import("../..").ISearchResponse<EndpointLoggerEntity>>;
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-logger-db.service.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/logger-db/endpoint-logger-db.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAA0D;AAC1D,6CAAmD;AACnD,qCAA8C;AAC9C,8DAA0D;AAC1D,qDAAmD;AAKnD,oEAA8D;
|
|
1
|
+
{"version":3,"file":"endpoint-logger-db.service.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/logger-db/endpoint-logger-db.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAA0D;AAC1D,6CAAmD;AACnD,qCAA8C;AAC9C,8DAA0D;AAC1D,qDAAmD;AAKnD,oEAA8D;AAIvD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,0BAG1C;IAEC,YAEE,IAAyD;QAEzD,KAAK,CAAC,IAAI,EAAE,sBAAU,CAAC,cAAc,CAAC,CAAC;QAFpB,SAAI,GAAJ,IAAI,CAAkC;QAY3D,aAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiC,EAAE,EAAE;YAC/D,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,OAAO,8BAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;gBAC3C,SAAS,EAAE;oBACT,SAAS,EAAE,KAAK;wBACd,CAAC,CAAC,IAAA,iBAAO,EAAC,KAAK,GAAG,WAAW,EAAE,KAAK,GAAG,WAAW,CAAC;wBACnD,CAAC,CAAC,KAAK,CAAC,SAAS;iBACpB;aACF,CAAC,CAAC;QACL,CAAC,CAAC;QAlBA,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAIQ,OAAO,CAAC,IAA6B;QAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;;AAjBU,sDAAqB;AAIhB,0BAAI,GAAW,WAAW,AAAtB,CAAuB;gCAJhC,qBAAqB;IADjC,IAAA,mBAAU,EAAC,EAAE,CAAC;IAOV,WAAA,IAAA,0BAAgB,EAAC,uCAAoB,CAAC,CAAA;qCACd,oBAAU;GAP1B,qBAAqB,CA6BjC"}
|
|
@@ -4,7 +4,7 @@ import { EndpointLoggerService } from './endpoint-logger-db.service';
|
|
|
4
4
|
export declare class EndpointLoggingInterceptor implements NestInterceptor {
|
|
5
5
|
protected endpointLoggerService: EndpointLoggerService;
|
|
6
6
|
constructor(endpointLoggerService: EndpointLoggerService);
|
|
7
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<any
|
|
7
|
+
intercept(context: ExecutionContext, next: CallHandler): Promise<Observable<any>>;
|
|
8
8
|
static provideInterceptor(): {
|
|
9
9
|
provide: string;
|
|
10
10
|
useClass: typeof EndpointLoggingInterceptor;
|
|
@@ -19,9 +19,11 @@ let EndpointLoggingInterceptor = EndpointLoggingInterceptor_1 = class EndpointLo
|
|
|
19
19
|
constructor(endpointLoggerService) {
|
|
20
20
|
this.endpointLoggerService = endpointLoggerService;
|
|
21
21
|
}
|
|
22
|
-
intercept(context, next) {
|
|
22
|
+
async intercept(context, next) {
|
|
23
23
|
// debugger;
|
|
24
24
|
const req = context.getArgByIndex(0);
|
|
25
|
+
if (await this.endpointLoggerService.skipCondition?.(req?.['user']))
|
|
26
|
+
return next.handle();
|
|
25
27
|
const log = {
|
|
26
28
|
endpoint: req?.originalUrl || 'test',
|
|
27
29
|
inDateTime: new Date().getTime(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-logger.interceptor.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/logger-db/endpoint-logger.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAKwB;AAExB,8CAAiD;AACjD,6EAAqE;AAErE,uCAA+C;AAIxC,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IACrC,YAAsB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IACtE,
|
|
1
|
+
{"version":3,"file":"endpoint-logger.interceptor.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/logger-db/endpoint-logger.interce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