xcally-nest-library 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +22 -0
- package/.nvmrc +1 -0
- package/.prettierrc +5 -0
- package/.vscode/settings.json +6 -0
- package/README.md +73 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/src/config/env.validation.d.ts +21 -0
- package/dist/src/config/env.validation.js +80 -0
- package/dist/src/config/env.validation.js.map +1 -0
- package/dist/src/db/typeorm/generic.repository.d.ts +18 -0
- package/dist/src/db/typeorm/generic.repository.js +43 -0
- package/dist/src/db/typeorm/generic.repository.js.map +1 -0
- package/dist/src/decorators/utils.decorators.d.ts +2 -0
- package/dist/src/decorators/utils.decorators.js +15 -0
- package/dist/src/decorators/utils.decorators.js.map +1 -0
- package/dist/src/interceptors/log-request.interceptor.d.ts +8 -0
- package/dist/src/interceptors/log-request.interceptor.js +42 -0
- package/dist/src/interceptors/log-request.interceptor.js.map +1 -0
- package/dist/src/interceptors/serialize.interceptor.d.ts +12 -0
- package/dist/src/interceptors/serialize.interceptor.js +24 -0
- package/dist/src/interceptors/serialize.interceptor.js.map +1 -0
- package/dist/src/modules/logger/winston.decorator.d.ts +1 -0
- package/dist/src/modules/logger/winston.decorator.js +17 -0
- package/dist/src/modules/logger/winston.decorator.js.map +1 -0
- package/dist/src/modules/logger/winston.interface.d.ts +21 -0
- package/dist/src/modules/logger/winston.interface.js +3 -0
- package/dist/src/modules/logger/winston.interface.js.map +1 -0
- package/dist/src/modules/logger/winston.module.d.ts +4 -0
- package/dist/src/modules/logger/winston.module.js +95 -0
- package/dist/src/modules/logger/winston.module.js.map +1 -0
- package/dist/src/modules/logger/winston.service.d.ts +23 -0
- package/dist/src/modules/logger/winston.service.js +113 -0
- package/dist/src/modules/logger/winston.service.js.map +1 -0
- package/dist/src/modules/tracer/tracer.middleware.d.ts +24 -0
- package/dist/src/modules/tracer/tracer.middleware.js +41 -0
- package/dist/src/modules/tracer/tracer.middleware.js.map +1 -0
- package/dist/src/modules/tracer/tracer.module.d.ts +7 -0
- package/dist/src/modules/tracer/tracer.module.js +36 -0
- package/dist/src/modules/tracer/tracer.module.js.map +1 -0
- package/dist/src/types/auth.d.ts +8 -0
- package/dist/src/types/auth.js +9 -0
- package/dist/src/types/auth.js.map +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.js +18 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/index.ts +9 -0
- package/nest-cli.json +8 -0
- package/package.json +89 -0
- package/src/config/env.validation.ts +59 -0
- package/src/db/typeorm/generic.repository.ts +43 -0
- package/src/decorators/utils.decorators.ts +28 -0
- package/src/interceptors/log-request.interceptor.ts +30 -0
- package/src/interceptors/serialize.interceptor.ts +27 -0
- package/src/modules/logger/winston.decorator.ts +14 -0
- package/src/modules/logger/winston.interface.ts +22 -0
- package/src/modules/logger/winston.module.ts +105 -0
- package/src/modules/logger/winston.service.ts +60 -0
- package/src/modules/tracer/tracer.middleware.ts +40 -0
- package/src/modules/tracer/tracer.module.ts +18 -0
- package/src/types/auth.ts +9 -0
- package/src/types/index.ts +1 -0
- package/test/jest-e2e.json +9 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +21 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Logger } from 'winston';
|
2
|
+
import { IWinstonLogger } from './winston.interface';
|
3
|
+
export interface Meta {
|
4
|
+
traceId: string;
|
5
|
+
className?: string;
|
6
|
+
methodName?: string;
|
7
|
+
[key: string]: any;
|
8
|
+
}
|
9
|
+
export declare class WinstonLoggerService implements IWinstonLogger {
|
10
|
+
private readonly logger;
|
11
|
+
constructor(logger: Logger);
|
12
|
+
info(message: string, meta: Meta): void;
|
13
|
+
warn(message: string, meta: Meta): void;
|
14
|
+
help(message: string, meta: Meta): void;
|
15
|
+
data(message: string, meta: Meta): void;
|
16
|
+
debug(message: string, meta: Meta): void;
|
17
|
+
prompt(message: string, meta: Meta): void;
|
18
|
+
http(message: string, meta: Meta): void;
|
19
|
+
verbose(message: string, meta: Meta): void;
|
20
|
+
input(message: string, meta: Meta): void;
|
21
|
+
silly(message: string, meta: Meta): void;
|
22
|
+
error(message: string, meta: Meta): void;
|
23
|
+
}
|
@@ -0,0 +1,113 @@
|
|
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.WinstonLoggerService = void 0;
|
13
|
+
const winston_decorator_1 = require("./winston.decorator");
|
14
|
+
class WinstonLoggerService {
|
15
|
+
constructor(logger) {
|
16
|
+
this.logger = logger;
|
17
|
+
}
|
18
|
+
info(message, meta) {
|
19
|
+
this.logger.info(message, meta);
|
20
|
+
}
|
21
|
+
warn(message, meta) {
|
22
|
+
this.logger.warn(message, meta);
|
23
|
+
}
|
24
|
+
help(message, meta) {
|
25
|
+
this.logger.help(message, meta);
|
26
|
+
}
|
27
|
+
data(message, meta) {
|
28
|
+
this.logger.data(message, meta);
|
29
|
+
}
|
30
|
+
debug(message, meta) {
|
31
|
+
this.logger.debug(message, meta);
|
32
|
+
}
|
33
|
+
prompt(message, meta) {
|
34
|
+
this.logger.prompt(message, meta);
|
35
|
+
}
|
36
|
+
http(message, meta) {
|
37
|
+
this.logger.http(message, meta);
|
38
|
+
}
|
39
|
+
verbose(message, meta) {
|
40
|
+
this.logger.verbose(message, meta);
|
41
|
+
}
|
42
|
+
input(message, meta) {
|
43
|
+
this.logger.input(message, meta);
|
44
|
+
}
|
45
|
+
silly(message, meta) {
|
46
|
+
this.logger.silly(message, meta);
|
47
|
+
}
|
48
|
+
error(message, meta) {
|
49
|
+
this.logger.error(message, meta);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
exports.WinstonLoggerService = WinstonLoggerService;
|
53
|
+
__decorate([
|
54
|
+
(0, winston_decorator_1.TraceLog)(),
|
55
|
+
__metadata("design:type", Function),
|
56
|
+
__metadata("design:paramtypes", [String, Object]),
|
57
|
+
__metadata("design:returntype", void 0)
|
58
|
+
], WinstonLoggerService.prototype, "info", null);
|
59
|
+
__decorate([
|
60
|
+
(0, winston_decorator_1.TraceLog)(),
|
61
|
+
__metadata("design:type", Function),
|
62
|
+
__metadata("design:paramtypes", [String, Object]),
|
63
|
+
__metadata("design:returntype", void 0)
|
64
|
+
], WinstonLoggerService.prototype, "warn", null);
|
65
|
+
__decorate([
|
66
|
+
(0, winston_decorator_1.TraceLog)(),
|
67
|
+
__metadata("design:type", Function),
|
68
|
+
__metadata("design:paramtypes", [String, Object]),
|
69
|
+
__metadata("design:returntype", void 0)
|
70
|
+
], WinstonLoggerService.prototype, "help", null);
|
71
|
+
__decorate([
|
72
|
+
(0, winston_decorator_1.TraceLog)(),
|
73
|
+
__metadata("design:type", Function),
|
74
|
+
__metadata("design:paramtypes", [String, Object]),
|
75
|
+
__metadata("design:returntype", void 0)
|
76
|
+
], WinstonLoggerService.prototype, "data", null);
|
77
|
+
__decorate([
|
78
|
+
(0, winston_decorator_1.TraceLog)(),
|
79
|
+
__metadata("design:type", Function),
|
80
|
+
__metadata("design:paramtypes", [String, Object]),
|
81
|
+
__metadata("design:returntype", void 0)
|
82
|
+
], WinstonLoggerService.prototype, "debug", null);
|
83
|
+
__decorate([
|
84
|
+
(0, winston_decorator_1.TraceLog)(),
|
85
|
+
__metadata("design:type", Function),
|
86
|
+
__metadata("design:paramtypes", [String, Object]),
|
87
|
+
__metadata("design:returntype", void 0)
|
88
|
+
], WinstonLoggerService.prototype, "http", null);
|
89
|
+
__decorate([
|
90
|
+
(0, winston_decorator_1.TraceLog)(),
|
91
|
+
__metadata("design:type", Function),
|
92
|
+
__metadata("design:paramtypes", [String, Object]),
|
93
|
+
__metadata("design:returntype", void 0)
|
94
|
+
], WinstonLoggerService.prototype, "verbose", null);
|
95
|
+
__decorate([
|
96
|
+
(0, winston_decorator_1.TraceLog)(),
|
97
|
+
__metadata("design:type", Function),
|
98
|
+
__metadata("design:paramtypes", [String, Object]),
|
99
|
+
__metadata("design:returntype", void 0)
|
100
|
+
], WinstonLoggerService.prototype, "input", null);
|
101
|
+
__decorate([
|
102
|
+
(0, winston_decorator_1.TraceLog)(),
|
103
|
+
__metadata("design:type", Function),
|
104
|
+
__metadata("design:paramtypes", [String, Object]),
|
105
|
+
__metadata("design:returntype", void 0)
|
106
|
+
], WinstonLoggerService.prototype, "silly", null);
|
107
|
+
__decorate([
|
108
|
+
(0, winston_decorator_1.TraceLog)(),
|
109
|
+
__metadata("design:type", Function),
|
110
|
+
__metadata("design:paramtypes", [String, Object]),
|
111
|
+
__metadata("design:returntype", void 0)
|
112
|
+
], WinstonLoggerService.prototype, "error", null);
|
113
|
+
//# sourceMappingURL=winston.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"winston.service.js","sourceRoot":"","sources":["../../../../src/modules/logger/winston.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,2DAA+C;AAQ/C,MAAa,oBAAoB;IAC/B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAG/C,IAAI,CAAC,OAAe,EAAE,IAAU;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,IAAU;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,IAAU;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,IAAU;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAU;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,CAAC,OAAe,EAAE,IAAU;QAChC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,IAAU;QAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,OAAe,EAAE,IAAU;QACjC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAU;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAU;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAU;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CAGF;AAhDD,oDAgDC;AA5CC;IADC,IAAA,4BAAQ,GAAE;;;;gDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;gDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;gDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;gDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;iDAGV;AAKD;IADC,IAAA,4BAAQ,GAAE;;;;gDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;mDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;iDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;iDAGV;AAED;IADC,IAAA,4BAAQ,GAAE;;;;iDAGV"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { NestMiddleware } from '@nestjs/common';
|
2
|
+
import { NextFunction, Request, Response } from 'express';
|
3
|
+
export declare const X_REQUEST_ID_HEADER = "X-Request-ID";
|
4
|
+
export declare const X_RESPONSE_ID_HEADER = "X-Response-ID";
|
5
|
+
import { RouteInfo } from '@nestjs/common/interfaces';
|
6
|
+
interface CtxLocal {
|
7
|
+
local: CtxLocalTraceID;
|
8
|
+
}
|
9
|
+
interface CtxLocalTraceID {
|
10
|
+
traceId: string;
|
11
|
+
}
|
12
|
+
type CtxLocalRequest = Request & CtxLocal;
|
13
|
+
export interface TracingModuleOptions {
|
14
|
+
routes: (string | RouteInfo)[];
|
15
|
+
excludedRoutes?: (string | RouteInfo)[];
|
16
|
+
onRequest?(uuid: string, next: NextFunction): void;
|
17
|
+
}
|
18
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<TracingModuleOptions, "register", "create", {}>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: TracingModuleOptions & Partial<{}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<TracingModuleOptions, "create"> & Partial<{}>;
|
19
|
+
export declare class TracerMiddleware implements NestMiddleware {
|
20
|
+
protected readonly options: typeof OPTIONS_TYPE;
|
21
|
+
constructor(options: typeof OPTIONS_TYPE);
|
22
|
+
use(req: CtxLocalRequest & CtxLocal, res: Response, next: NextFunction): Promise<void>;
|
23
|
+
}
|
24
|
+
export {};
|
@@ -0,0 +1,41 @@
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
+
};
|
14
|
+
var _a;
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
16
|
+
exports.TracerMiddleware = exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = exports.X_RESPONSE_ID_HEADER = exports.X_REQUEST_ID_HEADER = void 0;
|
17
|
+
const common_1 = require("@nestjs/common");
|
18
|
+
const crypto_1 = require("crypto");
|
19
|
+
exports.X_REQUEST_ID_HEADER = 'X-Request-ID';
|
20
|
+
exports.X_RESPONSE_ID_HEADER = 'X-Response-ID';
|
21
|
+
const common_2 = require("@nestjs/common");
|
22
|
+
_a = new common_2.ConfigurableModuleBuilder().build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
23
|
+
let TracerMiddleware = class TracerMiddleware {
|
24
|
+
constructor(options) {
|
25
|
+
this.options = options;
|
26
|
+
}
|
27
|
+
async use(req, res, next) {
|
28
|
+
const { onRequest = (_, next) => next() } = this.options;
|
29
|
+
const uuid = req.header(exports.X_REQUEST_ID_HEADER) ?? (0, crypto_1.randomUUID)();
|
30
|
+
req.local = { traceId: uuid };
|
31
|
+
res.setHeader(exports.X_RESPONSE_ID_HEADER, uuid);
|
32
|
+
onRequest(uuid, next);
|
33
|
+
}
|
34
|
+
};
|
35
|
+
exports.TracerMiddleware = TracerMiddleware;
|
36
|
+
exports.TracerMiddleware = TracerMiddleware = __decorate([
|
37
|
+
(0, common_1.Injectable)(),
|
38
|
+
__param(0, (0, common_1.Inject)(exports.MODULE_OPTIONS_TOKEN)),
|
39
|
+
__metadata("design:paramtypes", [Object])
|
40
|
+
], TracerMiddleware);
|
41
|
+
//# sourceMappingURL=tracer.middleware.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tracer.middleware.js","sourceRoot":"","sources":["../../../../src/modules/tracer/tracer.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoE;AACpE,mCAAoC;AAEvB,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,oBAAoB,GAAG,eAAe,CAAC;AACpD,2CAA2D;AAiB9C,KACX,IAAI,kCAAyB,EAAwB,CAAC,KAAK,EAAE,EADhD,+BAAuB,+BAAE,4BAAoB,4BAAE,oBAAY,oBAAE,0BAAkB,yBAC9B;AAGzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEqB,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAC9C,CAAC;IAEJ,KAAK,CAAC,GAAG,CAAC,GAA+B,EAAE,GAAa,EAAE,IAAkB;QAC1E,MAAM,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACzD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,2BAAmB,CAAC,IAAI,IAAA,mBAAU,GAAE,CAAC;QAC7D,GAAG,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,SAAS,CAAC,4BAAoB,EAAE,IAAI,CAAC,CAAC;QAC1C,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;CACF,CAAA;AAbY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,4BAAoB,CAAC,CAAA;;GAFpB,gBAAgB,CAa5B"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { MiddlewareConsumer, NestModule } from '@nestjs/common';
|
2
|
+
import { ConfigurableModuleClass, OPTIONS_TYPE } from './tracer.middleware';
|
3
|
+
export declare class TracerModule extends ConfigurableModuleClass implements NestModule {
|
4
|
+
protected readonly options: typeof OPTIONS_TYPE;
|
5
|
+
constructor(options: typeof OPTIONS_TYPE);
|
6
|
+
configure(consumer: MiddlewareConsumer): void;
|
7
|
+
}
|
@@ -0,0 +1,36 @@
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.TracerModule = void 0;
|
16
|
+
const common_1 = require("@nestjs/common");
|
17
|
+
const tracer_middleware_1 = require("./tracer.middleware");
|
18
|
+
let TracerModule = class TracerModule extends tracer_middleware_1.ConfigurableModuleClass {
|
19
|
+
constructor(options) {
|
20
|
+
super();
|
21
|
+
this.options = options;
|
22
|
+
}
|
23
|
+
configure(consumer) {
|
24
|
+
const config = consumer.apply(tracer_middleware_1.TracerMiddleware);
|
25
|
+
if (this.options.excludedRoutes)
|
26
|
+
config.exclude(...this.options.excludedRoutes);
|
27
|
+
config.forRoutes(...this.options.routes);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
exports.TracerModule = TracerModule;
|
31
|
+
exports.TracerModule = TracerModule = __decorate([
|
32
|
+
(0, common_1.Module)({}),
|
33
|
+
__param(0, (0, common_1.Inject)(tracer_middleware_1.MODULE_OPTIONS_TOKEN)),
|
34
|
+
__metadata("design:paramtypes", [Object])
|
35
|
+
], TracerModule);
|
36
|
+
//# sourceMappingURL=tracer.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tracer.module.js","sourceRoot":"","sources":["../../../../src/modules/tracer/tracer.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAgF;AAChF,2DAAoH;AAG7G,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2CAAuB;IACvD,YAEqB,OAA4B;QAE/C,KAAK,EAAE,CAAC;QAFW,YAAO,GAAP,OAAO,CAAqB;IAGjD,CAAC;IAED,SAAS,CAAC,QAA4B;QACpC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,oCAAgB,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc;YAAE,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAChF,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AAbY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;IAGN,WAAA,IAAA,eAAM,EAAC,wCAAoB,CAAC,CAAA;;GAFpB,YAAY,CAaxB"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ERoles = void 0;
|
4
|
+
var ERoles;
|
5
|
+
(function (ERoles) {
|
6
|
+
ERoles["admin"] = "admin";
|
7
|
+
ERoles["user"] = "user";
|
8
|
+
})(ERoles || (exports.ERoles = ERoles = {}));
|
9
|
+
//# sourceMappingURL=auth.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/types/auth.ts"],"names":[],"mappings":";;;AAKA,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;AACf,CAAC,EAHW,MAAM,sBAAN,MAAM,QAGjB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './auth';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./auth"), exports);
|
18
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
|