jp.ms.common.modules 1.0.11 → 1.0.12
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/dto/common/log.dto.d.ts +8 -3
- package/dist/modules/support/support.controller.d.ts +2 -2
- package/dist/modules/support/support.controller.js +13 -9
- package/dist/modules/support/support.controller.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/dto/common/log.dto.ts +8 -3
- package/src/modules/support/support.controller.ts +16 -12
|
@@ -2,10 +2,10 @@ import type { Response } from 'express';
|
|
|
2
2
|
import { IAppHeaders } from 'jp.common.models';
|
|
3
3
|
import { PlayerConnectedDto } from '../../dto/common/player-connected.dto';
|
|
4
4
|
import { JpLoggerService } from '../logger/jp-logger.service';
|
|
5
|
+
import { LogsDto } from '../../dto/common/log.dto';
|
|
5
6
|
import { SupportService } from './support.service';
|
|
6
7
|
import { MetricService } from './metric.service';
|
|
7
8
|
import { DumpService } from './dump.service';
|
|
8
|
-
import { LogDto } from '../../dto/common/log.dto';
|
|
9
9
|
export declare class SupportController {
|
|
10
10
|
private readonly supportService;
|
|
11
11
|
private readonly metricService;
|
|
@@ -15,5 +15,5 @@ export declare class SupportController {
|
|
|
15
15
|
getUsers(): Promise<Array<PlayerConnectedDto>>;
|
|
16
16
|
getDump(response: Response): Promise<void>;
|
|
17
17
|
getMetrics(response: Response): Promise<void>;
|
|
18
|
-
addLog(headers: IAppHeaders,
|
|
18
|
+
addLog(headers: IAppHeaders, body: LogsDto): void;
|
|
19
19
|
}
|
|
@@ -45,15 +45,18 @@ let SupportController = class SupportController {
|
|
|
45
45
|
response.set({ 'Content-Type': register.contentType });
|
|
46
46
|
response.send(await register.metrics());
|
|
47
47
|
}
|
|
48
|
-
addLog(headers,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
addLog(headers, body) {
|
|
49
|
+
body.logs.forEach((item) => {
|
|
50
|
+
this.logger.log({
|
|
51
|
+
client_auth_token: headers.client_auth_token,
|
|
52
|
+
client_game: headers.client_game,
|
|
53
|
+
client_channel: headers.client_channel,
|
|
54
|
+
client_language: headers.client_language,
|
|
55
|
+
client_version: headers.client_version,
|
|
56
|
+
description: item.message,
|
|
57
|
+
stackTrace: item.stackTrace,
|
|
58
|
+
level: item.level,
|
|
59
|
+
});
|
|
57
60
|
});
|
|
58
61
|
}
|
|
59
62
|
};
|
|
@@ -80,6 +83,7 @@ __decorate([
|
|
|
80
83
|
], SupportController.prototype, "getMetrics", null);
|
|
81
84
|
__decorate([
|
|
82
85
|
(0, common_1.Post)('log'),
|
|
86
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
83
87
|
__param(0, (0, common_1.Headers)()),
|
|
84
88
|
__param(1, (0, common_1.Body)()),
|
|
85
89
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support.controller.js","sourceRoot":"","sources":["../../../src/modules/support/support.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"support.controller.js","sourceRoot":"","sources":["../../../src/modules/support/support.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyG;AAKzG,mEAA8D;AAG9D,uDAAmD;AACnD,qDAAiD;AACjD,iDAA6C;AAGtC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEL;IACA;IACA;IACU;IAJ/B,YACqB,cAA8B,EAC9B,aAA4B,EAC5B,WAAwB,EACd,MAAuB;QAHjC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,kBAAa,GAAb,aAAa,CAAe;QAC5B,gBAAW,GAAX,WAAW,CAAa;QACd,WAAM,GAAN,MAAM,CAAiB;IAEtD,CAAC;IAGD,QAAQ;QACJ,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAA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