@abyss-project/monitor 1.0.2 → 1.0.4
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/api/application-cron-task.admin.api.d.ts +10 -10
- package/dist/api/application-cron-task.admin.api.js +40 -40
- package/dist/api/application-cron-task.api.d.ts +10 -10
- package/dist/api/application-cron-task.api.js +40 -40
- package/dist/api/application-log.admin.api.d.ts +3 -3
- package/dist/api/application-log.admin.api.js +12 -12
- package/dist/api/application-log.api.d.ts +4 -4
- package/dist/api/application-log.api.js +16 -16
- package/dist/api/application-stats.admin.api.d.ts +3 -3
- package/dist/api/application-stats.admin.api.js +12 -12
- package/dist/api/application-stats.api.d.ts +4 -4
- package/dist/api/application-stats.api.js +16 -16
- package/dist/api/application-store.admin.api.d.ts +6 -6
- package/dist/api/application-store.admin.api.js +24 -24
- package/dist/api/application-store.api.d.ts +6 -6
- package/dist/api/application-store.api.js +24 -24
- package/dist/api/application-store.public.api.d.ts +3 -3
- package/dist/api/application-store.public.api.js +12 -12
- package/dist/api/application.admin.api.d.ts +7 -7
- package/dist/api/application.admin.api.js +28 -28
- package/dist/api/application.api.d.ts +10 -9
- package/dist/api/application.api.js +40 -36
- package/dist/api/index.d.ts +12 -12
- package/dist/api/index.js +28 -24
- package/dist/api/monitor.api.d.ts +2 -2
- package/dist/api/monitor.api.js +8 -8
- package/dist/frameworks/express/decorators.d.ts +52 -52
- package/dist/frameworks/express/decorators.js +163 -163
- package/dist/frameworks/express/index.d.ts +16 -16
- package/dist/frameworks/express/index.js +170 -166
- package/dist/frameworks/express/metadata.d.ts +9 -9
- package/dist/frameworks/express/metadata.js +12 -12
- package/dist/frameworks/index.d.ts +1 -1
- package/dist/frameworks/index.js +17 -13
- package/dist/index.d.ts +46 -46
- package/dist/index.js +105 -101
- package/dist/middlewares/context.middleware.d.ts +12 -12
- package/dist/middlewares/context.middleware.js +39 -39
- package/dist/middlewares/index.d.ts +3 -3
- package/dist/middlewares/index.js +19 -15
- package/dist/middlewares/logger-endpoint.middleware.d.ts +5 -5
- package/dist/middlewares/logger-endpoint.middleware.js +75 -75
- package/dist/middlewares/logger-setup.middleware.d.ts +5 -5
- package/dist/middlewares/logger-setup.middleware.js +16 -16
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +17 -13
- package/dist/models/logger.model.d.ts +55 -55
- package/dist/models/logger.model.js +201 -201
- package/dist/models/stats-publisher.model.d.ts +20 -20
- package/dist/models/stats-publisher.model.js +113 -113
- package/dist/types/enum/api-error.enum.d.ts +20 -20
- package/dist/types/enum/api-error.enum.js +25 -25
- package/dist/types/enum/api-method.enum.d.ts +7 -7
- package/dist/types/enum/api-method.enum.js +11 -11
- package/dist/types/enum/application-alert-type.enum.d.ts +5 -5
- package/dist/types/enum/application-alert-type.enum.js +9 -9
- package/dist/types/enum/application-stats-type.enum.d.ts +5 -5
- package/dist/types/enum/application-stats-type.enum.js +9 -9
- package/dist/types/enum/index.d.ts +7 -7
- package/dist/types/enum/index.js +23 -19
- package/dist/types/enum/log-level.enum.d.ts +6 -6
- package/dist/types/enum/log-level.enum.js +10 -10
- package/dist/types/enum/log-scenario.enum.d.ts +5 -5
- package/dist/types/enum/log-scenario.enum.js +9 -9
- package/dist/types/enum/webhook-type.enum.d.ts +3 -3
- package/dist/types/enum/webhook-type.enum.js +7 -7
- package/dist/types/index.d.ts +18 -18
- package/dist/types/index.js +18 -14
- package/dist/types/interface/api/index.d.ts +27 -27
- package/dist/types/interface/api/index.js +43 -39
- package/dist/types/interface/api/requests/application-cron-task.admin.request.d.ts +50 -51
- package/dist/types/interface/api/requests/application-cron-task.admin.request.js +2 -2
- package/dist/types/interface/api/requests/application-cron-task.request.d.ts +61 -62
- package/dist/types/interface/api/requests/application-cron-task.request.js +2 -2
- package/dist/types/interface/api/requests/application-log.admin.request.d.ts +19 -20
- package/dist/types/interface/api/requests/application-log.admin.request.js +2 -2
- package/dist/types/interface/api/requests/application-log.request.d.ts +53 -54
- package/dist/types/interface/api/requests/application-log.request.js +2 -2
- package/dist/types/interface/api/requests/application-stats.admin.request.d.ts +13 -14
- package/dist/types/interface/api/requests/application-stats.admin.request.js +2 -2
- package/dist/types/interface/api/requests/application-stats.request.d.ts +31 -32
- package/dist/types/interface/api/requests/application-stats.request.js +2 -2
- package/dist/types/interface/api/requests/application-store.admin.request.d.ts +34 -35
- package/dist/types/interface/api/requests/application-store.admin.request.js +2 -2
- package/dist/types/interface/api/requests/application-store.public.request.d.ts +8 -9
- package/dist/types/interface/api/requests/application-store.public.request.js +2 -2
- package/dist/types/interface/api/requests/application-store.request.d.ts +39 -40
- package/dist/types/interface/api/requests/application-store.request.js +2 -2
- package/dist/types/interface/api/requests/application.admin.request.d.ts +18 -19
- package/dist/types/interface/api/requests/application.admin.request.js +2 -2
- package/dist/types/interface/api/requests/application.request.d.ts +35 -33
- package/dist/types/interface/api/requests/application.request.js +2 -2
- package/dist/types/interface/api/responses/application-cron-task.admin.response.d.ts +30 -30
- package/dist/types/interface/api/responses/application-cron-task.admin.response.js +2 -2
- package/dist/types/interface/api/responses/application-cron-task.response.d.ts +30 -30
- package/dist/types/interface/api/responses/application-cron-task.response.js +2 -2
- package/dist/types/interface/api/responses/application-log.admin.response.d.ts +10 -10
- package/dist/types/interface/api/responses/application-log.admin.response.js +2 -2
- package/dist/types/interface/api/responses/application-log.response.d.ts +10 -10
- package/dist/types/interface/api/responses/application-log.response.js +2 -2
- package/dist/types/interface/api/responses/application-stats.admin.response.d.ts +6 -6
- package/dist/types/interface/api/responses/application-stats.admin.response.js +2 -2
- package/dist/types/interface/api/responses/application-stats.response.d.ts +10 -10
- package/dist/types/interface/api/responses/application-stats.response.js +2 -2
- package/dist/types/interface/api/responses/application-store.admin.response.d.ts +17 -17
- package/dist/types/interface/api/responses/application-store.admin.response.js +2 -2
- package/dist/types/interface/api/responses/application-store.public.response.d.ts +21 -21
- package/dist/types/interface/api/responses/application-store.public.response.js +2 -2
- package/dist/types/interface/api/responses/application-store.response.d.ts +17 -17
- package/dist/types/interface/api/responses/application-store.response.js +2 -2
- package/dist/types/interface/api/responses/application.admin.response.d.ts +33 -33
- package/dist/types/interface/api/responses/application.admin.response.js +2 -2
- package/dist/types/interface/api/responses/application.response.d.ts +129 -121
- package/dist/types/interface/api/responses/application.response.js +2 -2
- package/dist/types/interface/api/responses/monitor.response.d.ts +7 -7
- package/dist/types/interface/api/responses/monitor.response.js +2 -2
- package/dist/types/interface/api/type-message/api-error.d.ts +8 -8
- package/dist/types/interface/api/type-message/api-error.js +2 -2
- package/dist/types/interface/api/type-message/base-order.d.ts +4 -4
- package/dist/types/interface/api/type-message/base-order.js +2 -2
- package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -10
- package/dist/types/interface/api/type-message/base-paginate.js +2 -2
- package/dist/types/interface/api/type-message/response.d.ts +5 -5
- package/dist/types/interface/api/type-message/response.js +2 -2
- package/dist/types/interface/index.d.ts +9 -8
- package/dist/types/interface/index.js +25 -20
- package/dist/types/interface/models/application-cron-task-history.model.d.ts +11 -11
- package/dist/types/interface/models/application-cron-task-history.model.js +2 -2
- package/dist/types/interface/models/application-cron-task.model.d.ts +14 -14
- package/dist/types/interface/models/application-cron-task.model.js +2 -2
- package/dist/types/interface/models/application-event.model.d.ts +18 -0
- package/dist/types/interface/{api/requests/abyss.admin.request.js → models/application-event.model.js} +2 -2
- package/dist/types/interface/models/application-log-endpoint.model.d.ts +20 -20
- package/dist/types/interface/models/application-log-endpoint.model.js +2 -2
- package/dist/types/interface/models/application-log.model.d.ts +23 -21
- package/dist/types/interface/models/application-log.model.js +2 -2
- package/dist/types/interface/models/application-stats.model.d.ts +14 -14
- package/dist/types/interface/models/application-stats.model.js +2 -2
- package/dist/types/interface/models/application-store-entry.model.d.ts +14 -14
- package/dist/types/interface/models/application-store-entry.model.js +2 -2
- package/dist/types/interface/models/application.model.d.ts +17 -15
- package/dist/types/interface/models/application.model.js +2 -2
- package/dist/utils/alert.utils.d.ts +35 -35
- package/dist/utils/alert.utils.js +138 -134
- package/dist/utils/discord-webhook-log-formatter.utils.d.ts +42 -42
- package/dist/utils/discord-webhook-log-formatter.utils.js +319 -319
- package/dist/utils/error.utils.d.ts +15 -15
- package/dist/utils/error.utils.js +24 -24
- package/dist/utils/import.utils.d.ts +1 -1
- package/dist/utils/import.utils.js +7 -7
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +21 -17
- package/dist/utils/json.utils.d.ts +1 -1
- package/dist/utils/json.utils.js +13 -13
- package/dist/utils/non-blocking-promise.utils.d.ts +2 -2
- package/dist/utils/non-blocking-promise.utils.js +11 -11
- package/package.json +5 -5
- package/dist/api/abyss.admin.api.d.ts +0 -2
- package/dist/api/abyss.admin.api.js +0 -8
- package/dist/api/application-store-entry.admin.api.d.ts +0 -6
- package/dist/api/application-store-entry.admin.api.js +0 -24
- package/dist/api/application-store-entry.api.d.ts +0 -6
- package/dist/api/application-store-entry.api.js +0 -24
- package/dist/api/application-store-entry.public.api.d.ts +0 -3
- package/dist/api/application-store-entry.public.api.js +0 -12
- package/dist/api/logger.admin.api.d.ts +0 -3
- package/dist/api/logger.admin.api.js +0 -14
- package/dist/api/user-application-alert.admin.api.d.ts +0 -7
- package/dist/api/user-application-alert.admin.api.js +0 -28
- package/dist/api/user-application-alert.api.d.ts +0 -7
- package/dist/api/user-application-alert.api.js +0 -28
- package/dist/api/user-application-cron-task.admin.api.d.ts +0 -9
- package/dist/api/user-application-cron-task.admin.api.js +0 -36
- package/dist/api/user-application-cron-task.api.d.ts +0 -9
- package/dist/api/user-application-cron-task.api.js +0 -36
- package/dist/api/user-application-log.admin.api.d.ts +0 -3
- package/dist/api/user-application-log.admin.api.js +0 -12
- package/dist/api/user-application-log.api.d.ts +0 -4
- package/dist/api/user-application-log.api.js +0 -16
- package/dist/api/user-application-stats.admin.api.d.ts +0 -3
- package/dist/api/user-application-stats.admin.api.js +0 -12
- package/dist/api/user-application-stats.api.d.ts +0 -4
- package/dist/api/user-application-stats.api.js +0 -16
- package/dist/api/user-application.admin.api.d.ts +0 -6
- package/dist/api/user-application.admin.api.js +0 -24
- package/dist/api/user-application.api.d.ts +0 -10
- package/dist/api/user-application.api.js +0 -40
- package/dist/api/user.admin.api.d.ts +0 -5
- package/dist/api/user.admin.api.js +0 -23
- package/dist/api/user.api.d.ts +0 -4
- package/dist/api/user.api.js +0 -17
- package/dist/consts.d.ts +0 -2
- package/dist/consts.js +0 -5
- package/dist/types/enum/log-type.enum.d.ts +0 -6
- package/dist/types/enum/log-type.enum.js +0 -10
- package/dist/types/enum/user-application-alert-type.enum.d.ts +0 -5
- package/dist/types/enum/user-application-alert-type.enum.js +0 -9
- package/dist/types/enum/user-application-stats-type.enum.d.ts +0 -5
- package/dist/types/enum/user-application-stats-type.enum.js +0 -9
- package/dist/types/interface/api/requests/abyss.admin.request.d.ts +0 -4
- package/dist/types/interface/api/requests/logger.admin.request.d.ts +0 -8
- package/dist/types/interface/api/requests/logger.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-alert.admin.request.d.ts +0 -44
- package/dist/types/interface/api/requests/user-application-alert.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-alert.request.d.ts +0 -50
- package/dist/types/interface/api/requests/user-application-alert.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-cron-task.admin.request.d.ts +0 -48
- package/dist/types/interface/api/requests/user-application-cron-task.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-cron-task.request.d.ts +0 -58
- package/dist/types/interface/api/requests/user-application-cron-task.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-log.admin.request.d.ts +0 -20
- package/dist/types/interface/api/requests/user-application-log.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-log.request.d.ts +0 -51
- package/dist/types/interface/api/requests/user-application-log.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-stats.admin.request.d.ts +0 -14
- package/dist/types/interface/api/requests/user-application-stats.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application-stats.request.d.ts +0 -29
- package/dist/types/interface/api/requests/user-application-stats.request.js +0 -2
- package/dist/types/interface/api/requests/user-application.admin.request.d.ts +0 -15
- package/dist/types/interface/api/requests/user-application.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user-application.request.d.ts +0 -35
- package/dist/types/interface/api/requests/user-application.request.js +0 -2
- package/dist/types/interface/api/requests/user.admin.request.d.ts +0 -18
- package/dist/types/interface/api/requests/user.admin.request.js +0 -2
- package/dist/types/interface/api/requests/user.request.d.ts +0 -3
- package/dist/types/interface/api/requests/user.request.js +0 -2
- package/dist/types/interface/api/responses/abyss.admin.response.d.ts +0 -6
- package/dist/types/interface/api/responses/abyss.admin.response.js +0 -2
- package/dist/types/interface/api/responses/logger.admin.response.d.ts +0 -7
- package/dist/types/interface/api/responses/logger.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-alert.admin.response.d.ts +0 -22
- package/dist/types/interface/api/responses/user-application-alert.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-alert.response.d.ts +0 -22
- package/dist/types/interface/api/responses/user-application-alert.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-cron-task.admin.response.d.ts +0 -27
- package/dist/types/interface/api/responses/user-application-cron-task.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-cron-task.response.d.ts +0 -27
- package/dist/types/interface/api/responses/user-application-cron-task.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-log.admin.response.d.ts +0 -11
- package/dist/types/interface/api/responses/user-application-log.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-log.response.d.ts +0 -11
- package/dist/types/interface/api/responses/user-application-log.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-stats.admin.response.d.ts +0 -7
- package/dist/types/interface/api/responses/user-application-stats.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application-stats.response.d.ts +0 -11
- package/dist/types/interface/api/responses/user-application-stats.response.js +0 -2
- package/dist/types/interface/api/responses/user-application.admin.response.d.ts +0 -17
- package/dist/types/interface/api/responses/user-application.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user-application.response.d.ts +0 -120
- package/dist/types/interface/api/responses/user-application.response.js +0 -2
- package/dist/types/interface/api/responses/user.admin.response.d.ts +0 -15
- package/dist/types/interface/api/responses/user.admin.response.js +0 -2
- package/dist/types/interface/api/responses/user.response.d.ts +0 -13
- package/dist/types/interface/api/responses/user.response.js +0 -2
- package/dist/types/interface/models/cron-task-history.model.d.ts +0 -12
- package/dist/types/interface/models/cron-task-history.model.js +0 -2
- package/dist/types/interface/models/cron-task.model.d.ts +0 -13
- package/dist/types/interface/models/cron-task.model.js +0 -2
- package/dist/types/interface/models/log-console.model.d.ts +0 -17
- package/dist/types/interface/models/log-console.model.js +0 -2
- package/dist/types/interface/models/log-endpoint.model.d.ts +0 -22
- package/dist/types/interface/models/log-endpoint.model.js +0 -2
- package/dist/types/interface/models/user-application-alert.model.d.ts +0 -44
- package/dist/types/interface/models/user-application-alert.model.js +0 -2
- package/dist/types/interface/models/user-application-cron-task-history.model.d.ts +0 -11
- package/dist/types/interface/models/user-application-cron-task-history.model.js +0 -2
- package/dist/types/interface/models/user-application-cron-task.model.d.ts +0 -14
- package/dist/types/interface/models/user-application-cron-task.model.js +0 -2
- package/dist/types/interface/models/user-application-log-endpoint.model.d.ts +0 -20
- package/dist/types/interface/models/user-application-log-endpoint.model.js +0 -2
- package/dist/types/interface/models/user-application-log.model.d.ts +0 -21
- package/dist/types/interface/models/user-application-log.model.js +0 -2
- package/dist/types/interface/models/user-application-stats.model.d.ts +0 -14
- package/dist/types/interface/models/user-application-stats.model.js +0 -2
- package/dist/types/interface/models/user-application.model.d.ts +0 -15
- package/dist/types/interface/models/user-application.model.js +0 -2
- package/dist/types/interface/models/user.model.d.ts +0 -8
- package/dist/types/interface/models/user.model.js +0 -2
package/dist/index.js
CHANGED
|
@@ -1,101 +1,105 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
};
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
__exportStar(require("./
|
|
39
|
-
__exportStar(require("./
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
exports
|
|
43
|
-
exports
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
var _a;
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.AbyssMonitorCore = exports.RETRY_CODES = exports.BASE_DELAY_BETWEEN_RETRY = exports.NUMBER_RETRY_API = exports.CRON_TASK_SIGNATURE_ALGORITHM = exports.HEADER_CRON_TASK_SIGNATURE_NAME = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_APPLICATION_HEADER = void 0;
|
|
34
|
+
require("reflect-metadata");
|
|
35
|
+
const axios_1 = __importDefault(require("axios"));
|
|
36
|
+
const axios_retry_1 = __importStar(require("axios-retry"));
|
|
37
|
+
const stats_publisher_model_1 = require("./models/stats-publisher.model");
|
|
38
|
+
__exportStar(require("./api"), exports);
|
|
39
|
+
__exportStar(require("./types"), exports);
|
|
40
|
+
__exportStar(require("./models"), exports);
|
|
41
|
+
__exportStar(require("./utils"), exports);
|
|
42
|
+
__exportStar(require("./middlewares"), exports);
|
|
43
|
+
__exportStar(require("./frameworks"), exports);
|
|
44
|
+
const MONITOR_DEFAULT_BASE_URL = 'https://monitor-api.abyss-project.fr/api/';
|
|
45
|
+
const MONITOR_DEFAULT_BASE_CLIENT_URL = 'https://abyss-project.fr/';
|
|
46
|
+
exports.API_KEY_APPLICATION_HEADER = 'abyss-monitor-api-key-application';
|
|
47
|
+
exports.ADMIN_TOKEN_HEADER = 'abyss-admin-token';
|
|
48
|
+
exports.HEADER_CRON_TASK_SIGNATURE_NAME = 'abyss-monitor-cron-task-signature';
|
|
49
|
+
exports.CRON_TASK_SIGNATURE_ALGORITHM = 'sha256';
|
|
50
|
+
exports.NUMBER_RETRY_API = 10;
|
|
51
|
+
exports.BASE_DELAY_BETWEEN_RETRY = 5000;
|
|
52
|
+
exports.RETRY_CODES = [
|
|
53
|
+
502,
|
|
54
|
+
503,
|
|
55
|
+
];
|
|
56
|
+
class AbyssMonitorCore {
|
|
57
|
+
static setConfig(config) {
|
|
58
|
+
_a.config = { ..._a.config, ...config };
|
|
59
|
+
if (config.baseURL) {
|
|
60
|
+
_a.axios.defaults.baseURL = config.baseURL;
|
|
61
|
+
}
|
|
62
|
+
if (config.token) {
|
|
63
|
+
_a.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
|
|
64
|
+
}
|
|
65
|
+
if (config.adminToken) {
|
|
66
|
+
_a.axios.defaults.headers.common[exports.ADMIN_TOKEN_HEADER] = `${config.adminToken}`;
|
|
67
|
+
}
|
|
68
|
+
if (config.applicationApiKey) {
|
|
69
|
+
_a.axios.defaults.headers.common[exports.API_KEY_APPLICATION_HEADER] = `${config.applicationApiKey}`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
static getConfig() {
|
|
73
|
+
return _a.config;
|
|
74
|
+
}
|
|
75
|
+
static enableAxiosRetry(axiosRetryConfig) {
|
|
76
|
+
(0, axios_retry_1.default)(_a.axios, {
|
|
77
|
+
retries: exports.NUMBER_RETRY_API,
|
|
78
|
+
retryDelay: (retryCount) => retryCount * exports.BASE_DELAY_BETWEEN_RETRY,
|
|
79
|
+
retryCondition: (error) => {
|
|
80
|
+
var _b;
|
|
81
|
+
return (0, axios_retry_1.isNetworkOrIdempotentRequestError)(error) ||
|
|
82
|
+
exports.RETRY_CODES.includes(((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) || 502);
|
|
83
|
+
},
|
|
84
|
+
...axiosRetryConfig,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AbyssMonitorCore = AbyssMonitorCore;
|
|
89
|
+
_a = AbyssMonitorCore;
|
|
90
|
+
AbyssMonitorCore.config = {
|
|
91
|
+
token: '',
|
|
92
|
+
secretPublishToken: '',
|
|
93
|
+
projectId: '',
|
|
94
|
+
applicationId: '',
|
|
95
|
+
applicationApiKey: '',
|
|
96
|
+
adminToken: '',
|
|
97
|
+
baseURL: MONITOR_DEFAULT_BASE_URL,
|
|
98
|
+
baseClientURL: MONITOR_DEFAULT_BASE_CLIENT_URL,
|
|
99
|
+
applicationName: 'Unnamed Application',
|
|
100
|
+
defaultAlertLogWebhookUrl: null,
|
|
101
|
+
defaultAlertStatsWebhookUrl: null,
|
|
102
|
+
getWebhookUrl: async () => null,
|
|
103
|
+
};
|
|
104
|
+
AbyssMonitorCore.StatsPublisher = stats_publisher_model_1.StatsPublisher;
|
|
105
|
+
AbyssMonitorCore.axios = axios_1.default.create({ baseURL: _a.config.baseURL });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
-
|
|
3
|
-
requestId: string;
|
|
4
|
-
data: Record<string, unknown>;
|
|
5
|
-
};
|
|
6
|
-
export declare const contextMiddleware: (req: Request, res: Response<any, any>, next: NextFunction) => void;
|
|
7
|
-
export declare const createRequestContext: (data: Record<string, unknown>, requestId?: string) => {
|
|
8
|
-
requestId: string;
|
|
9
|
-
data: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
export declare const getRequestContext: () => StoreEntry;
|
|
12
|
-
export {};
|
|
1
|
+
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
+
type StoreEntry = {
|
|
3
|
+
requestId: string;
|
|
4
|
+
data: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const contextMiddleware: (req: Request, res: Response<any, any>, next: NextFunction) => void;
|
|
7
|
+
export declare const createRequestContext: (data: Record<string, unknown>, requestId?: string) => {
|
|
8
|
+
requestId: string;
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
export declare const getRequestContext: () => StoreEntry;
|
|
12
|
+
export {};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRequestContext = exports.createRequestContext = exports.contextMiddleware = void 0;
|
|
4
|
-
const uuid_1 = require("uuid");
|
|
5
|
-
let asyncHooks;
|
|
6
|
-
if (typeof window === 'undefined') {
|
|
7
|
-
asyncHooks = require('async_hooks');
|
|
8
|
-
}
|
|
9
|
-
const store = new Map();
|
|
10
|
-
const asyncHook = asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.createHook({
|
|
11
|
-
init: (asyncId, _, triggerAsyncId) => {
|
|
12
|
-
const existingEntry = store.get(triggerAsyncId);
|
|
13
|
-
if (existingEntry) {
|
|
14
|
-
store.set(asyncId, existingEntry);
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
destroy: (asyncId) => {
|
|
18
|
-
if (store.has(asyncId)) {
|
|
19
|
-
store.delete(asyncId);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
asyncHook === null || asyncHook === void 0 ? void 0 : asyncHook.enable();
|
|
24
|
-
const contextMiddleware = (req, res, next) => {
|
|
25
|
-
const data = { headers: req.headers };
|
|
26
|
-
(0, exports.createRequestContext)(data);
|
|
27
|
-
next();
|
|
28
|
-
};
|
|
29
|
-
exports.contextMiddleware = contextMiddleware;
|
|
30
|
-
const createRequestContext = (data, requestId = (0, uuid_1.v4)()) => {
|
|
31
|
-
const requestInfo = { requestId, data };
|
|
32
|
-
store.set(asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.executionAsyncId(), requestInfo);
|
|
33
|
-
return requestInfo;
|
|
34
|
-
};
|
|
35
|
-
exports.createRequestContext = createRequestContext;
|
|
36
|
-
const getRequestContext = () => {
|
|
37
|
-
return store.get(asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.executionAsyncId());
|
|
38
|
-
};
|
|
39
|
-
exports.getRequestContext = getRequestContext;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRequestContext = exports.createRequestContext = exports.contextMiddleware = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
let asyncHooks;
|
|
6
|
+
if (typeof window === 'undefined') {
|
|
7
|
+
asyncHooks = require('async_hooks');
|
|
8
|
+
}
|
|
9
|
+
const store = new Map();
|
|
10
|
+
const asyncHook = asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.createHook({
|
|
11
|
+
init: (asyncId, _, triggerAsyncId) => {
|
|
12
|
+
const existingEntry = store.get(triggerAsyncId);
|
|
13
|
+
if (existingEntry) {
|
|
14
|
+
store.set(asyncId, existingEntry);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
destroy: (asyncId) => {
|
|
18
|
+
if (store.has(asyncId)) {
|
|
19
|
+
store.delete(asyncId);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
asyncHook === null || asyncHook === void 0 ? void 0 : asyncHook.enable();
|
|
24
|
+
const contextMiddleware = (req, res, next) => {
|
|
25
|
+
const data = { headers: req.headers };
|
|
26
|
+
(0, exports.createRequestContext)(data);
|
|
27
|
+
next();
|
|
28
|
+
};
|
|
29
|
+
exports.contextMiddleware = contextMiddleware;
|
|
30
|
+
const createRequestContext = (data, requestId = (0, uuid_1.v4)()) => {
|
|
31
|
+
const requestInfo = { requestId, data };
|
|
32
|
+
store.set(asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.executionAsyncId(), requestInfo);
|
|
33
|
+
return requestInfo;
|
|
34
|
+
};
|
|
35
|
+
exports.createRequestContext = createRequestContext;
|
|
36
|
+
const getRequestContext = () => {
|
|
37
|
+
return store.get(asyncHooks === null || asyncHooks === void 0 ? void 0 : asyncHooks.executionAsyncId());
|
|
38
|
+
};
|
|
39
|
+
exports.getRequestContext = getRequestContext;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './context.middleware';
|
|
2
|
-
export * from './logger-endpoint.middleware';
|
|
3
|
-
export * from './logger-setup.middleware';
|
|
1
|
+
export * from './context.middleware';
|
|
2
|
+
export * from './logger-endpoint.middleware';
|
|
3
|
+
export * from './logger-setup.middleware';
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__exportStar(
|
|
14
|
-
|
|
15
|
-
|
|
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("./context.middleware"), exports);
|
|
18
|
+
__exportStar(require("./logger-endpoint.middleware"), exports);
|
|
19
|
+
__exportStar(require("./logger-setup.middleware"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
-
import { Logger } from '../models';
|
|
3
|
-
import { IMonitorLocals } from '../types';
|
|
4
|
-
export declare const CONTROLLER_FILE_ENDS_WITH: string;
|
|
5
|
-
export declare const loggerEndpointMiddleware: (logger: Logger, req: Request, res: Response<unknown, IMonitorLocals>, next: NextFunction, callback?: ((req: Request, res: Response<unknown, IMonitorLocals>, next: NextFunction) => Promise<void>) | undefined) => Promise<void>;
|
|
1
|
+
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
+
import { Logger } from '../models';
|
|
3
|
+
import { IMonitorLocals } from '../types';
|
|
4
|
+
export declare const CONTROLLER_FILE_ENDS_WITH: string;
|
|
5
|
+
export declare const loggerEndpointMiddleware: (logger: Logger, req: Request, res: Response<unknown, IMonitorLocals>, next: NextFunction, callback?: ((req: Request, res: Response<unknown, IMonitorLocals>, next: NextFunction) => Promise<void>) | undefined) => Promise<void>;
|
|
@@ -1,75 +1,75 @@
|
|
|
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.loggerEndpointMiddleware = exports.CONTROLLER_FILE_ENDS_WITH = void 0;
|
|
7
|
-
const lodash_1 = require("lodash");
|
|
8
|
-
const context_middleware_1 = require("./context.middleware");
|
|
9
|
-
const types_1 = require("../types");
|
|
10
|
-
const net_1 = __importDefault(require("net"));
|
|
11
|
-
const import_utils_1 = require("../utils/import.utils");
|
|
12
|
-
exports.CONTROLLER_FILE_ENDS_WITH = `.controller${(0, import_utils_1.extensionFileToImport)()}`;
|
|
13
|
-
const loggerEndpointMiddleware = async (logger, req, res, next, callback) => {
|
|
14
|
-
res.locals.timer = {
|
|
15
|
-
start: new Date(),
|
|
16
|
-
startTime: process.hrtime(),
|
|
17
|
-
};
|
|
18
|
-
const requestId = (0, context_middleware_1.getRequestContext)().requestId;
|
|
19
|
-
res.on('close', async () => {
|
|
20
|
-
var _a;
|
|
21
|
-
try {
|
|
22
|
-
res.locals.timer.durationToClose = getDurationInMilliseconds(res.locals.timer.startTime);
|
|
23
|
-
if (!res.locals.shouldNotPublishLog) {
|
|
24
|
-
const ips = Array.isArray(req.headers['x-forwarded-for'])
|
|
25
|
-
? req.headers['x-forwarded-for']
|
|
26
|
-
: [...(req.headers['x-forwarded-for'] ? [req.headers['x-forwarded-for']] : [])];
|
|
27
|
-
ips.push(...(req.socket.remoteAddress ? [req.socket.remoteAddress] : []));
|
|
28
|
-
ips.push(...(req.ip ? [req.ip] : []));
|
|
29
|
-
await logger.log('', {
|
|
30
|
-
requestId,
|
|
31
|
-
context: 'API',
|
|
32
|
-
applicationLogEndpoint: {
|
|
33
|
-
responseHttpCode: res.statusCode,
|
|
34
|
-
responseTime: Math.round(res.locals.timer.durationToClose),
|
|
35
|
-
ip: (0, lodash_1.uniq)(ips).filter(net_1.default.isIP),
|
|
36
|
-
endpoint: res.locals.path || ((_a = req.route) === null || _a === void 0 ? void 0 : _a.path) || req.path,
|
|
37
|
-
controller: res.locals.controller || 'Unknown Controller',
|
|
38
|
-
method: types_1.APIMethod[req.method.toUpperCase()],
|
|
39
|
-
requestParams: req.params,
|
|
40
|
-
requestQuery: req.query,
|
|
41
|
-
requestBody: res.locals.shouldNotSaveRequestBody
|
|
42
|
-
? null
|
|
43
|
-
: req.body
|
|
44
|
-
? JSON.parse(JSON.stringify(req.body))
|
|
45
|
-
: null,
|
|
46
|
-
responseBody: res.locals.shouldNotSaveResponseBody
|
|
47
|
-
? null
|
|
48
|
-
: res.locals.responseBody
|
|
49
|
-
? JSON.parse(JSON.stringify(res.locals.responseBody))
|
|
50
|
-
: null,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
if (callback) {
|
|
56
|
-
await callback(req, res, next);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
logger.error(error);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
next();
|
|
68
|
-
};
|
|
69
|
-
exports.loggerEndpointMiddleware = loggerEndpointMiddleware;
|
|
70
|
-
const getDurationInMilliseconds = (start) => {
|
|
71
|
-
const NS_PER_SEC = 1e9;
|
|
72
|
-
const NS_TO_MS = 1e6;
|
|
73
|
-
const diff = process.hrtime(start);
|
|
74
|
-
return (diff[0] * NS_PER_SEC + diff[1]) / NS_TO_MS;
|
|
75
|
-
};
|
|
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.loggerEndpointMiddleware = exports.CONTROLLER_FILE_ENDS_WITH = void 0;
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const context_middleware_1 = require("./context.middleware");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
const net_1 = __importDefault(require("net"));
|
|
11
|
+
const import_utils_1 = require("../utils/import.utils");
|
|
12
|
+
exports.CONTROLLER_FILE_ENDS_WITH = `.controller${(0, import_utils_1.extensionFileToImport)()}`;
|
|
13
|
+
const loggerEndpointMiddleware = async (logger, req, res, next, callback) => {
|
|
14
|
+
res.locals.timer = {
|
|
15
|
+
start: new Date(),
|
|
16
|
+
startTime: process.hrtime(),
|
|
17
|
+
};
|
|
18
|
+
const requestId = (0, context_middleware_1.getRequestContext)().requestId;
|
|
19
|
+
res.on('close', async () => {
|
|
20
|
+
var _a;
|
|
21
|
+
try {
|
|
22
|
+
res.locals.timer.durationToClose = getDurationInMilliseconds(res.locals.timer.startTime);
|
|
23
|
+
if (!res.locals.shouldNotPublishLog) {
|
|
24
|
+
const ips = Array.isArray(req.headers['x-forwarded-for'])
|
|
25
|
+
? req.headers['x-forwarded-for']
|
|
26
|
+
: [...(req.headers['x-forwarded-for'] ? [req.headers['x-forwarded-for']] : [])];
|
|
27
|
+
ips.push(...(req.socket.remoteAddress ? [req.socket.remoteAddress] : []));
|
|
28
|
+
ips.push(...(req.ip ? [req.ip] : []));
|
|
29
|
+
await logger.log('', {
|
|
30
|
+
requestId,
|
|
31
|
+
context: 'API',
|
|
32
|
+
applicationLogEndpoint: {
|
|
33
|
+
responseHttpCode: res.statusCode,
|
|
34
|
+
responseTime: Math.round(res.locals.timer.durationToClose),
|
|
35
|
+
ip: (0, lodash_1.uniq)(ips).filter(net_1.default.isIP),
|
|
36
|
+
endpoint: res.locals.path || ((_a = req.route) === null || _a === void 0 ? void 0 : _a.path) || req.path,
|
|
37
|
+
controller: res.locals.controller || 'Unknown Controller',
|
|
38
|
+
method: types_1.APIMethod[req.method.toUpperCase()],
|
|
39
|
+
requestParams: req.params,
|
|
40
|
+
requestQuery: req.query,
|
|
41
|
+
requestBody: res.locals.shouldNotSaveRequestBody
|
|
42
|
+
? null
|
|
43
|
+
: req.body
|
|
44
|
+
? JSON.parse(JSON.stringify(req.body))
|
|
45
|
+
: null,
|
|
46
|
+
responseBody: res.locals.shouldNotSaveResponseBody
|
|
47
|
+
? null
|
|
48
|
+
: res.locals.responseBody
|
|
49
|
+
? JSON.parse(JSON.stringify(res.locals.responseBody))
|
|
50
|
+
: null,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
if (callback) {
|
|
56
|
+
await callback(req, res, next);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger.error(error);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
next();
|
|
68
|
+
};
|
|
69
|
+
exports.loggerEndpointMiddleware = loggerEndpointMiddleware;
|
|
70
|
+
const getDurationInMilliseconds = (start) => {
|
|
71
|
+
const NS_PER_SEC = 1e9;
|
|
72
|
+
const NS_TO_MS = 1e6;
|
|
73
|
+
const diff = process.hrtime(start);
|
|
74
|
+
return (diff[0] * NS_PER_SEC + diff[1]) / NS_TO_MS;
|
|
75
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
-
export declare const loggerSetupMiddleware: (req: Request, res: Response<any, {
|
|
3
|
-
controller: string;
|
|
4
|
-
responseBody?: unknown;
|
|
5
|
-
}>, next: NextFunction) => Promise<void>;
|
|
1
|
+
import { Request, Response, NextFunction } from 'express-serve-static-core';
|
|
2
|
+
export declare const loggerSetupMiddleware: (req: Request, res: Response<any, {
|
|
3
|
+
controller: string;
|
|
4
|
+
responseBody?: unknown;
|
|
5
|
+
}>, next: NextFunction) => Promise<void>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loggerSetupMiddleware = void 0;
|
|
4
|
-
const loggerSetupMiddleware = async (req, res, next) => {
|
|
5
|
-
const originalJson = res.json;
|
|
6
|
-
const originalSend = res.send;
|
|
7
|
-
res.send = function (...args) {
|
|
8
|
-
return originalSend.apply(res, args);
|
|
9
|
-
};
|
|
10
|
-
res.json = function (...args) {
|
|
11
|
-
res.locals.responseBody = args[0];
|
|
12
|
-
return originalJson.apply(res, args);
|
|
13
|
-
};
|
|
14
|
-
next();
|
|
15
|
-
};
|
|
16
|
-
exports.loggerSetupMiddleware = loggerSetupMiddleware;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loggerSetupMiddleware = void 0;
|
|
4
|
+
const loggerSetupMiddleware = async (req, res, next) => {
|
|
5
|
+
const originalJson = res.json;
|
|
6
|
+
const originalSend = res.send;
|
|
7
|
+
res.send = function (...args) {
|
|
8
|
+
return originalSend.apply(res, args);
|
|
9
|
+
};
|
|
10
|
+
res.json = function (...args) {
|
|
11
|
+
res.locals.responseBody = args[0];
|
|
12
|
+
return originalJson.apply(res, args);
|
|
13
|
+
};
|
|
14
|
+
next();
|
|
15
|
+
};
|
|
16
|
+
exports.loggerSetupMiddleware = loggerSetupMiddleware;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './logger.model';
|
|
1
|
+
export * from './logger.model';
|
package/dist/models/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__exportStar(
|
|
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("./logger.model"), exports);
|