@tc-libs/debugger 0.9.0
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/README.md +11 -0
- package/package.json +11 -0
- package/src/constants/debugger.constant.d.ts +3 -0
- package/src/constants/debugger.constant.js +7 -0
- package/src/constants/debugger.constant.js.map +1 -0
- package/src/constants/index.d.ts +1 -0
- package/src/constants/index.js +5 -0
- package/src/constants/index.js.map +1 -0
- package/src/debugger.module.d.ts +6 -0
- package/src/debugger.module.js +40 -0
- package/src/debugger.module.js.map +1 -0
- package/src/debugger.module.options.d.ts +18 -0
- package/src/debugger.module.options.js +5 -0
- package/src/debugger.module.options.js.map +1 -0
- package/src/debugger.options.module.d.ts +2 -0
- package/src/debugger.options.module.js +27 -0
- package/src/debugger.options.module.js.map +1 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +8 -0
- package/src/index.js.map +1 -0
- package/src/interfaces/debugger.interface.d.ts +17 -0
- package/src/interfaces/debugger.interface.js +14 -0
- package/src/interfaces/debugger.interface.js.map +1 -0
- package/src/interfaces/debugger.options-service.interface.d.ts +7 -0
- package/src/interfaces/debugger.options-service.interface.js +3 -0
- package/src/interfaces/debugger.options-service.interface.js.map +1 -0
- package/src/interfaces/debugger.service.interface.d.ts +11 -0
- package/src/interfaces/debugger.service.interface.js +3 -0
- package/src/interfaces/debugger.service.interface.js.map +1 -0
- package/src/interfaces/debugger.telegram.transport.d.ts +13 -0
- package/src/interfaces/debugger.telegram.transport.js +25 -0
- package/src/interfaces/debugger.telegram.transport.js.map +1 -0
- package/src/interfaces/index.d.ts +4 -0
- package/src/interfaces/index.js +8 -0
- package/src/interfaces/index.js.map +1 -0
- package/src/services/debugger.service.d.ts +29 -0
- package/src/services/debugger.service.js +116 -0
- package/src/services/debugger.service.js.map +1 -0
- package/src/services/index.d.ts +2 -0
- package/src/services/index.js +8 -0
- package/src/services/index.js.map +1 -0
- package/src/services/options/debugger.console.options.service.d.ts +9 -0
- package/src/services/options/debugger.console.options.service.js +87 -0
- package/src/services/options/debugger.console.options.service.js.map +1 -0
- package/src/services/options/debugger.file.options.service.d.ts +11 -0
- package/src/services/options/debugger.file.options.service.js +46 -0
- package/src/services/options/debugger.file.options.service.js.map +1 -0
- package/src/services/options/debugger.telegram.options.service.d.ts +13 -0
- package/src/services/options/debugger.telegram.options.service.js +95 -0
- package/src/services/options/debugger.telegram.options.service.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEBUGGER_TELEGRAM_TOKEN = exports.DEBUGGER_SYSTEM_TOKEN = exports.DEBUGGER_NAME = void 0;
|
|
4
|
+
exports.DEBUGGER_NAME = 'system';
|
|
5
|
+
exports.DEBUGGER_SYSTEM_TOKEN = 'debuggerSystemInjectionToken';
|
|
6
|
+
exports.DEBUGGER_TELEGRAM_TOKEN = 'debuggerTelegramInjectionToken';
|
|
7
|
+
//# sourceMappingURL=debugger.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.constant.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/constants/debugger.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,QAAQ,CAAC;AACzB,QAAA,qBAAqB,GAAG,8BAA8B,CAAC;AACvD,QAAA,uBAAuB,GAAG,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './debugger.constant';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/constants/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import DebuggerModuleAsyncOptions, { DebuggerModuleOptions } from './debugger.module.options';
|
|
3
|
+
export declare class DebuggerModule {
|
|
4
|
+
static register(options: DebuggerModuleOptions, isGlobal?: boolean): DynamicModule;
|
|
5
|
+
static registerAsync(options: DebuggerModuleAsyncOptions, isGlobal?: boolean): DynamicModule;
|
|
6
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerModule = void 0;
|
|
4
|
+
const debugger_module_options_1 = require("./debugger.module.options");
|
|
5
|
+
const debugger_options_module_1 = require("./debugger.options.module");
|
|
6
|
+
const debugger_service_1 = require("./services/debugger.service");
|
|
7
|
+
class DebuggerModule {
|
|
8
|
+
static register(options, isGlobal) {
|
|
9
|
+
return {
|
|
10
|
+
module: DebuggerModule,
|
|
11
|
+
providers: [
|
|
12
|
+
{ provide: debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS, useValue: options },
|
|
13
|
+
debugger_service_1.DebuggerService,
|
|
14
|
+
],
|
|
15
|
+
exports: [debugger_service_1.DebuggerService],
|
|
16
|
+
controllers: [],
|
|
17
|
+
imports: [debugger_options_module_1.DebuggerOptionsModule],
|
|
18
|
+
global: isGlobal,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static registerAsync(options, isGlobal) {
|
|
22
|
+
return {
|
|
23
|
+
module: DebuggerModule,
|
|
24
|
+
imports: [...(options.imports || []), debugger_options_module_1.DebuggerOptionsModule],
|
|
25
|
+
providers: [
|
|
26
|
+
{
|
|
27
|
+
provide: debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS,
|
|
28
|
+
useFactory: options.useFactory,
|
|
29
|
+
inject: options.inject,
|
|
30
|
+
},
|
|
31
|
+
debugger_service_1.DebuggerService,
|
|
32
|
+
],
|
|
33
|
+
exports: [debugger_service_1.DebuggerService],
|
|
34
|
+
controllers: [],
|
|
35
|
+
global: isGlobal,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.DebuggerModule = DebuggerModule;
|
|
40
|
+
//# sourceMappingURL=debugger.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.module.js","sourceRoot":"","sources":["../../../../packages/debugger/src/debugger.module.ts"],"names":[],"mappings":";;;AACA,uEAGmC;AACnC,uEAAkE;AAClE,kEAA8D;AAE9D,MAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,CACb,OAA8B,EAC9B,QAAkB;QAElB,OAAO;YACL,MAAM,EAAE,cAAc;YACtB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,iDAAuB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBACvD,kCAAe;aAChB;YACD,OAAO,EAAE,CAAC,kCAAe,CAAC;YAC1B,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,CAAC,+CAAqB,CAAC;YAChC,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,aAAa,CAClB,OAAmC,EACnC,QAAkB;QAElB,OAAO;YACL,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,+CAAqB,CAAC;YAC5D,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,iDAAuB;oBAChC,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;iBACvB;gBACD,kCAAe;aAChB;YACD,OAAO,EAAE,CAAC,kCAAe,CAAC;YAC1B,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;CACF;AArCD,wCAqCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ModuleMetadata } from '@nestjs/common';
|
|
2
|
+
import { FactoryProvider } from '@nestjs/common/interfaces/modules/provider.interface';
|
|
3
|
+
export declare const DEBUGGER_CONFIG_OPTIONS = "DEBUGGER_CONFIG_OPTIONS";
|
|
4
|
+
export interface DebuggerModuleOptions {
|
|
5
|
+
system: {
|
|
6
|
+
writeIntoConsole: boolean;
|
|
7
|
+
writeIntoTelegram: boolean;
|
|
8
|
+
writeIntoFile: boolean;
|
|
9
|
+
maxSize: string;
|
|
10
|
+
maxFiles: string;
|
|
11
|
+
};
|
|
12
|
+
telegram: {
|
|
13
|
+
chatId: string;
|
|
14
|
+
apiToken: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
type DebuggerModuleAsyncOptions = Pick<ModuleMetadata, 'imports'> & Pick<FactoryProvider<DebuggerModuleOptions>, 'useFactory' | 'inject'>;
|
|
18
|
+
export default DebuggerModuleAsyncOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.module.options.js","sourceRoot":"","sources":["../../../../packages/debugger/src/debugger.module.options.ts"],"names":[],"mappings":";;;AAGa,QAAA,uBAAuB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerOptionsModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const services_1 = require("./services");
|
|
7
|
+
const debugger_file_options_service_1 = require("./services/options/debugger.file.options.service");
|
|
8
|
+
const debugger_telegram_options_service_1 = require("./services/options/debugger.telegram.options.service");
|
|
9
|
+
let DebuggerOptionsModule = class DebuggerOptionsModule {
|
|
10
|
+
};
|
|
11
|
+
exports.DebuggerOptionsModule = DebuggerOptionsModule;
|
|
12
|
+
exports.DebuggerOptionsModule = DebuggerOptionsModule = tslib_1.__decorate([
|
|
13
|
+
(0, common_1.Module)({
|
|
14
|
+
providers: [
|
|
15
|
+
services_1.DebuggerConsoleOptionService,
|
|
16
|
+
debugger_file_options_service_1.DebuggerFileOptionService,
|
|
17
|
+
debugger_telegram_options_service_1.DebuggerTelegramOptionService,
|
|
18
|
+
],
|
|
19
|
+
exports: [
|
|
20
|
+
services_1.DebuggerConsoleOptionService,
|
|
21
|
+
debugger_file_options_service_1.DebuggerFileOptionService,
|
|
22
|
+
debugger_telegram_options_service_1.DebuggerTelegramOptionService,
|
|
23
|
+
],
|
|
24
|
+
imports: [],
|
|
25
|
+
})
|
|
26
|
+
], DebuggerOptionsModule);
|
|
27
|
+
//# sourceMappingURL=debugger.options.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.options.module.js","sourceRoot":"","sources":["../../../../packages/debugger/src/debugger.options.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,yCAA0D;AAC1D,oGAA6F;AAC7F,4GAAqG;AAe9F,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAbjC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,uCAA4B;YAC5B,yDAAyB;YACzB,iEAA6B;SAC9B;QACD,OAAO,EAAE;YACP,uCAA4B;YAC5B,yDAAyB;YACzB,iEAA6B;SAC9B;QACD,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,qBAAqB,CAAG"}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./debugger.module"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./services"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./interfaces"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/debugger/src/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,qDAA2B;AAC3B,uDAA6B;AAC7B,sDAA4B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface IDebuggerHttpLog {
|
|
2
|
+
description: string;
|
|
3
|
+
class?: string;
|
|
4
|
+
function?: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
stack?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class DebuggerHttpBody {
|
|
10
|
+
reqId: string;
|
|
11
|
+
class: string;
|
|
12
|
+
function: string;
|
|
13
|
+
path: string;
|
|
14
|
+
data: any;
|
|
15
|
+
exception?: Error;
|
|
16
|
+
constructor(requestId: string, log: IDebuggerHttpLog, exception?: Error);
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerHttpBody = void 0;
|
|
4
|
+
class DebuggerHttpBody {
|
|
5
|
+
constructor(requestId, log, exception) {
|
|
6
|
+
this.reqId = requestId;
|
|
7
|
+
this.class = log.class ?? 'no-class';
|
|
8
|
+
this.function = log.function ?? 'no-function';
|
|
9
|
+
this.path = log.path ?? 'no-path';
|
|
10
|
+
this.exception = exception;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.DebuggerHttpBody = DebuggerHttpBody;
|
|
14
|
+
//# sourceMappingURL=debugger.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.interface.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/interfaces/debugger.interface.ts"],"names":[],"mappings":";;;AASA,MAAa,gBAAgB;IAO3B,YAAY,SAAiB,EAAE,GAAqB,EAAE,SAAiB;QACrE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,UAAU,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,SAAS,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AAdD,4CAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.options-service.interface.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/interfaces/debugger.options-service.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDebuggerHttpLog } from './debugger.interface';
|
|
2
|
+
export interface IDebuggerService {
|
|
3
|
+
info(message: string, data?: any): void;
|
|
4
|
+
debug(message: string, data?: any): void;
|
|
5
|
+
warn(message: string, data?: any): void;
|
|
6
|
+
error(message: string, data?: any): void;
|
|
7
|
+
infoHttp(requestId: string, log: IDebuggerHttpLog, data?: any): void;
|
|
8
|
+
debugHttp(requestId: string, log: IDebuggerHttpLog, data?: any): void;
|
|
9
|
+
warnHttp(requestId: string, log: IDebuggerHttpLog, data?: any): void;
|
|
10
|
+
errorHttp(requestId: string, log: IDebuggerHttpLog, data?: any): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.service.interface.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/interfaces/debugger.service.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TransportStreamOptions } from 'winston-transport';
|
|
2
|
+
import Transport from 'winston-transport';
|
|
3
|
+
interface TelegramTransportOpts extends TransportStreamOptions {
|
|
4
|
+
token?: string;
|
|
5
|
+
chatId?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class TelegramTransport extends Transport {
|
|
8
|
+
private _bot;
|
|
9
|
+
private _chatId;
|
|
10
|
+
constructor(opts: TelegramTransportOpts);
|
|
11
|
+
log(info: any, cb: () => void): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelegramTransport = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const winston_transport_1 = tslib_1.__importDefault(require("winston-transport"));
|
|
6
|
+
const telegraf_1 = require("telegraf");
|
|
7
|
+
class TelegramTransport extends winston_transport_1.default {
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
super(opts);
|
|
10
|
+
if (opts.token)
|
|
11
|
+
this._bot = new telegraf_1.Telegraf(opts.token);
|
|
12
|
+
this._chatId = opts.chatId;
|
|
13
|
+
}
|
|
14
|
+
log(info, cb) {
|
|
15
|
+
if (!this._bot || !this._chatId)
|
|
16
|
+
return cb();
|
|
17
|
+
const msg = info[Symbol.for('message')];
|
|
18
|
+
this._bot.telegram.sendMessage(this._chatId, msg, {
|
|
19
|
+
parse_mode: 'HTML',
|
|
20
|
+
});
|
|
21
|
+
return cb();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.TelegramTransport = TelegramTransport;
|
|
25
|
+
//# sourceMappingURL=debugger.telegram.transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.telegram.transport.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/interfaces/debugger.telegram.transport.ts"],"names":[],"mappings":";;;;AACA,kFAA0C;AAC1C,uCAAoC;AAOpC,MAAa,iBAAkB,SAAQ,2BAAS;IAG9C,YAAY,IAA2B;QACrC,KAAK,CAAC,IAA8B,CAAC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC;IAC7B,CAAC;IACQ,GAAG,CAAC,IAAS,EAAE,EAAc;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,EAAE,CAAC;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;YAChD,UAAU,EAAE,MAAM;SACnB,CAAC,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;CACF;AAhBD,8CAgBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./debugger.interface"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./debugger.options-service.interface"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./debugger.service.interface"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./debugger.telegram.transport"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,+EAAqD;AACrD,uEAA6C;AAC7C,wEAA8C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IDebuggerService } from '../interfaces/debugger.service.interface';
|
|
2
|
+
import { IDebuggerHttpLog } from '../interfaces/debugger.interface';
|
|
3
|
+
import { DebuggerConsoleOptionService } from './options/debugger.console.options.service';
|
|
4
|
+
import { DebuggerFileOptionService } from './options/debugger.file.options.service';
|
|
5
|
+
import { DebuggerTelegramOptionService } from './options/debugger.telegram.options.service';
|
|
6
|
+
import { DebuggerModuleOptions } from '../debugger.module.options';
|
|
7
|
+
export declare class DebuggerService implements IDebuggerService {
|
|
8
|
+
private readonly _options;
|
|
9
|
+
private readonly _consoleOptions;
|
|
10
|
+
private readonly _fileOptions;
|
|
11
|
+
private readonly _telegramOptions;
|
|
12
|
+
private readonly writeIntoFile;
|
|
13
|
+
private readonly writeIntoConsole;
|
|
14
|
+
private readonly writeIntoTelegram;
|
|
15
|
+
private _consoleLogger;
|
|
16
|
+
private _fileLogger;
|
|
17
|
+
private _fileErrorLogger;
|
|
18
|
+
private _fileDefaultLogger;
|
|
19
|
+
private _telegramLogger;
|
|
20
|
+
constructor(_options: DebuggerModuleOptions, _consoleOptions: DebuggerConsoleOptionService, _fileOptions: DebuggerFileOptionService, _telegramOptions: DebuggerTelegramOptionService);
|
|
21
|
+
info(message: string, data: any): void;
|
|
22
|
+
debug(message: string, data: any): void;
|
|
23
|
+
warn(message: string, data: any): void;
|
|
24
|
+
error(message: string, data: any): void;
|
|
25
|
+
infoHttp(requestId: string, log: IDebuggerHttpLog, error?: any): void;
|
|
26
|
+
debugHttp(requestId: string, log: IDebuggerHttpLog, error?: any): void;
|
|
27
|
+
warnHttp(requestId: string, log: IDebuggerHttpLog, error?: any): void;
|
|
28
|
+
errorHttp(requestId: string, log: IDebuggerHttpLog, error?: any): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const winston_1 = require("winston");
|
|
7
|
+
const debugger_interface_1 = require("../interfaces/debugger.interface");
|
|
8
|
+
const debugger_console_options_service_1 = require("./options/debugger.console.options.service");
|
|
9
|
+
const debugger_file_options_service_1 = require("./options/debugger.file.options.service");
|
|
10
|
+
const debugger_telegram_options_service_1 = require("./options/debugger.telegram.options.service");
|
|
11
|
+
const debugger_module_options_1 = require("../debugger.module.options");
|
|
12
|
+
let DebuggerService = class DebuggerService {
|
|
13
|
+
constructor(_options, _consoleOptions, _fileOptions, _telegramOptions) {
|
|
14
|
+
this._options = _options;
|
|
15
|
+
this._consoleOptions = _consoleOptions;
|
|
16
|
+
this._fileOptions = _fileOptions;
|
|
17
|
+
this._telegramOptions = _telegramOptions;
|
|
18
|
+
// logger = WinstonModule.createLogger({
|
|
19
|
+
// transports: [new winston.transports.File({ filename: 'combined.log' })],
|
|
20
|
+
// });
|
|
21
|
+
this.writeIntoConsole = this._options.system.writeIntoConsole;
|
|
22
|
+
this.writeIntoTelegram = this._options.system.writeIntoTelegram;
|
|
23
|
+
this.writeIntoFile = this._options.system.writeIntoFile;
|
|
24
|
+
if (this.writeIntoConsole) {
|
|
25
|
+
const consoleOptions = this._consoleOptions.createLoggerOptions();
|
|
26
|
+
this._consoleLogger = (0, winston_1.createLogger)(consoleOptions);
|
|
27
|
+
}
|
|
28
|
+
if (this.writeIntoTelegram) {
|
|
29
|
+
const telegramOptions = this._telegramOptions.createLoggerOptions();
|
|
30
|
+
this._telegramLogger = (0, winston_1.createLogger)(telegramOptions);
|
|
31
|
+
}
|
|
32
|
+
if (this.writeIntoFile) {
|
|
33
|
+
const fileErrorOptions = this._fileOptions.createLoggerOptions({
|
|
34
|
+
level: 'error',
|
|
35
|
+
});
|
|
36
|
+
const fileDefaultOptions = this._fileOptions.createLoggerOptions();
|
|
37
|
+
this._fileErrorLogger = (0, winston_1.createLogger)(fileErrorOptions);
|
|
38
|
+
this._fileDefaultLogger = (0, winston_1.createLogger)(fileDefaultOptions);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
info(message, data) {
|
|
42
|
+
if (this.writeIntoConsole)
|
|
43
|
+
this._consoleLogger.log('info', message, data);
|
|
44
|
+
if (this.writeIntoFile)
|
|
45
|
+
this._fileDefaultLogger.info(message, data);
|
|
46
|
+
if (this.writeIntoTelegram)
|
|
47
|
+
this._telegramLogger.info(message, data);
|
|
48
|
+
}
|
|
49
|
+
debug(message, data) {
|
|
50
|
+
if (this.writeIntoConsole)
|
|
51
|
+
this._consoleLogger.log('debug', message, data);
|
|
52
|
+
if (this.writeIntoFile)
|
|
53
|
+
this._fileDefaultLogger.debug(message, data);
|
|
54
|
+
}
|
|
55
|
+
warn(message, data) {
|
|
56
|
+
if (this.writeIntoConsole)
|
|
57
|
+
this._consoleLogger.log('warn', message, data);
|
|
58
|
+
if (this.writeIntoFile)
|
|
59
|
+
this._fileDefaultLogger.warn(message, data);
|
|
60
|
+
if (this.writeIntoTelegram)
|
|
61
|
+
this._telegramLogger.warn(message, data);
|
|
62
|
+
}
|
|
63
|
+
error(message, data) {
|
|
64
|
+
if (this.writeIntoConsole)
|
|
65
|
+
this._consoleLogger.log('error', message, data);
|
|
66
|
+
if (this.writeIntoFile)
|
|
67
|
+
this._fileErrorLogger.error(message, data);
|
|
68
|
+
if (this.writeIntoTelegram)
|
|
69
|
+
this._telegramLogger.error(message, data);
|
|
70
|
+
}
|
|
71
|
+
infoHttp(requestId, log, error) {
|
|
72
|
+
const body = new debugger_interface_1.DebuggerHttpBody(requestId, log, error);
|
|
73
|
+
if (this.writeIntoConsole)
|
|
74
|
+
this._consoleLogger.log('info', log.description, body);
|
|
75
|
+
if (this.writeIntoFile)
|
|
76
|
+
this._fileDefaultLogger.info(log.description, body);
|
|
77
|
+
if (this.writeIntoTelegram)
|
|
78
|
+
this._telegramLogger.info(log.description, body);
|
|
79
|
+
}
|
|
80
|
+
debugHttp(requestId, log, error) {
|
|
81
|
+
const body = new debugger_interface_1.DebuggerHttpBody(requestId, log, error);
|
|
82
|
+
if (this.writeIntoConsole)
|
|
83
|
+
this._consoleLogger.log('debug', log.description, body);
|
|
84
|
+
if (this.writeIntoFile)
|
|
85
|
+
this._fileDefaultLogger.debug(log.description, body);
|
|
86
|
+
if (this.writeIntoTelegram)
|
|
87
|
+
this._telegramLogger.debug(log.description, body);
|
|
88
|
+
}
|
|
89
|
+
warnHttp(requestId, log, error) {
|
|
90
|
+
const body = new debugger_interface_1.DebuggerHttpBody(requestId, log, error);
|
|
91
|
+
if (this.writeIntoConsole)
|
|
92
|
+
this._consoleLogger.log('warn', log.description, body);
|
|
93
|
+
if (this.writeIntoFile)
|
|
94
|
+
this._fileDefaultLogger.warn(log.description, body);
|
|
95
|
+
if (this.writeIntoTelegram)
|
|
96
|
+
this._telegramLogger.warn(log.description, body);
|
|
97
|
+
}
|
|
98
|
+
errorHttp(requestId, log, error) {
|
|
99
|
+
const body = new debugger_interface_1.DebuggerHttpBody(requestId, log, error);
|
|
100
|
+
if (this.writeIntoConsole)
|
|
101
|
+
this._consoleLogger.log('error', log.description, body);
|
|
102
|
+
if (this.writeIntoFile)
|
|
103
|
+
this._fileErrorLogger.error(log.description, body);
|
|
104
|
+
if (this.writeIntoTelegram)
|
|
105
|
+
this._telegramLogger.error(log.description, body);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
exports.DebuggerService = DebuggerService;
|
|
109
|
+
exports.DebuggerService = DebuggerService = tslib_1.__decorate([
|
|
110
|
+
(0, common_1.Injectable)(),
|
|
111
|
+
tslib_1.__param(0, (0, common_1.Inject)(debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS)),
|
|
112
|
+
tslib_1.__metadata("design:paramtypes", [Object, debugger_console_options_service_1.DebuggerConsoleOptionService,
|
|
113
|
+
debugger_file_options_service_1.DebuggerFileOptionService,
|
|
114
|
+
debugger_telegram_options_service_1.DebuggerTelegramOptionService])
|
|
115
|
+
], DebuggerService);
|
|
116
|
+
//# sourceMappingURL=debugger.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.service.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/services/debugger.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,qCAA+C;AAG/C,yEAG0C;AAC1C,iGAA0F;AAC1F,2FAAoF;AACpF,mGAA4F;AAC5F,wEAGoC;AAG7B,IAAM,eAAe,GAArB,MAAM,eAAe;IAU1B,YAImB,QAA+B,EAC/B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
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./options/debugger.console.options.service"), exports);
|
|
5
|
+
// export * from './options/debugger.file.options.service';
|
|
6
|
+
// export * from './options/debugger.telegram.options.service';
|
|
7
|
+
tslib_1.__exportStar(require("./debugger.service"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/debugger/src/services/index.ts"],"names":[],"mappings":";;;AAAA,qFAA2D;AAC3D,2DAA2D;AAC3D,+DAA+D;AAC/D,6DAAmC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LoggerOptions } from 'winston';
|
|
2
|
+
import { IDebuggerOptionService } from '../../interfaces/debugger.options-service.interface';
|
|
3
|
+
import { DebuggerModuleOptions } from '../../debugger.module.options';
|
|
4
|
+
export declare class DebuggerConsoleOptionService implements IDebuggerOptionService {
|
|
5
|
+
private readonly _options;
|
|
6
|
+
private readonly writeIntoConsole;
|
|
7
|
+
constructor(_options: DebuggerModuleOptions);
|
|
8
|
+
createLoggerOptions(): LoggerOptions;
|
|
9
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerConsoleOptionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const winston_1 = require("winston");
|
|
7
|
+
const winston_2 = tslib_1.__importDefault(require("winston"));
|
|
8
|
+
const errors_1 = require("@tc-libs/errors");
|
|
9
|
+
const debugger_module_options_1 = require("../../debugger.module.options");
|
|
10
|
+
const { combine, errors, colorize, metadata, timestamp, printf } = winston_1.format;
|
|
11
|
+
let DebuggerConsoleOptionService = class DebuggerConsoleOptionService {
|
|
12
|
+
constructor(_options) {
|
|
13
|
+
this._options = _options;
|
|
14
|
+
this.writeIntoConsole = this._options.system.writeIntoConsole;
|
|
15
|
+
}
|
|
16
|
+
createLoggerOptions() {
|
|
17
|
+
const transports = [];
|
|
18
|
+
if (this.writeIntoConsole) {
|
|
19
|
+
transports.push(new winston_2.default.transports.Console());
|
|
20
|
+
}
|
|
21
|
+
const loggerOptions = {
|
|
22
|
+
format: combine(errors({ stack: true }), colorize({
|
|
23
|
+
all: true,
|
|
24
|
+
colors: {
|
|
25
|
+
debug: 'gray',
|
|
26
|
+
info: 'green',
|
|
27
|
+
warn: 'yellow',
|
|
28
|
+
error: 'red',
|
|
29
|
+
},
|
|
30
|
+
}), metadata({ fillExcept: ['message', 'level', 'timestamp', 'label'] }), timestamp({
|
|
31
|
+
format: 'DD/MM/YY HH:mm:ss Z',
|
|
32
|
+
}), printf(({ timestamp, level, message, metadata: meta }) => {
|
|
33
|
+
// formating the log outcome to show/store
|
|
34
|
+
const tokens = [`${timestamp} ${level}: ${message}`];
|
|
35
|
+
// meta is DebuggerHttpBody
|
|
36
|
+
if (meta && meta.reqId && meta.class && meta.function && meta.path) {
|
|
37
|
+
const body = meta;
|
|
38
|
+
try {
|
|
39
|
+
let errorMessage, errorStack, errorData;
|
|
40
|
+
if (body.exception instanceof Error) {
|
|
41
|
+
errorMessage = body.exception.message;
|
|
42
|
+
errorStack = body.exception.stack;
|
|
43
|
+
if (body.exception instanceof errors_1.ApiError)
|
|
44
|
+
errorData = body.exception.data;
|
|
45
|
+
}
|
|
46
|
+
tokens.push(`\x1b[35;1mRequest ID:\x1b[0m \x1b[35m${body.reqId}\x1b[0m`);
|
|
47
|
+
tokens.push(`\x1b[35;1mApi:\x1b[0m \x1b[35m${body.path}\x1b[0m`);
|
|
48
|
+
tokens.push(`\x1b[35;1mController:\x1b[0m \x1b[35m${body.class}.${body.function}\x1b[0m`);
|
|
49
|
+
// tokens.push(`\x1b[35m${JSON.stringify(meta, null, 2)}\x1b[0m`);
|
|
50
|
+
if (errorMessage) {
|
|
51
|
+
tokens.push(`\x1b[31;1mError\x1b[0m`);
|
|
52
|
+
tokens.push(`\x1b[31m${errorMessage}\x1b[0m`);
|
|
53
|
+
}
|
|
54
|
+
if (errorData) {
|
|
55
|
+
tokens.push(`\x1b[31m${JSON.stringify(errorData, null, 2)}\x1b[0m`);
|
|
56
|
+
}
|
|
57
|
+
if (errorStack)
|
|
58
|
+
tokens.push(`\x1b[31m${errorStack}\x1b[0m`);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// tslint:disable-next-line:no-console
|
|
62
|
+
console.error('Cannot stringify:', meta);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else if (meta && Object.keys(meta).length) {
|
|
66
|
+
try {
|
|
67
|
+
tokens.push(`\x1b[35m${JSON.stringify(meta, null, 2)}\x1b[0m`);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// tslint:disable-next-line:no-console
|
|
71
|
+
console.error('Cannot stringify:', meta);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return tokens.join('\n');
|
|
75
|
+
})),
|
|
76
|
+
transports,
|
|
77
|
+
};
|
|
78
|
+
return loggerOptions;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
exports.DebuggerConsoleOptionService = DebuggerConsoleOptionService;
|
|
82
|
+
exports.DebuggerConsoleOptionService = DebuggerConsoleOptionService = tslib_1.__decorate([
|
|
83
|
+
(0, common_1.Injectable)(),
|
|
84
|
+
tslib_1.__param(0, (0, common_1.Inject)(debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS)),
|
|
85
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
86
|
+
], DebuggerConsoleOptionService);
|
|
87
|
+
//# sourceMappingURL=debugger.console.options.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.console.options.service.js","sourceRoot":"","sources":["../../../../../../packages/debugger/src/services/options/debugger.console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CAAC;wBACP,sCAAsC;wBACtC,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC;qBAAM,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;oBAC5C,IAAI,CAAC;wBACH,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;oBACjE,CAAC;oBAAC,MAAM,CAAC;wBACP,sCAAsC;wBACtC,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC;gBACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAC,CACH;YACD,UAAU;SACX,CAAC;QAEF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AArFY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;IAKR,mBAAA,IAAA,eAAM,EAAC,iDAAuB,CAAC,CAAA;;GAJvB,4BAA4B,CAqFxC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LoggerOptions } from 'winston';
|
|
2
|
+
import { IDebuggerOptionService, IDebuggerOptionServiceOptions } from '../../interfaces/debugger.options-service.interface';
|
|
3
|
+
import { DebuggerModuleOptions } from '../../debugger.module.options';
|
|
4
|
+
export declare class DebuggerFileOptionService implements IDebuggerOptionService {
|
|
5
|
+
private readonly _options;
|
|
6
|
+
private readonly writeIntoFile;
|
|
7
|
+
private readonly maxSize;
|
|
8
|
+
private readonly maxFiles;
|
|
9
|
+
constructor(_options: DebuggerModuleOptions);
|
|
10
|
+
createLoggerOptions(options?: IDebuggerOptionServiceOptions): LoggerOptions;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerFileOptionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const winston_1 = require("winston");
|
|
7
|
+
const winston_daily_rotate_file_1 = tslib_1.__importDefault(require("winston-daily-rotate-file"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const debugger_module_options_1 = require("../../debugger.module.options");
|
|
10
|
+
const { combine, timestamp, prettyPrint } = winston_1.format;
|
|
11
|
+
let DebuggerFileOptionService = class DebuggerFileOptionService {
|
|
12
|
+
constructor(_options) {
|
|
13
|
+
this._options = _options;
|
|
14
|
+
this.writeIntoFile = this._options.system.writeIntoFile;
|
|
15
|
+
this.maxSize = this._options.system.maxSize;
|
|
16
|
+
this.maxFiles = this._options.system.maxFiles;
|
|
17
|
+
}
|
|
18
|
+
createLoggerOptions(options) {
|
|
19
|
+
const transports = [];
|
|
20
|
+
if (this.writeIntoFile) {
|
|
21
|
+
const transportOptions = {
|
|
22
|
+
filename: `%DATE%.log`,
|
|
23
|
+
dirname: `logs/${constants_1.DEBUGGER_NAME}/${options && options.level ? options.level : 'default'}`,
|
|
24
|
+
datePattern: 'YYYY-MM-DD',
|
|
25
|
+
zippedArchive: true,
|
|
26
|
+
maxSize: this.maxSize,
|
|
27
|
+
maxFiles: this.maxFiles,
|
|
28
|
+
};
|
|
29
|
+
if (options && options.level)
|
|
30
|
+
transportOptions.level = options.level;
|
|
31
|
+
transports.push(new winston_daily_rotate_file_1.default(transportOptions));
|
|
32
|
+
}
|
|
33
|
+
const loggerOptions = {
|
|
34
|
+
format: combine(timestamp({ format: 'DD/MM HH:mm:ss Z' }), prettyPrint()),
|
|
35
|
+
transports,
|
|
36
|
+
};
|
|
37
|
+
return loggerOptions;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.DebuggerFileOptionService = DebuggerFileOptionService;
|
|
41
|
+
exports.DebuggerFileOptionService = DebuggerFileOptionService = tslib_1.__decorate([
|
|
42
|
+
(0, common_1.Injectable)(),
|
|
43
|
+
tslib_1.__param(0, (0, common_1.Inject)(debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS)),
|
|
44
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
45
|
+
], DebuggerFileOptionService);
|
|
46
|
+
//# sourceMappingURL=debugger.file.options.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.file.options.service.js","sourceRoot":"","sources":["../../../../../../packages/debugger/src/services/options/debugger.file.options.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,qCAAgD;AAChD,kGAAwD;AAMxD,+CAAgD;AAChD,2EAGuC;AACvC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,gBAAM,CAAC;AAG5C,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAKpC,YAEmB,QAA+B;QAA/B,aAAQ,GAAR,QAAQ,CAAuB;QAEhD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC;IAChD,CAAC;IAED,mBAAmB,CAAC,OAAuC;QACzD,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,MAAM,gBAAgB,GAAoC;gBACxD,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,QAAQ,yBAAa,IAC5B,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAC7C,EAAE;gBACF,WAAW,EAAE,YAAY;gBACzB,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC;YACF,IAAI,OAAO,IAAI,OAAO,CAAC,KAAK;gBAAE,gBAAgB,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YACrE,UAAU,CAAC,IAAI,CAAC,IAAI,mCAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,aAAa,GAAkB;YACnC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC;YACzE,UAAU;SACX,CAAC;QAEF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAA;AArCY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;IAOR,mBAAA,IAAA,eAAM,EAAC,iDAAuB,CAAC,CAAA;;GANvB,yBAAyB,CAqCrC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LoggerOptions } from 'winston';
|
|
2
|
+
import { IDebuggerOptionService } from '../../interfaces';
|
|
3
|
+
import { DebuggerModuleOptions } from '../../debugger.module.options';
|
|
4
|
+
export declare class DebuggerTelegramOptionService implements IDebuggerOptionService {
|
|
5
|
+
private readonly _options;
|
|
6
|
+
private readonly writeIntoTelegram;
|
|
7
|
+
private readonly telegramChatId;
|
|
8
|
+
private readonly telegramApiToken;
|
|
9
|
+
private readonly _badges;
|
|
10
|
+
constructor(_options: DebuggerModuleOptions);
|
|
11
|
+
private _sanitize;
|
|
12
|
+
createLoggerOptions(): LoggerOptions;
|
|
13
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DebuggerTelegramOptionService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const winston_1 = require("winston");
|
|
7
|
+
const debugger_telegram_transport_1 = require("../../interfaces/debugger.telegram.transport");
|
|
8
|
+
const errors_1 = require("@tc-libs/errors");
|
|
9
|
+
const debugger_module_options_1 = require("../../debugger.module.options");
|
|
10
|
+
const { combine, timestamp, metadata, printf } = winston_1.format;
|
|
11
|
+
let DebuggerTelegramOptionService = class DebuggerTelegramOptionService {
|
|
12
|
+
constructor(_options) {
|
|
13
|
+
this._options = _options;
|
|
14
|
+
this._badges = {
|
|
15
|
+
debug: '⚪',
|
|
16
|
+
info: '🔵',
|
|
17
|
+
warn: '🟡',
|
|
18
|
+
error: '🔴',
|
|
19
|
+
};
|
|
20
|
+
this.writeIntoTelegram = this._options.system.writeIntoTelegram;
|
|
21
|
+
if (this.writeIntoTelegram) {
|
|
22
|
+
this.telegramChatId = this._options.telegram.chatId;
|
|
23
|
+
this.telegramApiToken = this._options.telegram.apiToken;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_sanitize(str) {
|
|
27
|
+
return str.replace(/[\u00A0-\u9999<>&]/g, (i) => {
|
|
28
|
+
return '&#' + i.charCodeAt(0) + ';';
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
createLoggerOptions() {
|
|
32
|
+
const transports = [];
|
|
33
|
+
if (this.writeIntoTelegram) {
|
|
34
|
+
transports.push(new debugger_telegram_transport_1.TelegramTransport({
|
|
35
|
+
token: this.telegramApiToken,
|
|
36
|
+
chatId: this.telegramChatId,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
const loggerOptions = {
|
|
40
|
+
format: combine(metadata({ fillExcept: ['message', 'level', 'timestamp', 'label'] }), timestamp({ format: 'DD/MM HH:mm:ss Z' }), printf(({ level, message, metadata: meta, timestamp }) => {
|
|
41
|
+
const bedge = this._badges[level];
|
|
42
|
+
const tokens = [`${bedge}`];
|
|
43
|
+
// meta is DebuggerHttpBody
|
|
44
|
+
if (meta && meta.reqId && meta.class && meta.function && meta.path) {
|
|
45
|
+
const body = meta;
|
|
46
|
+
if (body.exception && body.exception.message) {
|
|
47
|
+
tokens.push(`💥 <b>${this._sanitize(body.exception.message)}</b>`);
|
|
48
|
+
}
|
|
49
|
+
tokens.push('<b>Message</b>');
|
|
50
|
+
tokens.push(message);
|
|
51
|
+
tokens.push('<b>Request ID</b>');
|
|
52
|
+
tokens.push(`<code>${this._sanitize(body.reqId)}</code>`);
|
|
53
|
+
tokens.push('<b>Api</b>');
|
|
54
|
+
tokens.push(`<pre>${this._sanitize(JSON.stringify({
|
|
55
|
+
api: body.path,
|
|
56
|
+
class: body.class,
|
|
57
|
+
function: body.function,
|
|
58
|
+
}, null, 2))}</pre>`);
|
|
59
|
+
if (body.exception &&
|
|
60
|
+
body.exception instanceof errors_1.ApiError &&
|
|
61
|
+
body.exception.data) {
|
|
62
|
+
tokens.push('<b>Data</b>');
|
|
63
|
+
tokens.push(`<pre>${this._sanitize(JSON.stringify(body.exception.data, null, 2))}</pre>`);
|
|
64
|
+
}
|
|
65
|
+
if (body.exception && body.exception.stack) {
|
|
66
|
+
const stack = body.exception.stack
|
|
67
|
+
.split('\n', 20)
|
|
68
|
+
.join('\n');
|
|
69
|
+
tokens.push('<b>Stacktrace</b>');
|
|
70
|
+
tokens.push(`<pre>${this._sanitize(stack)}</pre>`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
tokens.push('<b>Message</b>');
|
|
75
|
+
tokens.push(message);
|
|
76
|
+
if (meta) {
|
|
77
|
+
tokens.push(`<pre>${this._sanitize(JSON.stringify(meta, null, 2))}</pre>`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
tokens.push('<b>Timestamp</b>');
|
|
81
|
+
tokens.push(`<i>${timestamp}</i>`);
|
|
82
|
+
return tokens.join('\n').replace('.', '.');
|
|
83
|
+
})),
|
|
84
|
+
transports,
|
|
85
|
+
};
|
|
86
|
+
return loggerOptions;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
exports.DebuggerTelegramOptionService = DebuggerTelegramOptionService;
|
|
90
|
+
exports.DebuggerTelegramOptionService = DebuggerTelegramOptionService = tslib_1.__decorate([
|
|
91
|
+
(0, common_1.Injectable)(),
|
|
92
|
+
tslib_1.__param(0, (0, common_1.Inject)(debugger_module_options_1.DEBUGGER_CONFIG_OPTIONS)),
|
|
93
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
94
|
+
], DebuggerTelegramOptionService);
|
|
95
|
+
//# sourceMappingURL=debugger.telegram.options.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.telegram.options.service.js","sourceRoot":"","sources":["../../../../../../packages/debugger/src/services/options/debugger.telegram.options.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,qCAAgD;AAChD,8FAAiF;AAGjF,4CAA2C;AAC3C,2EAGuC;AACvC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,gBAAM,CAAC;AAGjD,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAaxC,YAEE,QAAgD;QAA/B,aAAQ,GAAR,QAAQ,CAAuB;QAXjC,YAAO,GAEpB;YACF,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;SACZ,CAAC;QAMA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAEhE,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;YACpD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC1D,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,GAAW;QAC3B,OAAO,G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