@coast/service-common-nest 1.0.27 → 1.0.29
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/lib/async-local-storage/AsyncLocalStorageInterceptor.d.ts +9 -0
- package/dist/lib/{trace/TraceInterceptor.js → async-local-storage/AsyncLocalStorageInterceptor.js} +11 -11
- package/dist/lib/async-local-storage/AsyncLocalStorageInterceptor.js.map +1 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageInterceptorModule.d.ts +6 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageInterceptorModule.js +16 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageInterceptorModule.js.map +1 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageModule.d.ts +4 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageModule.js +23 -0
- package/dist/lib/async-local-storage/AsyncLocalStorageModule.js.map +1 -0
- package/dist/lib/logger/LogMethod.d.ts +1 -0
- package/dist/lib/logger/LogMethod.js +53 -0
- package/dist/lib/logger/LogMethod.js.map +1 -0
- package/dist/lib/logger/LoggerModule.d.ts +2 -1
- package/dist/lib/logger/LoggerModule.js +5 -5
- package/dist/lib/logger/LoggerModule.js.map +1 -1
- package/dist/lib/logger/test/LogMethodTestModule.d.ts +2 -0
- package/dist/lib/logger/test/LogMethodTestModule.js +44 -0
- package/dist/lib/logger/test/LogMethodTestModule.js.map +1 -0
- package/dist/lib/logger/test/TestLoggedMethods.d.ts +3 -0
- package/dist/lib/logger/test/TestLoggedMethods.js +28 -0
- package/dist/lib/logger/test/TestLoggedMethods.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -3
- package/dist/lib/trace/TraceInterceptor.d.ts +0 -8
- package/dist/lib/trace/TraceInterceptor.js.map +0 -1
- package/dist/lib/trace/TraceModule.d.ts +0 -4
- package/dist/lib/trace/TraceModule.js +0 -22
- package/dist/lib/trace/TraceModule.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AsyncLocalStorageContext } from '@coast/service-common/async-local-storage/AsyncLocalStorageContext';
|
|
2
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
export declare abstract class AsyncLocalStorageInterceptor<T> implements NestInterceptor {
|
|
5
|
+
private readonly asyncLocalContext;
|
|
6
|
+
constructor(asyncLocalContext: AsyncLocalStorageContext<T>);
|
|
7
|
+
intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown> | Promise<Observable<unknown>>;
|
|
8
|
+
protected abstract generateContext(): T;
|
|
9
|
+
}
|
package/dist/lib/{trace/TraceInterceptor.js → async-local-storage/AsyncLocalStorageInterceptor.js}
RENAMED
|
@@ -12,20 +12,20 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
16
|
-
const
|
|
15
|
+
exports.AsyncLocalStorageInterceptor = void 0;
|
|
16
|
+
const AsyncLocalStorageContext_1 = require("@coast/service-common/async-local-storage/AsyncLocalStorageContext");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
|
-
let
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
18
|
+
let AsyncLocalStorageInterceptor = class AsyncLocalStorageInterceptor {
|
|
19
|
+
constructor(asyncLocalContext) {
|
|
20
|
+
this.asyncLocalContext = asyncLocalContext;
|
|
21
21
|
}
|
|
22
22
|
intercept(_context, next) {
|
|
23
|
-
return this.
|
|
23
|
+
return this.asyncLocalContext.withContext(this.generateContext(), next.handle);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.AsyncLocalStorageInterceptor = AsyncLocalStorageInterceptor;
|
|
27
|
+
exports.AsyncLocalStorageInterceptor = AsyncLocalStorageInterceptor = __decorate([
|
|
28
28
|
__param(0, (0, common_1.Inject)()),
|
|
29
|
-
__metadata("design:paramtypes", [
|
|
30
|
-
],
|
|
31
|
-
//# sourceMappingURL=
|
|
29
|
+
__metadata("design:paramtypes", [AsyncLocalStorageContext_1.AsyncLocalStorageContext])
|
|
30
|
+
], AsyncLocalStorageInterceptor);
|
|
31
|
+
//# sourceMappingURL=AsyncLocalStorageInterceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncLocalStorageInterceptor.js","sourceRoot":"","sources":["../../../lib/async-local-storage/AsyncLocalStorageInterceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iHAA8G;AAC9G,2CAAwF;AAGxF,IAAsB,4BAA4B,GAAlD,MAAsB,4BAA4B;IAC9C,YAAuC,iBAA8C;QAA9C,sBAAiB,GAAjB,iBAAiB,CAA6B;IAAG,CAAC;IAElF,SAAS,CAAC,QAA0B,EAAE,IAAiB;QAC1D,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnF,CAAC;CAGJ,CAAA;AARqB,oEAA4B;uCAA5B,4BAA4B;IACjC,WAAA,IAAA,eAAM,GAAE,CAAA;qCAAqC,mDAAwB;GADhE,4BAA4B,CAQjD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { FactoryProvider } from '@nestjs/common/interfaces';
|
|
3
|
+
import { AsyncLocalStorageInterceptor } from './AsyncLocalStorageInterceptor';
|
|
4
|
+
export declare class AsyncLocalStorageInterceptorModule {
|
|
5
|
+
static forRootAsync<T>(asyncLocalStorageInterceptorFactoryProvider: FactoryProvider<AsyncLocalStorageInterceptor<T>>): DynamicModule;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncLocalStorageInterceptorModule = void 0;
|
|
4
|
+
const AsyncLocalStorageModule_1 = require("./AsyncLocalStorageModule");
|
|
5
|
+
class AsyncLocalStorageInterceptorModule {
|
|
6
|
+
static forRootAsync(asyncLocalStorageInterceptorFactoryProvider) {
|
|
7
|
+
return {
|
|
8
|
+
imports: [AsyncLocalStorageModule_1.AsyncLocalStorageModule],
|
|
9
|
+
exports: [asyncLocalStorageInterceptorFactoryProvider],
|
|
10
|
+
module: AsyncLocalStorageInterceptorModule,
|
|
11
|
+
providers: [asyncLocalStorageInterceptorFactoryProvider],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.AsyncLocalStorageInterceptorModule = AsyncLocalStorageInterceptorModule;
|
|
16
|
+
//# sourceMappingURL=AsyncLocalStorageInterceptorModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncLocalStorageInterceptorModule.js","sourceRoot":"","sources":["../../../lib/async-local-storage/AsyncLocalStorageInterceptorModule.ts"],"names":[],"mappings":";;;AAIA,uEAAoE;AAEpE,MAAa,kCAAkC;IAC3C,MAAM,CAAC,YAAY,CACf,2CAA6F;QAE7F,OAAO;YACH,OAAO,EAAE,CAAC,iDAAuB,CAAC;YAClC,OAAO,EAAE,CAAC,2CAA2C,CAAC;YACtD,MAAM,EAAE,kCAAkC;YAC1C,SAAS,EAAE,CAAC,2CAA2C,CAAC;SAC3D,CAAC;IACN,CAAC;CACJ;AAXD,gFAWC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncLocalStorageModule = void 0;
|
|
4
|
+
const AsyncLocalStorageContext_1 = require("@coast/service-common/async-local-storage/AsyncLocalStorageContext");
|
|
5
|
+
const async_hooks_1 = require("async_hooks");
|
|
6
|
+
class AsyncLocalStorageModule {
|
|
7
|
+
static forRootAsync() {
|
|
8
|
+
const asyncLocalStorageContextFactoryProvider = {
|
|
9
|
+
provide: AsyncLocalStorageContext_1.AsyncLocalStorageContext,
|
|
10
|
+
inject: [async_hooks_1.AsyncLocalStorage],
|
|
11
|
+
useFactory: (asyncLocalStorage) => {
|
|
12
|
+
return new AsyncLocalStorageContext_1.AsyncLocalStorageContext(asyncLocalStorage);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
exports: [asyncLocalStorageContextFactoryProvider],
|
|
17
|
+
module: AsyncLocalStorageModule,
|
|
18
|
+
providers: [(async_hooks_1.AsyncLocalStorage), asyncLocalStorageContextFactoryProvider],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AsyncLocalStorageModule = AsyncLocalStorageModule;
|
|
23
|
+
//# sourceMappingURL=AsyncLocalStorageModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncLocalStorageModule.js","sourceRoot":"","sources":["../../../lib/async-local-storage/AsyncLocalStorageModule.ts"],"names":[],"mappings":";;;AAAA,iHAA8G;AAG9G,6CAAgD;AAEhD,MAAa,uBAAuB;IAChC,MAAM,CAAC,YAAY;QACf,MAAM,uCAAuC,GAAoB;YAC7D,OAAO,EAAE,mDAAwB;YACjC,MAAM,EAAE,CAAC,+BAAiB,CAAC;YAC3B,UAAU,EAAE,CAAC,iBAAuC,EAAE,EAAE;gBACpD,OAAO,IAAI,mDAAwB,CAAI,iBAAiB,CAAC,CAAC;YAC9D,CAAC;SACJ,CAAC;QAEF,OAAO;YACH,OAAO,EAAE,CAAC,uCAAuC,CAAC;YAClD,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,CAAC,CAAA,+BAAoB,CAAA,EAAE,uCAAuC,CAAC;SAC7E,CAAC;IACN,CAAC;CACJ;AAhBD,0DAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LogMethod(): MethodDecorator;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LogMethod = LogMethod;
|
|
7
|
+
const CoastLogger_1 = require("@coast/service-common/logger/CoastLogger");
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
10
|
+
function LogMethod() {
|
|
11
|
+
const injectLogger = (0, common_1.Inject)(CoastLogger_1.CoastLogger);
|
|
12
|
+
return (target, method, descriptor) => {
|
|
13
|
+
if (descriptor === undefined) {
|
|
14
|
+
descriptor = Object.getOwnPropertyDescriptor(target, method);
|
|
15
|
+
}
|
|
16
|
+
injectLogger(target, 'logger');
|
|
17
|
+
const originalMethod = descriptor?.value;
|
|
18
|
+
if (!lodash_1.default.isNil(descriptor)) {
|
|
19
|
+
descriptor.value = function () {
|
|
20
|
+
const coastLogger = this.logger;
|
|
21
|
+
const className = target.constructor?.name;
|
|
22
|
+
coastLogger?.log({ method: `${className}.${method.toString()}`, msg: 'Method started' });
|
|
23
|
+
let callSucceeded = true;
|
|
24
|
+
const startTime = process.hrtime.bigint();
|
|
25
|
+
try {
|
|
26
|
+
const result = originalMethod.apply(this, arguments);
|
|
27
|
+
if (result instanceof Promise) {
|
|
28
|
+
return result
|
|
29
|
+
.catch((e) => {
|
|
30
|
+
callSucceeded = false;
|
|
31
|
+
throw e;
|
|
32
|
+
})
|
|
33
|
+
.finally(() => logMethodResult(className, method, callSucceeded, startTime, coastLogger));
|
|
34
|
+
}
|
|
35
|
+
logMethodResult(className, method, callSucceeded, startTime, coastLogger);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
callSucceeded = false;
|
|
40
|
+
logMethodResult(className, method, callSucceeded, startTime, coastLogger);
|
|
41
|
+
throw e;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return descriptor;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function logMethodResult(className, methodName, callSucceeded, startTime, coastLogger) {
|
|
49
|
+
const endTime = process.hrtime.bigint();
|
|
50
|
+
const latencyMs = Number(endTime - startTime) / 1_000_000;
|
|
51
|
+
coastLogger?.log({ method: `${className}.${methodName.toString()}`, callSucceeded, latencyMs, msg: 'Method ended' });
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=LogMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogMethod.js","sourceRoot":"","sources":["../../../lib/logger/LogMethod.ts"],"names":[],"mappings":";;;;;AAIA,8BAyDC;AA7DD,0EAAuE;AACvE,2CAAwC;AACxC,oDAAuB;AAEvB,SAAgB,SAAS;IACrB,MAAM,YAAY,GAAG,IAAA,eAAM,EAAC,yBAAW,CAAC,CAAC;IAEzC,OAAO,CACH,MAAc,EACd,MAAuB,EAEvB,UAAyC,EAED,EAAE;QAC1C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjE,CAAC;QAGD,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE/B,MAAM,cAAc,GAAG,UAAU,EAAE,KAAK,CAAC;QAEzC,IAAI,CAAC,gBAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACvB,UAAU,CAAC,KAAK,GAAG;gBAEf,MAAM,WAAW,GAAgB,IAAI,CAAC,MAAM,CAAC;gBAE7C,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC;gBAE3C,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;gBAEzF,IAAI,aAAa,GAAG,IAAI,CAAC;gBAEzB,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBAE1C,IAAI,CAAC;oBAED,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;oBAErD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;wBAC5B,OAAO,MAAM;6BACR,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;4BACT,aAAa,GAAG,KAAK,CAAC;4BACtB,MAAM,CAAC,CAAC;wBACZ,CAAC,CAAC;6BACD,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;oBAClG,CAAC;oBAED,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;oBAC1E,OAAO,MAAM,CAAC;gBAClB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,aAAa,GAAG,KAAK,CAAC;oBACtB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;oBAC1E,MAAM,CAAC,CAAC;gBACZ,CAAC;YACL,CAAC,CAAC;QACN,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAED,SAAS,eAAe,CACpB,SAAiB,EACjB,UAA2B,EAC3B,aAAsB,EACtB,SAAiB,EACjB,WAAoC;IAEpC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACxC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAC1D,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC;AACzH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { AsyncStoreTrace } from '@coast/service-common/trace/AsyncStoreTrace';
|
|
1
2
|
import { DynamicModule } from '@nestjs/common';
|
|
2
3
|
import { LoggerModuleAsyncOptions } from './LoggerModuleAsyncOptions';
|
|
3
4
|
export declare class LoggerModule {
|
|
4
5
|
static disabled(): DynamicModule;
|
|
5
|
-
static forRootAsync(options: LoggerModuleAsyncOptions): DynamicModule;
|
|
6
|
+
static forRootAsync<AsyncLocalContext extends AsyncStoreTrace = AsyncStoreTrace>(options: LoggerModuleAsyncOptions): DynamicModule;
|
|
6
7
|
private static createAsyncOptionsProvider;
|
|
7
8
|
}
|
|
@@ -8,13 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var LoggerModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.LoggerModule = void 0;
|
|
11
|
+
const AsyncLocalStorageContext_1 = require("@coast/service-common/async-local-storage/AsyncLocalStorageContext");
|
|
11
12
|
const CoastLogger_1 = require("@coast/service-common/logger/CoastLogger");
|
|
12
13
|
const PinoLogger_1 = require("@coast/service-common/logger/PinoLogger");
|
|
13
14
|
const SilentLogger_1 = require("@coast/service-common/logger/SilentLogger");
|
|
14
|
-
const TraceManager_1 = require("@coast/service-common/trace/TraceManager");
|
|
15
15
|
const common_1 = require("@nestjs/common");
|
|
16
|
+
const AsyncLocalStorageModule_1 = require("../async-local-storage/AsyncLocalStorageModule");
|
|
16
17
|
const Constants_1 = require("../Constants");
|
|
17
|
-
const TraceModule_1 = require("../trace/TraceModule");
|
|
18
18
|
let LoggerModule = LoggerModule_1 = class LoggerModule {
|
|
19
19
|
static disabled() {
|
|
20
20
|
const coastLogger = {
|
|
@@ -30,13 +30,13 @@ let LoggerModule = LoggerModule_1 = class LoggerModule {
|
|
|
30
30
|
static forRootAsync(options) {
|
|
31
31
|
const asyncProvider = LoggerModule_1.createAsyncOptionsProvider(options);
|
|
32
32
|
const coastLogger = {
|
|
33
|
-
inject: [
|
|
33
|
+
inject: [AsyncLocalStorageContext_1.AsyncLocalStorageContext, Constants_1.Constants.LOGGER_OPTIONS],
|
|
34
34
|
provide: CoastLogger_1.CoastLogger,
|
|
35
|
-
useFactory: (
|
|
35
|
+
useFactory: (asyncLocalStorageContext, options) => new PinoLogger_1.PinoLogger(asyncLocalStorageContext, options),
|
|
36
36
|
};
|
|
37
37
|
return {
|
|
38
38
|
exports: [coastLogger],
|
|
39
|
-
imports: [
|
|
39
|
+
imports: [AsyncLocalStorageModule_1.AsyncLocalStorageModule.forRootAsync(), ...(options.imports ?? [])],
|
|
40
40
|
module: LoggerModule_1,
|
|
41
41
|
providers: [coastLogger, asyncProvider],
|
|
42
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerModule.js","sourceRoot":"","sources":["../../../lib/logger/LoggerModule.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0EAAuE;AAEvE,wEAAqE;AACrE,4EAAyE;
|
|
1
|
+
{"version":3,"file":"LoggerModule.js","sourceRoot":"","sources":["../../../lib/logger/LoggerModule.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,iHAA8G;AAC9G,0EAAuE;AAEvE,wEAAqE;AACrE,4EAAyE;AAEzE,2CAAyE;AAGzE,4FAAyF;AACzF,4CAAyC;AAKlC,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACd,MAAM,CAAC,QAAQ;QAClB,MAAM,WAAW,GAAkB;YAC/B,OAAO,EAAE,yBAAW;YACpB,QAAQ,EAAE,IAAI,2BAAY,EAAE;SAC/B,CAAC;QACF,OAAO;YACH,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,WAAW,CAAC;SAC3B,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,YAAY,CACtB,OAAiC;QAEjC,MAAM,aAAa,GAAG,cAAY,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;QACvE,MAAM,WAAW,GAAoB;YACjC,MAAM,EAAE,CAAC,mDAAwB,EAAE,qBAAS,CAAC,cAAc,CAAC;YAC5D,OAAO,EAAE,yBAAW;YACpB,UAAU,EAAE,CACR,wBAAqE,EACrE,OAAsB,EACZ,EAAE,CAAC,IAAI,uBAAU,CAAC,wBAAwB,EAAE,OAAO,CAAC;SACrE,CAAC;QACF,OAAO;YACH,OAAO,EAAE,CAAC,WAAW,CAAC;YACtB,OAAO,EAAE,CAAC,iDAAuB,CAAC,YAAY,EAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAChG,MAAM,EAAE,cAAY;YACpB,SAAS,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;SAC1C,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,0BAA0B,CAAC,OAAiC;QACvE,OAAO;YACH,OAAO,EAAE,qBAAS,CAAC,cAAc;YACjC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;SAC/B,CAAC;IACN,CAAC;CACJ,CAAA;AAxCY,oCAAY;uBAAZ,YAAY;IAFxB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CAwCxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LogMethodTestModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const config_1 = require("@nestjs/config");
|
|
12
|
+
const CoastApiModule_1 = require("../../coast-api/CoastApiModule");
|
|
13
|
+
const LoggerModule_1 = require("../LoggerModule");
|
|
14
|
+
const TestLoggedMethods_1 = require("./TestLoggedMethods");
|
|
15
|
+
let LogMethodTestModule = class LogMethodTestModule {
|
|
16
|
+
};
|
|
17
|
+
exports.LogMethodTestModule = LogMethodTestModule;
|
|
18
|
+
exports.LogMethodTestModule = LogMethodTestModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [
|
|
21
|
+
config_1.ConfigModule.forRoot({
|
|
22
|
+
isGlobal: true,
|
|
23
|
+
}),
|
|
24
|
+
LoggerModule_1.LoggerModule.forRootAsync({
|
|
25
|
+
imports: [config_1.ConfigModule],
|
|
26
|
+
inject: [config_1.ConfigService],
|
|
27
|
+
useFactory: async (configService) => ({
|
|
28
|
+
level: configService.get('LOG_LEVEL'),
|
|
29
|
+
pretty: configService.get('LOG_PRETTY'),
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
CoastApiModule_1.CoastApiModule.forRootAsync({
|
|
33
|
+
imports: [config_1.ConfigModule],
|
|
34
|
+
inject: [config_1.ConfigService],
|
|
35
|
+
useFactory: async () => ({
|
|
36
|
+
endpoint: 'COAST_API_ENDPOINT',
|
|
37
|
+
authToken: 'COAST_API_AUTH_TOKEN',
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
providers: [TestLoggedMethods_1.TestLoggedMethods],
|
|
42
|
+
})
|
|
43
|
+
], LogMethodTestModule);
|
|
44
|
+
//# sourceMappingURL=LogMethodTestModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogMethodTestModule.js","sourceRoot":"","sources":["../../../../lib/logger/test/LogMethodTestModule.ts"],"names":[],"mappings":";;;;;;;;;AACA,2CAAwC;AACxC,2CAA6D;AAE7D,mEAAgE;AAChE,kDAA+C;AAC/C,2DAAwD;AA0BjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAxB/B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC;gBACjB,QAAQ,EAAE,IAAI;aACjB,CAAC;YACF,2BAAY,CAAC,YAAY,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE,CAAC,CAAC;oBACjD,KAAK,EAAE,aAAa,CAAC,GAAG,CAAW,WAAW,CAAC;oBAC/C,MAAM,EAAE,aAAa,CAAC,GAAG,CAAU,YAAY,CAAC;iBACnD,CAAC;aACL,CAAC;YACF,+BAAc,CAAC,YAAY,CAAC;gBACxB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;oBACrB,QAAQ,EAAE,oBAAoB;oBAC9B,SAAS,EAAE,sBAAsB;iBACpC,CAAC;aACL,CAAC;SACL;QACD,SAAS,EAAE,CAAC,qCAAiB,CAAC;KACjC,CAAC;GACW,mBAAmB,CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TestLoggedMethods = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const LogMethod_1 = require("../LogMethod");
|
|
15
|
+
let TestLoggedMethods = class TestLoggedMethods {
|
|
16
|
+
logStartAndEnd() { }
|
|
17
|
+
};
|
|
18
|
+
exports.TestLoggedMethods = TestLoggedMethods;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, LogMethod_1.LogMethod)(),
|
|
21
|
+
__metadata("design:type", Function),
|
|
22
|
+
__metadata("design:paramtypes", []),
|
|
23
|
+
__metadata("design:returntype", void 0)
|
|
24
|
+
], TestLoggedMethods.prototype, "logStartAndEnd", null);
|
|
25
|
+
exports.TestLoggedMethods = TestLoggedMethods = __decorate([
|
|
26
|
+
(0, common_1.Injectable)()
|
|
27
|
+
], TestLoggedMethods);
|
|
28
|
+
//# sourceMappingURL=TestLoggedMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestLoggedMethods.js","sourceRoot":"","sources":["../../../../lib/logger/test/TestLoggedMethods.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,4CAAyC;AAGlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE1B,cAAc,KAAU,CAAC;CAC5B,CAAA;AAHY,8CAAiB;AAE1B;IADC,IAAA,qBAAS,GAAE;;;;uDACa;4BAFhB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAG7B"}
|