@abyss-project/console 1.0.6 → 1.0.7
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/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/secret-access.api.d.ts +9 -0
- package/dist/api/secret-access.api.js +44 -0
- package/dist/api/secret-public.api.d.ts +2 -0
- package/dist/api/secret-public.api.js +9 -0
- package/dist/api/secret.api.d.ts +11 -0
- package/dist/api/secret.api.js +54 -0
- package/dist/index.d.ts +33 -1
- package/dist/index.js +34 -3
- package/dist/types/dto/workflow.dto.d.ts +0 -1
- package/dist/types/interface/api/index.d.ts +6 -0
- package/dist/types/interface/api/index.js +6 -0
- package/dist/types/interface/api/requests/secret-access.request.d.ts +48 -0
- package/dist/types/interface/api/requests/secret-public.request.d.ts +3 -0
- package/dist/types/interface/api/requests/secret.request.d.ts +57 -0
- package/dist/types/interface/api/responses/secret-access.response.d.ts +25 -0
- package/dist/types/interface/api/responses/secret-public.response.d.ts +5 -0
- package/dist/types/interface/api/responses/secret.response.d.ts +39 -0
- package/dist/types/interface/api/responses/workflow-webhook.public.response.d.ts +4 -2
- package/dist/types/interface/index.d.ts +6 -0
- package/dist/types/interface/index.js +6 -0
- package/dist/types/interface/models/secret-access-ip-address.model.d.ts +12 -0
- package/dist/types/interface/models/secret-access-log.model.d.ts +14 -0
- package/dist/types/interface/models/secret-access-secret.model.d.ts +11 -0
- package/dist/types/interface/models/secret-access.model.d.ts +19 -0
- package/dist/types/interface/models/secret-version.model.d.ts +11 -0
- package/dist/types/interface/models/secret.model.d.ts +15 -0
- package/dist/utils/cidr.util.d.ts +3 -0
- package/dist/utils/cidr.util.js +22 -0
- package/dist/utils/webhook-trigger.utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/api/application-cron-task.admin.api.d.ts +0 -10
- package/dist/api/application-cron-task.admin.api.js +0 -40
- package/dist/api/application-cron-task.api.d.ts +0 -10
- package/dist/api/application-cron-task.api.js +0 -40
- package/dist/api/application-event.admin.api.d.ts +0 -4
- package/dist/api/application-event.admin.api.js +0 -16
- package/dist/api/application-event.api.d.ts +0 -8
- package/dist/api/application-event.api.js +0 -32
- package/dist/api/application-log.admin.api.d.ts +0 -3
- package/dist/api/application-log.admin.api.js +0 -12
- package/dist/api/application-log.api.d.ts +0 -4
- package/dist/api/application-log.api.js +0 -16
- package/dist/api/application-sentinel.admin.api.d.ts +0 -9
- package/dist/api/application-sentinel.admin.api.js +0 -36
- package/dist/api/application-sentinel.api.d.ts +0 -10
- package/dist/api/application-sentinel.api.js +0 -40
- package/dist/api/application-stats.admin.api.d.ts +0 -3
- package/dist/api/application-stats.admin.api.js +0 -12
- package/dist/api/application-stats.api.d.ts +0 -4
- package/dist/api/application-stats.api.js +0 -16
- package/dist/api/application-webhook-history.admin.api.d.ts +0 -3
- package/dist/api/application-webhook-history.admin.api.js +0 -12
- package/dist/api/application-webhook-history.api.d.ts +0 -3
- package/dist/api/application-webhook-history.api.js +0 -12
- package/dist/api/application-webhook.admin.api.d.ts +0 -7
- package/dist/api/application-webhook.admin.api.js +0 -28
- package/dist/api/application-webhook.api.d.ts +0 -7
- package/dist/api/application-webhook.api.js +0 -28
- package/dist/api/application.admin.api.d.ts +0 -7
- package/dist/api/application.admin.api.js +0 -28
- package/dist/api/application.api.d.ts +0 -10
- package/dist/api/application.api.js +0 -40
- package/dist/api/hourly-metrics.api.d.ts +0 -2
- package/dist/api/hourly-metrics.api.js +0 -8
- package/dist/api/infrastructure.admin.api.d.ts +0 -3
- package/dist/api/infrastructure.admin.api.js +0 -12
- package/dist/api/metrics.api.d.ts +0 -4
- package/dist/api/metrics.api.js +0 -16
- package/dist/api/report.admin.api.d.ts +0 -2
- package/dist/api/report.admin.api.js +0 -9
- package/dist/frameworks/express/decorators.d.ts +0 -52
- package/dist/frameworks/express/decorators.js +0 -163
- package/dist/frameworks/express/index.d.ts +0 -17
- package/dist/frameworks/express/index.js +0 -173
- package/dist/frameworks/express/metadata.d.ts +0 -9
- package/dist/frameworks/express/metadata.js +0 -12
- package/dist/frameworks/index.d.ts +0 -1
- package/dist/frameworks/index.js +0 -17
- package/dist/middlewares/context.middleware.d.ts +0 -12
- package/dist/middlewares/context.middleware.js +0 -39
- package/dist/middlewares/index.d.ts +0 -3
- package/dist/middlewares/index.js +0 -19
- package/dist/middlewares/logger-endpoint.middleware.d.ts +0 -5
- package/dist/middlewares/logger-endpoint.middleware.js +0 -86
- package/dist/middlewares/logger-setup.middleware.d.ts +0 -5
- package/dist/middlewares/logger-setup.middleware.js +0 -16
- package/dist/models/index.d.ts +0 -1
- package/dist/models/index.js +0 -17
- package/dist/models/logger.model.d.ts +0 -61
- package/dist/models/logger.model.js +0 -201
- package/dist/models/stats-publisher.model.d.ts +0 -20
- package/dist/models/stats-publisher.model.js +0 -113
- package/dist/types/constants/webhook-trigger.constants.d.ts +0 -0
- package/dist/types/constants/webhook-trigger.constants.js +0 -1
- package/dist/types/enum/api-method.enum.d.ts +0 -7
- package/dist/types/enum/api-method.enum.js +0 -11
- package/dist/types/enum/application-alert-type.enum.d.ts +0 -5
- package/dist/types/enum/application-alert-type.enum.js +0 -9
- package/dist/types/enum/application-sentinel-type.enum.d.ts +0 -5
- package/dist/types/enum/application-sentinel-type.enum.js +0 -9
- package/dist/types/enum/application-stats-type.enum.d.ts +0 -5
- package/dist/types/enum/application-stats-type.enum.js +0 -9
- package/dist/types/enum/application-webhook-scope.enum.d.ts +0 -4
- package/dist/types/enum/application-webhook-scope.enum.js +0 -8
- package/dist/types/enum/log-level.enum.d.ts +0 -6
- package/dist/types/enum/log-level.enum.js +0 -10
- package/dist/types/enum/log-scenario.enum.d.ts +0 -5
- package/dist/types/enum/log-scenario.enum.js +0 -9
- package/dist/types/enum/time-period.enum.d.ts +0 -0
- package/dist/types/enum/time-period.enum.js +0 -1
- package/dist/types/interface/api/requests/application-cron-task.admin.request.d.ts +0 -50
- package/dist/types/interface/api/requests/application-cron-task.request.d.ts +0 -61
- package/dist/types/interface/api/requests/application-event.admin.request.d.ts +0 -16
- package/dist/types/interface/api/requests/application-event.request.d.ts +0 -50
- package/dist/types/interface/api/requests/application-log.admin.request.d.ts +0 -19
- package/dist/types/interface/api/requests/application-log.request.d.ts +0 -59
- package/dist/types/interface/api/requests/application-sentinel.admin.request.d.ts +0 -52
- package/dist/types/interface/api/requests/application-sentinel.request.d.ts +0 -71
- package/dist/types/interface/api/requests/application-stats.admin.request.d.ts +0 -13
- package/dist/types/interface/api/requests/application-stats.request.d.ts +0 -31
- package/dist/types/interface/api/requests/application-webhook-history.admin.request.d.ts +0 -16
- package/dist/types/interface/api/requests/application-webhook-history.request.d.ts +0 -21
- package/dist/types/interface/api/requests/application-webhook.admin.request.d.ts +0 -39
- package/dist/types/interface/api/requests/application-webhook.admin.request.js +0 -2
- package/dist/types/interface/api/requests/application-webhook.request.d.ts +0 -45
- package/dist/types/interface/api/requests/application-webhook.request.js +0 -2
- package/dist/types/interface/api/requests/application.admin.request.d.ts +0 -23
- package/dist/types/interface/api/requests/application.admin.request.js +0 -2
- package/dist/types/interface/api/requests/application.request.d.ts +0 -64
- package/dist/types/interface/api/requests/application.request.js +0 -2
- package/dist/types/interface/api/requests/hourly-metrics.request.d.ts +0 -10
- package/dist/types/interface/api/requests/hourly-metrics.request.js +0 -2
- package/dist/types/interface/api/requests/infrastructure.admin.request.d.ts +0 -4
- package/dist/types/interface/api/requests/infrastructure.admin.request.js +0 -2
- package/dist/types/interface/api/requests/metrics.admin.request.d.ts +0 -14
- package/dist/types/interface/api/requests/metrics.admin.request.js +0 -2
- package/dist/types/interface/api/requests/metrics.request.d.ts +0 -23
- package/dist/types/interface/api/requests/metrics.request.js +0 -2
- package/dist/types/interface/api/requests/report.admin.request.d.ts +0 -6
- package/dist/types/interface/api/requests/report.admin.request.js +0 -2
- package/dist/types/interface/api/requests/webhook-public.request.d.ts +0 -0
- package/dist/types/interface/api/requests/webhook-public.request.js +0 -1
- package/dist/types/interface/api/requests/workflow-webhook-trigger.request.d.ts +0 -66
- package/dist/types/interface/api/requests/workflow-webhook-trigger.request.js +0 -2
- package/dist/types/interface/api/requests/workflow-webhook.request.d.ts +0 -123
- package/dist/types/interface/api/requests/workflow-webhook.request.js +0 -2
- package/dist/types/interface/api/responses/application-cron-task.admin.response.d.ts +0 -30
- package/dist/types/interface/api/responses/application-cron-task.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-cron-task.response.d.ts +0 -30
- package/dist/types/interface/api/responses/application-cron-task.response.js +0 -2
- package/dist/types/interface/api/responses/application-event.admin.response.d.ts +0 -9
- package/dist/types/interface/api/responses/application-event.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-event.response.d.ts +0 -33
- package/dist/types/interface/api/responses/application-event.response.js +0 -2
- package/dist/types/interface/api/responses/application-log.admin.response.d.ts +0 -10
- package/dist/types/interface/api/responses/application-log.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-log.response.d.ts +0 -10
- package/dist/types/interface/api/responses/application-log.response.js +0 -2
- package/dist/types/interface/api/responses/application-sentinel.admin.response.d.ts +0 -26
- package/dist/types/interface/api/responses/application-sentinel.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-sentinel.response.d.ts +0 -33
- package/dist/types/interface/api/responses/application-sentinel.response.js +0 -2
- package/dist/types/interface/api/responses/application-stats.admin.response.d.ts +0 -6
- package/dist/types/interface/api/responses/application-stats.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-stats.response.d.ts +0 -10
- package/dist/types/interface/api/responses/application-stats.response.js +0 -2
- package/dist/types/interface/api/responses/application-webhook-history.admin.response.d.ts +0 -7
- package/dist/types/interface/api/responses/application-webhook-history.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-webhook-history.response.d.ts +0 -7
- package/dist/types/interface/api/responses/application-webhook-history.response.js +0 -2
- package/dist/types/interface/api/responses/application-webhook.admin.response.d.ts +0 -21
- package/dist/types/interface/api/responses/application-webhook.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application-webhook.response.d.ts +0 -21
- package/dist/types/interface/api/responses/application-webhook.response.js +0 -2
- package/dist/types/interface/api/responses/application.admin.response.d.ts +0 -34
- package/dist/types/interface/api/responses/application.admin.response.js +0 -2
- package/dist/types/interface/api/responses/application.response.d.ts +0 -130
- package/dist/types/interface/api/responses/application.response.js +0 -2
- package/dist/types/interface/api/responses/hourly-metrics.response.d.ts +0 -70
- package/dist/types/interface/api/responses/hourly-metrics.response.js +0 -2
- package/dist/types/interface/api/responses/infrastructure.admin.response.d.ts +0 -18
- package/dist/types/interface/api/responses/infrastructure.admin.response.js +0 -2
- package/dist/types/interface/api/responses/metrics.admin.response.d.ts +0 -19
- package/dist/types/interface/api/responses/metrics.admin.response.js +0 -2
- package/dist/types/interface/api/responses/metrics.response.d.ts +0 -29
- package/dist/types/interface/api/responses/metrics.response.js +0 -2
- package/dist/types/interface/api/responses/report.admin.response.d.ts +0 -87
- package/dist/types/interface/api/responses/report.admin.response.js +0 -2
- package/dist/types/interface/api/responses/webhook-public.response.d.ts +0 -0
- package/dist/types/interface/api/responses/webhook-public.response.js +0 -1
- package/dist/types/interface/api/responses/workflow-webhook-action.response.d.ts +0 -24
- package/dist/types/interface/api/responses/workflow-webhook-action.response.js +0 -2
- package/dist/types/interface/api/responses/workflow-webhook-public.response.d.ts +0 -7
- package/dist/types/interface/api/responses/workflow-webhook-public.response.js +0 -2
- package/dist/types/interface/api/responses/workflow-webhook-trigger.response.d.ts +0 -41
- package/dist/types/interface/api/responses/workflow-webhook-trigger.response.js +0 -2
- package/dist/types/interface/api/responses/workflow-webhook.response.d.ts +0 -56
- package/dist/types/interface/api/responses/workflow-webhook.response.js +0 -2
- package/dist/types/interface/dto/application-sentinel-configuration.dto.d.ts +0 -68
- package/dist/types/interface/dto/application-sentinel-configuration.dto.js +0 -4
- package/dist/types/interface/dto/index.d.ts +0 -2
- package/dist/types/interface/dto/index.js +0 -18
- package/dist/types/interface/dto/webhook.dto.d.ts +0 -27
- package/dist/types/interface/dto/webhook.dto.js +0 -2
- package/dist/types/interface/models/application-cron-task-history.model.d.ts +0 -17
- package/dist/types/interface/models/application-cron-task-history.model.js +0 -2
- package/dist/types/interface/models/application-cron-task.model.d.ts +0 -14
- package/dist/types/interface/models/application-cron-task.model.js +0 -2
- package/dist/types/interface/models/application-event.model.d.ts +0 -19
- package/dist/types/interface/models/application-event.model.js +0 -2
- package/dist/types/interface/models/application-hourly-metrics.model.d.ts +0 -14
- package/dist/types/interface/models/application-hourly-metrics.model.js +0 -2
- package/dist/types/interface/models/application-lifetime-metrics.model.d.ts +0 -8
- package/dist/types/interface/models/application-lifetime-metrics.model.js +0 -2
- package/dist/types/interface/models/application-log-endpoint.model.d.ts +0 -20
- package/dist/types/interface/models/application-log-endpoint.model.js +0 -2
- package/dist/types/interface/models/application-log.model.d.ts +0 -23
- package/dist/types/interface/models/application-log.model.js +0 -2
- package/dist/types/interface/models/application-sentinel-history.model.d.ts +0 -16
- package/dist/types/interface/models/application-sentinel-history.model.js +0 -2
- package/dist/types/interface/models/application-sentinel.model.d.ts +0 -20
- package/dist/types/interface/models/application-sentinel.model.js +0 -2
- package/dist/types/interface/models/application-stats.model.d.ts +0 -14
- package/dist/types/interface/models/application-stats.model.js +0 -2
- package/dist/types/interface/models/application-webhook-history.model.d.ts +0 -22
- package/dist/types/interface/models/application-webhook-history.model.js +0 -2
- package/dist/types/interface/models/application-webhook.model.d.ts +0 -32
- package/dist/types/interface/models/application-webhook.model.js +0 -3
- package/dist/types/interface/models/application.model.d.ts +0 -19
- package/dist/types/interface/models/application.model.js +0 -2
- package/dist/types/interface/models/ip-whitelist.model.d.ts +0 -19
- package/dist/types/interface/models/ip-whitelist.model.js +0 -9
- package/dist/types/interface/models/partition-optimization-history.model.d.ts +0 -11
- package/dist/types/interface/models/partition-optimization-history.model.js +0 -2
- package/dist/types/interface/models/trigger-filter.model.d.ts +0 -0
- package/dist/types/interface/models/trigger-filter.model.js +0 -1
- package/dist/types/interface/models/webhook-action-log.model.d.ts +0 -22
- package/dist/types/interface/models/webhook-action-log.model.js +0 -9
- package/dist/types/interface/models/webhook-trigger-log.model.d.ts +0 -23
- package/dist/types/interface/models/webhook-trigger-log.model.js +0 -9
- package/dist/types/interface/models/workflow-execution-step.model.d.ts +0 -59
- package/dist/types/interface/models/workflow-execution-step.model.js +0 -12
- package/dist/types/interface/models/workflow-step-config.model.d.ts +0 -0
- package/dist/types/interface/models/workflow-step-config.model.js +0 -1
- package/dist/types/interface/models/workflow-step-data.model.d.ts +0 -0
- package/dist/types/interface/models/workflow-step-data.model.js +0 -1
- package/dist/types/interface/models/workflow-trigger-config.model.d.ts +0 -0
- package/dist/types/interface/models/workflow-trigger-config.model.js +0 -1
- package/dist/types/interface/models/workflow-webhook-action.model.d.ts +0 -27
- package/dist/types/interface/models/workflow-webhook-action.model.js +0 -2
- package/dist/types/interface/models/workflow-webhook-incoming-log.model.d.ts +0 -19
- package/dist/types/interface/models/workflow-webhook-incoming-log.model.js +0 -2
- package/dist/types/interface/models/workflow-webhook-outgoing-log.model.d.ts +0 -21
- package/dist/types/interface/models/workflow-webhook-outgoing-log.model.js +0 -2
- package/dist/types/interface/models/workflow-webhook-trigger-allowed-ip.model.d.ts +0 -10
- package/dist/types/interface/models/workflow-webhook-trigger-allowed-ip.model.js +0 -2
- package/dist/types/interface/models/workflow-webhook-trigger.model.d.ts +0 -20
- package/dist/types/interface/models/workflow-webhook-trigger.model.js +0 -2
- package/dist/typing-examples.d.ts +0 -1
- package/dist/typing-examples.js +0 -48
- package/dist/utils/__tests__/ip-address-reference.utils.test.d.ts +0 -0
- package/dist/utils/__tests__/ip-address-reference.utils.test.js +0 -1
- package/dist/utils/__tests__/reference-resolver.examples.d.ts +0 -0
- package/dist/utils/__tests__/reference-resolver.examples.js +0 -1
- package/dist/utils/alert.utils.d.ts +0 -35
- package/dist/utils/alert.utils.js +0 -138
- package/dist/utils/discord-webhook-log-formatter.utils.d.ts +0 -48
- package/dist/utils/discord-webhook-log-formatter.utils.js +0 -332
- package/dist/utils/import.utils.d.ts +0 -1
- package/dist/utils/import.utils.js +0 -7
- package/dist/utils/ip-address-reference.utils.d.ts +0 -0
- package/dist/utils/ip-address-reference.utils.js +0 -1
- package/dist/utils/json.utils.d.ts +0 -1
- package/dist/utils/json.utils.js +0 -13
- package/dist/utils/non-blocking-promise.utils.d.ts +0 -2
- package/dist/utils/non-blocking-promise.utils.js +0 -11
- /package/dist/types/interface/api/requests/{application-cron-task.admin.request.js → secret-access.request.js} +0 -0
- /package/dist/types/interface/api/requests/{application-cron-task.request.js → secret-public.request.js} +0 -0
- /package/dist/types/interface/api/requests/{application-event.admin.request.js → secret.request.js} +0 -0
- /package/dist/types/interface/api/{requests/application-event.request.js → responses/secret-access.response.js} +0 -0
- /package/dist/types/interface/api/{requests/application-log.admin.request.js → responses/secret-public.response.js} +0 -0
- /package/dist/types/interface/api/{requests/application-log.request.js → responses/secret.response.js} +0 -0
- /package/dist/types/interface/{api/requests/application-sentinel.admin.request.js → models/secret-access-ip-address.model.js} +0 -0
- /package/dist/types/interface/{api/requests/application-sentinel.request.js → models/secret-access-log.model.js} +0 -0
- /package/dist/types/interface/{api/requests/application-stats.admin.request.js → models/secret-access-secret.model.js} +0 -0
- /package/dist/types/interface/{api/requests/application-stats.request.js → models/secret-access.model.js} +0 -0
- /package/dist/types/interface/{api/requests/application-webhook-history.admin.request.js → models/secret-version.model.js} +0 -0
- /package/dist/types/interface/{api/requests/application-webhook-history.request.js → models/secret.model.js} +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCallPerControllerAnalyticsApplication = exports.getSlowerEndpointAnalyticsApplication = exports.getEndpointOnPeriodAnalyticsApplication = exports.getEndpointAnalyticsApplication = exports.getStatsAnalyticsApplication = exports.getAnalyticsApplication = exports.getLogAnalyticsApplication = exports.resetSecretPublishTokenApplication = exports.getApplication = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const getApplication = async (params) => {
|
|
6
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}`)).data;
|
|
7
|
-
};
|
|
8
|
-
exports.getApplication = getApplication;
|
|
9
|
-
const resetSecretPublishTokenApplication = async (params) => {
|
|
10
|
-
return (await __1.AbyssMonitorCore.axios.post(`application/${params.applicationId}/reset-secret-publish-token`)).data;
|
|
11
|
-
};
|
|
12
|
-
exports.resetSecretPublishTokenApplication = resetSecretPublishTokenApplication;
|
|
13
|
-
const getLogAnalyticsApplication = async (params, query) => {
|
|
14
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/log-analytics`, { params: query })).data;
|
|
15
|
-
};
|
|
16
|
-
exports.getLogAnalyticsApplication = getLogAnalyticsApplication;
|
|
17
|
-
const getAnalyticsApplication = async (params, query) => {
|
|
18
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/analytics`, { params: query })).data;
|
|
19
|
-
};
|
|
20
|
-
exports.getAnalyticsApplication = getAnalyticsApplication;
|
|
21
|
-
const getStatsAnalyticsApplication = async (params, query) => {
|
|
22
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/stats-analytics`, { params: query })).data;
|
|
23
|
-
};
|
|
24
|
-
exports.getStatsAnalyticsApplication = getStatsAnalyticsApplication;
|
|
25
|
-
const getEndpointAnalyticsApplication = async (params, query) => {
|
|
26
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/endpoint-analytics`, { params: query })).data;
|
|
27
|
-
};
|
|
28
|
-
exports.getEndpointAnalyticsApplication = getEndpointAnalyticsApplication;
|
|
29
|
-
const getEndpointOnPeriodAnalyticsApplication = async (params, query) => {
|
|
30
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/endpoint-analytics-on-period`, { params: query })).data;
|
|
31
|
-
};
|
|
32
|
-
exports.getEndpointOnPeriodAnalyticsApplication = getEndpointOnPeriodAnalyticsApplication;
|
|
33
|
-
const getSlowerEndpointAnalyticsApplication = async (params, query) => {
|
|
34
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/slower-endpoint-analytics`, { params: query })).data;
|
|
35
|
-
};
|
|
36
|
-
exports.getSlowerEndpointAnalyticsApplication = getSlowerEndpointAnalyticsApplication;
|
|
37
|
-
const getCallPerControllerAnalyticsApplication = async (params, query) => {
|
|
38
|
-
return (await __1.AbyssMonitorCore.axios.get(`application/${params.applicationId}/call-per-controller-analytics`, { params: query })).data;
|
|
39
|
-
};
|
|
40
|
-
exports.getCallPerControllerAnalyticsApplication = getCallPerControllerAnalyticsApplication;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHourlyMetrics = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const getHourlyMetrics = async (params, query) => {
|
|
6
|
-
return (await __1.AbyssMonitorCore.axios.get(`metrics/hourly/${params.projectId}`, { params: query })).data;
|
|
7
|
-
};
|
|
8
|
-
exports.getHourlyMetrics = getHourlyMetrics;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CreateFuturePartitionsInfrastructureBody, CreateFuturePartitionsInfrastructureResponse, GetPartitionsInfoInfrastructureResponse } from '../types';
|
|
2
|
-
export declare const createFuturePartitionsInfrastructureAdmin: (body: CreateFuturePartitionsInfrastructureBody) => Promise<CreateFuturePartitionsInfrastructureResponse>;
|
|
3
|
-
export declare const getPartitionsInfoInfrastructureAdmin: () => Promise<GetPartitionsInfoInfrastructureResponse>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPartitionsInfoInfrastructureAdmin = exports.createFuturePartitionsInfrastructureAdmin = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const createFuturePartitionsInfrastructureAdmin = async (body) => {
|
|
6
|
-
return (await __1.AbyssMonitorCore.axios.post(`infrastructure/admin/partitions/create-future`, body)).data;
|
|
7
|
-
};
|
|
8
|
-
exports.createFuturePartitionsInfrastructureAdmin = createFuturePartitionsInfrastructureAdmin;
|
|
9
|
-
const getPartitionsInfoInfrastructureAdmin = async () => {
|
|
10
|
-
return (await __1.AbyssMonitorCore.axios.get(`infrastructure/admin/partitions/info`)).data;
|
|
11
|
-
};
|
|
12
|
-
exports.getPartitionsInfoInfrastructureAdmin = getPartitionsInfoInfrastructureAdmin;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IGetLastIncidentSentinelMetricsParams, IGetLastIncidentSentinelMetricsQuery, IGetLastIncidentSentinelMetricsResponse, IGetLatencySentinelMetricsParams, IGetLatencySentinelMetricsQuery, IGetLatencySentinelMetricsResponse, IGetSentinelMetricsParams, IGetSentinelMetricsQuery, IGetSentinelMetricsResponse } from '../types';
|
|
2
|
-
export declare const getSentinelMetrics: (params: IGetSentinelMetricsParams, query: IGetSentinelMetricsQuery) => Promise<IGetSentinelMetricsResponse>;
|
|
3
|
-
export declare const getLatencySentinelMetrics: (params: IGetLatencySentinelMetricsParams, query: IGetLatencySentinelMetricsQuery) => Promise<IGetLatencySentinelMetricsResponse>;
|
|
4
|
-
export declare const getLastIncidentSentinelMetrics: (params: IGetLastIncidentSentinelMetricsParams, query: IGetLastIncidentSentinelMetricsQuery) => Promise<IGetLastIncidentSentinelMetricsResponse>;
|
package/dist/api/metrics.api.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLastIncidentSentinelMetrics = exports.getLatencySentinelMetrics = exports.getSentinelMetrics = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const getSentinelMetrics = async (params, query) => {
|
|
6
|
-
return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}`, { params: query })).data;
|
|
7
|
-
};
|
|
8
|
-
exports.getSentinelMetrics = getSentinelMetrics;
|
|
9
|
-
const getLatencySentinelMetrics = async (params, query) => {
|
|
10
|
-
return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}/latency`, { params: query })).data;
|
|
11
|
-
};
|
|
12
|
-
exports.getLatencySentinelMetrics = getLatencySentinelMetrics;
|
|
13
|
-
const getLastIncidentSentinelMetrics = async (params, query) => {
|
|
14
|
-
return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}/last-incident`, { params: query })).data;
|
|
15
|
-
};
|
|
16
|
-
exports.getLastIncidentSentinelMetrics = getLastIncidentSentinelMetrics;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReportAdmin = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const getReportAdmin = async (body) => {
|
|
6
|
-
return (await __1.AbyssMonitorCore.axios.post(`report/admin/report`, body))
|
|
7
|
-
.data;
|
|
8
|
-
};
|
|
9
|
-
exports.getReportAdmin = getReportAdmin;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { APIMethod } from '../../types';
|
|
2
|
-
import Joi from 'joi';
|
|
3
|
-
export type ValidationOptions = {
|
|
4
|
-
shouldNotGenerateSwagger?: boolean;
|
|
5
|
-
};
|
|
6
|
-
type Middleware = Record<string, any>;
|
|
7
|
-
type DecorationRouteOptions = {
|
|
8
|
-
path?: string;
|
|
9
|
-
shouldNotPublishLog?: boolean;
|
|
10
|
-
shouldSkipController?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type BaseRouteOptions = {
|
|
13
|
-
method: APIMethod;
|
|
14
|
-
docs?: Docs;
|
|
15
|
-
middlewares?: Middleware[];
|
|
16
|
-
} & DecorationRouteOptions;
|
|
17
|
-
export type Docs = {
|
|
18
|
-
description?: string;
|
|
19
|
-
isMasked?: boolean;
|
|
20
|
-
body?: {
|
|
21
|
-
description?: string;
|
|
22
|
-
content?: Record<string, any>;
|
|
23
|
-
} | Record<string, any>;
|
|
24
|
-
params?: {
|
|
25
|
-
description?: string;
|
|
26
|
-
content?: Record<string, any>;
|
|
27
|
-
} | Record<string, any>;
|
|
28
|
-
query?: {
|
|
29
|
-
description?: string;
|
|
30
|
-
content?: Record<string, any>;
|
|
31
|
-
} | Record<string, any>;
|
|
32
|
-
response?: {
|
|
33
|
-
description?: string;
|
|
34
|
-
content?: Record<string, any>;
|
|
35
|
-
} | Record<string, any>;
|
|
36
|
-
};
|
|
37
|
-
export declare function Get(options: DecorationRouteOptions | string, docs?: Docs): any;
|
|
38
|
-
export declare function Post(options: DecorationRouteOptions | string, docs?: Docs): any;
|
|
39
|
-
export declare function Put(options: DecorationRouteOptions | string, docs?: Docs): any;
|
|
40
|
-
export declare function Delete(options: DecorationRouteOptions | string, docs?: Docs): any;
|
|
41
|
-
export declare function Patch(options: DecorationRouteOptions | string, docs?: Docs): any;
|
|
42
|
-
export declare function Controller(options: {
|
|
43
|
-
prefixPath?: string;
|
|
44
|
-
middlewares?: Middleware[];
|
|
45
|
-
isMasked?: boolean;
|
|
46
|
-
} | string): any;
|
|
47
|
-
export declare function Middleware(): any;
|
|
48
|
-
export declare function Middlewares(middlewares: Middleware[]): any;
|
|
49
|
-
export declare function Body(schema: Joi.Schema, options?: ValidationOptions): any;
|
|
50
|
-
export declare function Params(schema: Joi.Schema, options?: ValidationOptions): any;
|
|
51
|
-
export declare function Query(schema: Joi.Schema, options?: ValidationOptions): any;
|
|
52
|
-
export {};
|
|
@@ -1,163 +0,0 @@
|
|
|
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.Query = exports.Params = exports.Body = exports.Middlewares = exports.Middleware = exports.Controller = exports.Patch = exports.Delete = exports.Put = exports.Post = exports.Get = void 0;
|
|
7
|
-
const types_1 = require("../../types");
|
|
8
|
-
const _1 = require(".");
|
|
9
|
-
const joi_to_swagger_1 = __importDefault(require("joi-to-swagger"));
|
|
10
|
-
function Route(options) {
|
|
11
|
-
return function (target, propertyKey, descriptor) {
|
|
12
|
-
Reflect.defineMetadata(_1.ROUTE_WATERMARK, true, target, propertyKey);
|
|
13
|
-
Reflect.defineMetadata(_1.PATH_WATERMARK, options.path, target, propertyKey);
|
|
14
|
-
Reflect.defineMetadata(_1.METHOD_WATERMARK, options.method, target, propertyKey);
|
|
15
|
-
Reflect.defineMetadata(_1.OPTIONS_WATERMARK, options, target, propertyKey);
|
|
16
|
-
if (options.docs) {
|
|
17
|
-
Reflect.defineMetadata(_1.DOCS_WATERMARK, options.docs, target, propertyKey);
|
|
18
|
-
}
|
|
19
|
-
const originalMethod = descriptor.value;
|
|
20
|
-
descriptor.value = function (...args) {
|
|
21
|
-
args[1].locals.shouldNotPublishLog =
|
|
22
|
-
typeof options === 'string' ? false : options.shouldNotPublishLog;
|
|
23
|
-
return originalMethod.apply(target, args);
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function Get(options, docs) {
|
|
28
|
-
return Route({
|
|
29
|
-
...(typeof options === 'string' ? { path: options } : options),
|
|
30
|
-
docs,
|
|
31
|
-
method: types_1.APIMethod.GET,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
exports.Get = Get;
|
|
35
|
-
function Post(options, docs) {
|
|
36
|
-
return Route({
|
|
37
|
-
...(typeof options === 'string' ? { path: options } : options),
|
|
38
|
-
docs,
|
|
39
|
-
method: types_1.APIMethod.POST,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
exports.Post = Post;
|
|
43
|
-
function Put(options, docs) {
|
|
44
|
-
return Route({
|
|
45
|
-
...(typeof options === 'string' ? { path: options } : options),
|
|
46
|
-
docs,
|
|
47
|
-
method: types_1.APIMethod.PUT,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
exports.Put = Put;
|
|
51
|
-
function Delete(options, docs) {
|
|
52
|
-
return Route({
|
|
53
|
-
...(typeof options === 'string' ? { path: options } : options),
|
|
54
|
-
docs,
|
|
55
|
-
method: types_1.APIMethod.DELETE,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
exports.Delete = Delete;
|
|
59
|
-
function Patch(options, docs) {
|
|
60
|
-
return Route({
|
|
61
|
-
...(typeof options === 'string' ? { path: options } : options),
|
|
62
|
-
docs,
|
|
63
|
-
method: types_1.APIMethod.PATCH,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
exports.Patch = Patch;
|
|
67
|
-
function Controller(options) {
|
|
68
|
-
const defaultPath = '/';
|
|
69
|
-
return function (target) {
|
|
70
|
-
var _a;
|
|
71
|
-
Reflect.defineMetadata(_1.CONTROLLER_WATERMARK, true, target);
|
|
72
|
-
Reflect.defineMetadata(_1.MASKED_WATERMARK, (typeof options === 'string' ? false : options.isMasked) || false, target);
|
|
73
|
-
Reflect.defineMetadata(_1.PATH_WATERMARK, (typeof options === 'string' ? options : options.prefixPath) || defaultPath, target);
|
|
74
|
-
const existingMiddlewares = Reflect.getMetadata(_1.MIDDLEWARE_HOOK_WATERMARK, target) || [];
|
|
75
|
-
Reflect.defineMetadata(_1.MIDDLEWARE_HOOK_WATERMARK, (typeof options === 'string'
|
|
76
|
-
? existingMiddlewares
|
|
77
|
-
: [
|
|
78
|
-
...existingMiddlewares,
|
|
79
|
-
...(((_a = options.middlewares) === null || _a === void 0 ? void 0 : _a.map((middleware) => middleware.name)) || []),
|
|
80
|
-
]) || existingMiddlewares, target);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
exports.Controller = Controller;
|
|
84
|
-
function Middleware() {
|
|
85
|
-
return function (target) {
|
|
86
|
-
Reflect.defineMetadata(_1.MIDDLEWARE_WATERMARK, true, target);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
exports.Middleware = Middleware;
|
|
90
|
-
function Middlewares(middlewares) {
|
|
91
|
-
return function (target, propertyKey) {
|
|
92
|
-
const existingMiddlewares = Reflect.getMetadata(_1.MIDDLEWARE_HOOK_WATERMARK, target) || [];
|
|
93
|
-
Reflect.defineMetadata(_1.MIDDLEWARE_HOOK_WATERMARK, [...existingMiddlewares, ...((middlewares === null || middlewares === void 0 ? void 0 : middlewares.map((middleware) => middleware.name)) || [])] ||
|
|
94
|
-
existingMiddlewares, target, propertyKey);
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
exports.Middlewares = Middlewares;
|
|
98
|
-
function Body(schema, options) {
|
|
99
|
-
return function (target, propertyKey, descriptor) {
|
|
100
|
-
const existingDocs = Reflect.getMetadata(_1.DOCS_WATERMARK, target, propertyKey) || {};
|
|
101
|
-
if (!existingDocs.body) {
|
|
102
|
-
existingDocs.body = {};
|
|
103
|
-
}
|
|
104
|
-
if (!(options === null || options === void 0 ? void 0 : options.shouldNotGenerateSwagger)) {
|
|
105
|
-
existingDocs.body.content = (0, joi_to_swagger_1.default)(schema).swagger;
|
|
106
|
-
}
|
|
107
|
-
Reflect.defineMetadata(_1.DOCS_WATERMARK, existingDocs, target, propertyKey);
|
|
108
|
-
const originalMethod = descriptor.value;
|
|
109
|
-
descriptor.value = function (...args) {
|
|
110
|
-
const result = schema.options({ presence: 'required' }).validate(args[0].body);
|
|
111
|
-
if (result.error) {
|
|
112
|
-
throw result.error;
|
|
113
|
-
}
|
|
114
|
-
args[0].body = result.value;
|
|
115
|
-
return originalMethod.apply(target, args);
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
exports.Body = Body;
|
|
120
|
-
function Params(schema, options) {
|
|
121
|
-
return function (target, propertyKey, descriptor) {
|
|
122
|
-
const existingDocs = Reflect.getMetadata(_1.DOCS_WATERMARK, target, propertyKey) || {};
|
|
123
|
-
if (!existingDocs.params) {
|
|
124
|
-
existingDocs.params = {};
|
|
125
|
-
}
|
|
126
|
-
if (!(options === null || options === void 0 ? void 0 : options.shouldNotGenerateSwagger)) {
|
|
127
|
-
existingDocs.params.content = (0, joi_to_swagger_1.default)(schema).swagger;
|
|
128
|
-
}
|
|
129
|
-
Reflect.defineMetadata(_1.DOCS_WATERMARK, existingDocs, target, propertyKey);
|
|
130
|
-
const originalMethod = descriptor.value;
|
|
131
|
-
descriptor.value = function (...args) {
|
|
132
|
-
const result = schema.options({ presence: 'required' }).validate(args[0].params);
|
|
133
|
-
if (result.error) {
|
|
134
|
-
throw result.error;
|
|
135
|
-
}
|
|
136
|
-
args[0].params = result.value;
|
|
137
|
-
return originalMethod.apply(target, args);
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
exports.Params = Params;
|
|
142
|
-
function Query(schema, options) {
|
|
143
|
-
return function (target, propertyKey, descriptor) {
|
|
144
|
-
const existingDocs = Reflect.getMetadata(_1.DOCS_WATERMARK, target, propertyKey) || {};
|
|
145
|
-
if (!existingDocs.query) {
|
|
146
|
-
existingDocs.query = {};
|
|
147
|
-
}
|
|
148
|
-
if (!(options === null || options === void 0 ? void 0 : options.shouldNotGenerateSwagger)) {
|
|
149
|
-
existingDocs.query.content = (0, joi_to_swagger_1.default)(schema).swagger;
|
|
150
|
-
}
|
|
151
|
-
Reflect.defineMetadata(_1.DOCS_WATERMARK, existingDocs, target, propertyKey);
|
|
152
|
-
const originalMethod = descriptor.value;
|
|
153
|
-
descriptor.value = function (...args) {
|
|
154
|
-
const result = schema.options({ presence: 'required' }).validate(args[0].query);
|
|
155
|
-
if (result.error) {
|
|
156
|
-
throw result.error;
|
|
157
|
-
}
|
|
158
|
-
args[0].query = result.value;
|
|
159
|
-
return originalMethod.apply(target, args);
|
|
160
|
-
};
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
exports.Query = Query;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from './decorators';
|
|
2
|
-
export * from './metadata';
|
|
3
|
-
import 'reflect-metadata';
|
|
4
|
-
import express, { Router } from 'express-serve-static-core';
|
|
5
|
-
type Options = {
|
|
6
|
-
prefix: string;
|
|
7
|
-
middlewares: any[];
|
|
8
|
-
controllers: any[];
|
|
9
|
-
router: (option: any) => Router;
|
|
10
|
-
disableTrustProxy?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const controllerLoader: (app: express.Application, options: Options) => Promise<{
|
|
13
|
-
swagger: {
|
|
14
|
-
tags: string[];
|
|
15
|
-
paths: Record<string, any>;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
@@ -1,173 +0,0 @@
|
|
|
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
|
-
exports.controllerLoader = void 0;
|
|
18
|
-
__exportStar(require("./decorators"), exports);
|
|
19
|
-
__exportStar(require("./metadata"), exports);
|
|
20
|
-
const metadata_1 = require("./metadata");
|
|
21
|
-
require("reflect-metadata");
|
|
22
|
-
const types_1 = require("../../types");
|
|
23
|
-
const controllerLoader = async (app, options) => {
|
|
24
|
-
var _a, _b, _c, _d;
|
|
25
|
-
try {
|
|
26
|
-
if (options.disableTrustProxy !== true) {
|
|
27
|
-
app.set('trust proxy', true);
|
|
28
|
-
}
|
|
29
|
-
const middlewares = options.middlewares.map((middleware) => new middleware());
|
|
30
|
-
const controllers = options.controllers;
|
|
31
|
-
const tags = [];
|
|
32
|
-
const paths = {};
|
|
33
|
-
const mainRouter = options.router({ mergeParams: true });
|
|
34
|
-
for (const controller of controllers) {
|
|
35
|
-
const instance = new controller();
|
|
36
|
-
const isMasked = Reflect.getMetadata(metadata_1.MASKED_WATERMARK, controller);
|
|
37
|
-
const middlewareHooks = Reflect.getMetadata(metadata_1.MIDDLEWARE_HOOK_WATERMARK, controller) || [];
|
|
38
|
-
const controllerPrefix = Reflect.getMetadata(metadata_1.PATH_WATERMARK, controller);
|
|
39
|
-
const tag = controller.name;
|
|
40
|
-
if (!isMasked) {
|
|
41
|
-
tags.push(tag);
|
|
42
|
-
}
|
|
43
|
-
const router = options.router({ mergeParams: true });
|
|
44
|
-
const middlewaresToUseOnController = middlewareHooks.map((element) => {
|
|
45
|
-
const middleware = middlewares.find((middleware) => {
|
|
46
|
-
return middleware.constructor.name === element;
|
|
47
|
-
});
|
|
48
|
-
if (!middleware) {
|
|
49
|
-
console.error(`Middleware ${element} on controller ${controller} do not exist`);
|
|
50
|
-
}
|
|
51
|
-
return middleware;
|
|
52
|
-
});
|
|
53
|
-
for (const method of Object.getOwnPropertyNames(controller.prototype)) {
|
|
54
|
-
if (!isRoute(instance, method)) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
const routeOptions = Reflect.getMetadata(metadata_1.OPTIONS_WATERMARK, instance, method);
|
|
58
|
-
const path = Reflect.getMetadata(metadata_1.PATH_WATERMARK, instance, method);
|
|
59
|
-
const docs = Reflect.getMetadata(metadata_1.DOCS_WATERMARK, instance, method) || {};
|
|
60
|
-
const apiMethod = Reflect.getMetadata(metadata_1.METHOD_WATERMARK, instance, method);
|
|
61
|
-
const routeMiddlewareHooks = Reflect.getMetadata(metadata_1.MIDDLEWARE_HOOK_WATERMARK, instance, method) || [];
|
|
62
|
-
const fullPath = `${routeOptions.shouldSkipController ? '' : controllerPrefix}${path}`;
|
|
63
|
-
if (!paths[fullPath]) {
|
|
64
|
-
paths[fullPath] = {};
|
|
65
|
-
}
|
|
66
|
-
if (!docs.isMasked && !isMasked) {
|
|
67
|
-
paths[fullPath][types_1.APIMethod[apiMethod].toLowerCase()] = {
|
|
68
|
-
tags: [tag],
|
|
69
|
-
description: docs.description || '',
|
|
70
|
-
requestBody: {
|
|
71
|
-
description: (_a = docs.body) === null || _a === void 0 ? void 0 : _a.description,
|
|
72
|
-
content: {
|
|
73
|
-
'application/json': {
|
|
74
|
-
schema: (_b = docs === null || docs === void 0 ? void 0 : docs.body) === null || _b === void 0 ? void 0 : _b.content,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
parameters: [
|
|
79
|
-
...Object.entries(((_c = docs.params) === null || _c === void 0 ? void 0 : _c.content.properties) || {}).map(([key, entry]) => {
|
|
80
|
-
return {
|
|
81
|
-
name: key,
|
|
82
|
-
in: 'path',
|
|
83
|
-
description: entry.description || '',
|
|
84
|
-
required: true,
|
|
85
|
-
schema: entry,
|
|
86
|
-
};
|
|
87
|
-
}),
|
|
88
|
-
...Object.entries(((_d = docs.query) === null || _d === void 0 ? void 0 : _d.content.properties) || {}).map(([key, entry]) => {
|
|
89
|
-
return {
|
|
90
|
-
name: key,
|
|
91
|
-
in: 'query',
|
|
92
|
-
description: entry.description || '',
|
|
93
|
-
required: true,
|
|
94
|
-
schema: entry,
|
|
95
|
-
};
|
|
96
|
-
}),
|
|
97
|
-
],
|
|
98
|
-
responses: {},
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
const middlewaresToUseOnRoute = routeMiddlewareHooks.map((element) => {
|
|
102
|
-
const middleware = middlewares.find((middleware) => middleware.constructor.name === element);
|
|
103
|
-
if (!middleware) {
|
|
104
|
-
console.error(`Middleware ${element} on controller ${controller} on route ${path} do not exist`);
|
|
105
|
-
}
|
|
106
|
-
return middleware;
|
|
107
|
-
});
|
|
108
|
-
const routerToUse = routeOptions.shouldSkipController ? mainRouter : router;
|
|
109
|
-
switch (apiMethod) {
|
|
110
|
-
case types_1.APIMethod.DELETE:
|
|
111
|
-
routerToUse.delete(path, ...(routeOptions.shouldSkipController
|
|
112
|
-
? []
|
|
113
|
-
: middlewaresToUseOnController.map((middleware) => middleware.run)), setLocalsMiddleware(controller, options, fullPath, null), ...middlewaresToUseOnRoute.map((middleware) => middleware.run), instance[method]);
|
|
114
|
-
break;
|
|
115
|
-
case types_1.APIMethod.GET:
|
|
116
|
-
routerToUse.get(path, ...(routeOptions.shouldSkipController
|
|
117
|
-
? []
|
|
118
|
-
: middlewaresToUseOnController.map((middleware) => middleware.run)), setLocalsMiddleware(controller, options, fullPath, null), ...middlewaresToUseOnRoute.map((middleware) => middleware.run), instance[method]);
|
|
119
|
-
break;
|
|
120
|
-
case types_1.APIMethod.POST:
|
|
121
|
-
routerToUse.post(path, ...(routeOptions.shouldSkipController
|
|
122
|
-
? []
|
|
123
|
-
: middlewaresToUseOnController.map((middleware) => middleware.run)), setLocalsMiddleware(controller, options, fullPath, null), ...middlewaresToUseOnRoute.map((middleware) => middleware.run), instance[method]);
|
|
124
|
-
break;
|
|
125
|
-
case types_1.APIMethod.PUT:
|
|
126
|
-
routerToUse.put(path, ...(routeOptions.shouldSkipController
|
|
127
|
-
? []
|
|
128
|
-
: middlewaresToUseOnController.map((middleware) => middleware.run)), setLocalsMiddleware(controller, options, fullPath, null), ...middlewaresToUseOnRoute.map((middleware) => middleware.run), instance[method]);
|
|
129
|
-
break;
|
|
130
|
-
case types_1.APIMethod.PATCH:
|
|
131
|
-
routerToUse.patch(path, ...(routeOptions.shouldSkipController
|
|
132
|
-
? []
|
|
133
|
-
: middlewaresToUseOnController.map((middleware) => middleware.run)), setLocalsMiddleware(controller, options, fullPath, null), ...middlewaresToUseOnRoute.map((middleware) => middleware.run), instance[method]);
|
|
134
|
-
break;
|
|
135
|
-
default:
|
|
136
|
-
console.error(`Method ${apiMethod} on route ${path} of controller ${controller} do not exist`);
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
mainRouter.use(`${controllerPrefix}`, setLocalsMiddleware(controller, options, controllerPrefix), router);
|
|
141
|
-
}
|
|
142
|
-
app.use(options.prefix, mainRouter);
|
|
143
|
-
return {
|
|
144
|
-
swagger: {
|
|
145
|
-
tags,
|
|
146
|
-
paths,
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
console.error(error);
|
|
152
|
-
throw error;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
exports.controllerLoader = controllerLoader;
|
|
156
|
-
const isRoute = (target, propertyKey) => {
|
|
157
|
-
try {
|
|
158
|
-
if (Reflect.getMetadata(metadata_1.ROUTE_WATERMARK, target, propertyKey)) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const setLocalsMiddleware = (controller, options = { prefix: '/' }, controllerPrefix, path) => (req, res, next) => {
|
|
170
|
-
res.locals.controller = controller.name;
|
|
171
|
-
res.locals.path = `${options.prefix}${controllerPrefix}${path !== null ? path || req.path : ''}`;
|
|
172
|
-
next();
|
|
173
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const CONTROLLER_WATERMARK = "__controller__";
|
|
2
|
-
export declare const MASKED_WATERMARK = "__masked__";
|
|
3
|
-
export declare const PATH_WATERMARK = "__path__";
|
|
4
|
-
export declare const METHOD_WATERMARK = "__method__";
|
|
5
|
-
export declare const OPTIONS_WATERMARK = "__OPTIONS__";
|
|
6
|
-
export declare const ROUTE_WATERMARK = "__route__";
|
|
7
|
-
export declare const DOCS_WATERMARK = "__docs__";
|
|
8
|
-
export declare const MIDDLEWARE_WATERMARK = "__middleware__";
|
|
9
|
-
export declare const MIDDLEWARE_HOOK_WATERMARK = "__middleware_hook__";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MIDDLEWARE_HOOK_WATERMARK = exports.MIDDLEWARE_WATERMARK = exports.DOCS_WATERMARK = exports.ROUTE_WATERMARK = exports.OPTIONS_WATERMARK = exports.METHOD_WATERMARK = exports.PATH_WATERMARK = exports.MASKED_WATERMARK = exports.CONTROLLER_WATERMARK = void 0;
|
|
4
|
-
exports.CONTROLLER_WATERMARK = '__controller__';
|
|
5
|
-
exports.MASKED_WATERMARK = '__masked__';
|
|
6
|
-
exports.PATH_WATERMARK = '__path__';
|
|
7
|
-
exports.METHOD_WATERMARK = '__method__';
|
|
8
|
-
exports.OPTIONS_WATERMARK = '__OPTIONS__';
|
|
9
|
-
exports.ROUTE_WATERMARK = '__route__';
|
|
10
|
-
exports.DOCS_WATERMARK = '__docs__';
|
|
11
|
-
exports.MIDDLEWARE_WATERMARK = '__middleware__';
|
|
12
|
-
exports.MIDDLEWARE_HOOK_WATERMARK = '__middleware_hook__';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './express';
|
package/dist/frameworks/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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("./express"), exports);
|
|
@@ -1,12 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,19 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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>;
|