@abyss-project/monitor 1.0.14 → 1.0.16

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.
Files changed (50) hide show
  1. package/dist/api/application-sentinel.admin.api.d.ts +9 -0
  2. package/dist/api/application-sentinel.admin.api.js +36 -0
  3. package/dist/api/application-sentinel.api.d.ts +9 -0
  4. package/dist/api/application-sentinel.api.js +36 -0
  5. package/dist/api/index.d.ts +3 -0
  6. package/dist/api/index.js +3 -0
  7. package/dist/api/metrics.api.d.ts +2 -0
  8. package/dist/api/metrics.api.js +8 -0
  9. package/dist/types/enum/api-error.enum.d.ts +2 -1
  10. package/dist/types/enum/api-error.enum.js +1 -0
  11. package/dist/types/enum/application-sentinel-type.enum.d.ts +5 -0
  12. package/dist/types/enum/application-sentinel-type.enum.js +9 -0
  13. package/dist/types/enum/application-webhook-scope.enum.d.ts +2 -1
  14. package/dist/types/enum/application-webhook-scope.enum.js +1 -0
  15. package/dist/types/enum/index.d.ts +1 -0
  16. package/dist/types/enum/index.js +1 -0
  17. package/dist/types/interface/api/index.d.ts +6 -0
  18. package/dist/types/interface/api/index.js +6 -0
  19. package/dist/types/interface/api/requests/application-sentinel.admin.request.d.ts +52 -0
  20. package/dist/types/interface/api/requests/application-sentinel.admin.request.js +2 -0
  21. package/dist/types/interface/api/requests/application-sentinel.request.d.ts +63 -0
  22. package/dist/types/interface/api/requests/application-sentinel.request.js +2 -0
  23. package/dist/types/interface/api/requests/application-webhook-history.admin.request.d.ts +3 -0
  24. package/dist/types/interface/api/requests/application-webhook-history.request.d.ts +3 -0
  25. package/dist/types/interface/api/requests/metrics.request.d.ts +3 -0
  26. package/dist/types/interface/api/requests/metrics.request.js +2 -0
  27. package/dist/types/interface/api/responses/application-sentinel.admin.response.d.ts +26 -0
  28. package/dist/types/interface/api/responses/application-sentinel.admin.response.js +2 -0
  29. package/dist/types/interface/api/responses/application-sentinel.response copy.d.ts +26 -0
  30. package/dist/types/interface/api/responses/application-sentinel.response copy.js +2 -0
  31. package/dist/types/interface/api/responses/application-sentinel.response.d.ts +26 -0
  32. package/dist/types/interface/api/responses/application-sentinel.response.js +2 -0
  33. package/dist/types/interface/api/responses/metrics.response.d.ts +7 -0
  34. package/dist/types/interface/api/responses/metrics.response.js +2 -0
  35. package/dist/types/interface/dto/application-sentinel-configuration.dto.d.ts +68 -0
  36. package/dist/types/interface/dto/application-sentinel-configuration.dto.js +4 -0
  37. package/dist/types/interface/dto/index.d.ts +1 -0
  38. package/dist/types/interface/dto/index.js +1 -0
  39. package/dist/types/interface/dto/webhook.dto.d.ts +11 -2
  40. package/dist/types/interface/index.d.ts +2 -0
  41. package/dist/types/interface/index.js +2 -0
  42. package/dist/types/interface/models/application-event.model.d.ts +2 -0
  43. package/dist/types/interface/models/application-sentinel-history.model.d.ts +16 -0
  44. package/dist/types/interface/models/application-sentinel-history.model.js +2 -0
  45. package/dist/types/interface/models/application-sentinel.model.d.ts +18 -0
  46. package/dist/types/interface/models/application-sentinel.model.js +2 -0
  47. package/dist/types/interface/models/application-webhook-history.model.d.ts +6 -0
  48. package/dist/types/interface/models/application-webhook.model.d.ts +6 -0
  49. package/dist/types/interface/models/application.model.d.ts +2 -0
  50. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { ICreateApplicationSentinelAdminBody, ICreateApplicationSentinelAdminParams, ICreateApplicationSentinelAdminResponse, IDeleteApplicationSentinelAdminParams, IDeleteApplicationSentinelAdminResponse, IGetHistoryApplicationSentinelAdminParams, IGetHistoryApplicationSentinelAdminResponse, IGetApplicationSentinelAdminParams, IGetApplicationSentinelAdminResponse, IPaginateHistoryApplicationSentinelAdminQuery, IPaginateHistoryApplicationSentinelAdminResponse, IPaginateApplicationSentinelAdminQuery, IPaginateApplicationSentinelAdminResponse, IUpdateApplicationSentinelAdminBody, IUpdateApplicationSentinelAdminParams, IUpdateApplicationSentinelAdminResponse, ITriggerApplicationSentinelAdminParams, ITriggerApplicationSentinelAdminResponse } from '..';
2
+ export declare const getApplicationSentinelAdmin: (params: IGetApplicationSentinelAdminParams) => Promise<IGetApplicationSentinelAdminResponse>;
3
+ export declare const paginateApplicationSentinelAdmin: (query: IPaginateApplicationSentinelAdminQuery) => Promise<IPaginateApplicationSentinelAdminResponse>;
4
+ export declare const createApplicationSentinelAdmin: (params: ICreateApplicationSentinelAdminParams, body: ICreateApplicationSentinelAdminBody) => Promise<ICreateApplicationSentinelAdminResponse>;
5
+ export declare const updateApplicationSentinelAdmin: (params: IUpdateApplicationSentinelAdminParams, body: IUpdateApplicationSentinelAdminBody) => Promise<IUpdateApplicationSentinelAdminResponse>;
6
+ export declare const deleteApplicationSentinelAdmin: (params: IDeleteApplicationSentinelAdminParams) => Promise<IDeleteApplicationSentinelAdminResponse>;
7
+ export declare const getHistoryApplicationSentinelAdmin: (params: IGetHistoryApplicationSentinelAdminParams) => Promise<IGetHistoryApplicationSentinelAdminResponse>;
8
+ export declare const paginateHistoryApplicationSentinelAdmin: (query: IPaginateHistoryApplicationSentinelAdminQuery) => Promise<IPaginateHistoryApplicationSentinelAdminResponse>;
9
+ export declare const triggerApplicationSentinelAdmin: (params: ITriggerApplicationSentinelAdminParams) => Promise<ITriggerApplicationSentinelAdminResponse>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerApplicationSentinelAdmin = exports.paginateHistoryApplicationSentinelAdmin = exports.getHistoryApplicationSentinelAdmin = exports.deleteApplicationSentinelAdmin = exports.updateApplicationSentinelAdmin = exports.createApplicationSentinelAdmin = exports.paginateApplicationSentinelAdmin = exports.getApplicationSentinelAdmin = void 0;
4
+ const __1 = require("..");
5
+ const getApplicationSentinelAdmin = async (params) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/admin/${params.applicationSentinelId}`)).data;
7
+ };
8
+ exports.getApplicationSentinelAdmin = getApplicationSentinelAdmin;
9
+ const paginateApplicationSentinelAdmin = async (query) => {
10
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/admin/paginate`, { params: query })).data;
11
+ };
12
+ exports.paginateApplicationSentinelAdmin = paginateApplicationSentinelAdmin;
13
+ const createApplicationSentinelAdmin = async (params, body) => {
14
+ return (await __1.AbyssMonitorCore.axios.post(`application-sentinel/admin/${params.applicationId}`, body)).data;
15
+ };
16
+ exports.createApplicationSentinelAdmin = createApplicationSentinelAdmin;
17
+ const updateApplicationSentinelAdmin = async (params, body) => {
18
+ return (await __1.AbyssMonitorCore.axios.put(`application-sentinel/admin/${params.applicationSentinelId}`, body)).data;
19
+ };
20
+ exports.updateApplicationSentinelAdmin = updateApplicationSentinelAdmin;
21
+ const deleteApplicationSentinelAdmin = async (params) => {
22
+ return (await __1.AbyssMonitorCore.axios.delete(`application-sentinel/admin/${params.applicationSentinelId}`)).data;
23
+ };
24
+ exports.deleteApplicationSentinelAdmin = deleteApplicationSentinelAdmin;
25
+ const getHistoryApplicationSentinelAdmin = async (params) => {
26
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/admin/history/${params.applicationSentinelHistoryId}`)).data;
27
+ };
28
+ exports.getHistoryApplicationSentinelAdmin = getHistoryApplicationSentinelAdmin;
29
+ const paginateHistoryApplicationSentinelAdmin = async (query) => {
30
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/admin/history/paginate`, { params: query })).data;
31
+ };
32
+ exports.paginateHistoryApplicationSentinelAdmin = paginateHistoryApplicationSentinelAdmin;
33
+ const triggerApplicationSentinelAdmin = async (params) => {
34
+ return (await __1.AbyssMonitorCore.axios.post(`application-sentinel/admin/${params.applicationSentinelId}/trigger`)).data;
35
+ };
36
+ exports.triggerApplicationSentinelAdmin = triggerApplicationSentinelAdmin;
@@ -0,0 +1,9 @@
1
+ import { ICreateApplicationSentinelBody, ICreateApplicationSentinelParams, ICreateApplicationSentinelResponse, IDeleteApplicationSentinelParams, IDeleteApplicationSentinelResponse, IGetHistoryApplicationSentinelParams, IGetHistoryApplicationSentinelResponse, IGetApplicationSentinelParams, IGetApplicationSentinelResponse, IPaginateHistoryApplicationSentinelParams, IPaginateHistoryApplicationSentinelQuery, IPaginateHistoryApplicationSentinelResponse, IPaginateApplicationSentinelParams, IPaginateApplicationSentinelQuery, IPaginateApplicationSentinelResponse, IUpdateApplicationSentinelBody, IUpdateApplicationSentinelParams, IUpdateApplicationSentinelResponse, ITriggerApplicationSentinelParams, ITriggerApplicationSentinelResponse } from '..';
2
+ export declare const getApplicationSentinel: (params: IGetApplicationSentinelParams) => Promise<IGetApplicationSentinelResponse>;
3
+ export declare const paginateApplicationSentinel: (params: IPaginateApplicationSentinelParams, query: IPaginateApplicationSentinelQuery) => Promise<IPaginateApplicationSentinelResponse>;
4
+ export declare const createApplicationSentinel: (params: ICreateApplicationSentinelParams, body: ICreateApplicationSentinelBody) => Promise<ICreateApplicationSentinelResponse>;
5
+ export declare const updateApplicationSentinel: (params: IUpdateApplicationSentinelParams, body: IUpdateApplicationSentinelBody) => Promise<IUpdateApplicationSentinelResponse>;
6
+ export declare const deleteApplicationSentinel: (params: IDeleteApplicationSentinelParams) => Promise<IDeleteApplicationSentinelResponse>;
7
+ export declare const getHistoryApplicationSentinel: (params: IGetHistoryApplicationSentinelParams) => Promise<IGetHistoryApplicationSentinelResponse>;
8
+ export declare const paginateHistoryApplicationSentinel: (params: IPaginateHistoryApplicationSentinelParams, query: IPaginateHistoryApplicationSentinelQuery) => Promise<IPaginateHistoryApplicationSentinelResponse>;
9
+ export declare const triggerApplicationSentinel: (params: ITriggerApplicationSentinelParams) => Promise<ITriggerApplicationSentinelResponse>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerApplicationSentinel = exports.paginateHistoryApplicationSentinel = exports.getHistoryApplicationSentinel = exports.deleteApplicationSentinel = exports.updateApplicationSentinel = exports.createApplicationSentinel = exports.paginateApplicationSentinel = exports.getApplicationSentinel = void 0;
4
+ const __1 = require("..");
5
+ const getApplicationSentinel = async (params) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}`)).data;
7
+ };
8
+ exports.getApplicationSentinel = getApplicationSentinel;
9
+ const paginateApplicationSentinel = async (params, query) => {
10
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/${params.applicationId}/paginate`, { params: query })).data;
11
+ };
12
+ exports.paginateApplicationSentinel = paginateApplicationSentinel;
13
+ const createApplicationSentinel = async (params, body) => {
14
+ return (await __1.AbyssMonitorCore.axios.post(`application-sentinel/${params.applicationId}`, body)).data;
15
+ };
16
+ exports.createApplicationSentinel = createApplicationSentinel;
17
+ const updateApplicationSentinel = async (params, body) => {
18
+ return (await __1.AbyssMonitorCore.axios.put(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}`, body)).data;
19
+ };
20
+ exports.updateApplicationSentinel = updateApplicationSentinel;
21
+ const deleteApplicationSentinel = async (params) => {
22
+ return (await __1.AbyssMonitorCore.axios.delete(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}`)).data;
23
+ };
24
+ exports.deleteApplicationSentinel = deleteApplicationSentinel;
25
+ const getHistoryApplicationSentinel = async (params) => {
26
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}/history/${params.applicationSentinelHistoryId}`)).data;
27
+ };
28
+ exports.getHistoryApplicationSentinel = getHistoryApplicationSentinel;
29
+ const paginateHistoryApplicationSentinel = async (params, query) => {
30
+ return (await __1.AbyssMonitorCore.axios.get(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}/history/paginate`, { params: query })).data;
31
+ };
32
+ exports.paginateHistoryApplicationSentinel = paginateHistoryApplicationSentinel;
33
+ const triggerApplicationSentinel = async (params) => {
34
+ return (await __1.AbyssMonitorCore.axios.post(`application-sentinel/${params.applicationId}/${params.applicationSentinelId}/trigger`)).data;
35
+ };
36
+ exports.triggerApplicationSentinel = triggerApplicationSentinel;
@@ -16,3 +16,6 @@ export * from './application-webhook.admin.api';
16
16
  export * from './application-webhook.api';
17
17
  export * from './application-webhook-history.api';
18
18
  export * from './application-webhook-history.admin.api';
19
+ export * from './application-sentinel.api';
20
+ export * from './application-sentinel.admin.api';
21
+ export * from './metrics.api';
package/dist/api/index.js CHANGED
@@ -32,3 +32,6 @@ __exportStar(require("./application-webhook.admin.api"), exports);
32
32
  __exportStar(require("./application-webhook.api"), exports);
33
33
  __exportStar(require("./application-webhook-history.api"), exports);
34
34
  __exportStar(require("./application-webhook-history.admin.api"), exports);
35
+ __exportStar(require("./application-sentinel.api"), exports);
36
+ __exportStar(require("./application-sentinel.admin.api"), exports);
37
+ __exportStar(require("./metrics.api"), exports);
@@ -0,0 +1,2 @@
1
+ import { IGetSentinelMetricsParams, IGetSentinelMetricsResponse } from '../types';
2
+ export declare const getSentinelMetrics: (params: IGetSentinelMetricsParams) => Promise<IGetSentinelMetricsResponse>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSentinelMetrics = void 0;
4
+ const __1 = require("..");
5
+ const getSentinelMetrics = async (params) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}`)).data;
7
+ };
8
+ exports.getSentinelMetrics = getSentinelMetrics;
@@ -17,5 +17,6 @@ export declare enum Code {
17
17
  maxCronTaskNumber = "max_cron_task_number",
18
18
  maxStoreEntryNumber = "max_store_entry_number",
19
19
  slugAlreadyExist = "slug_already_exist",
20
- maxEventPublishPerDay = "max_event_publish_per_day"
20
+ maxEventPublishPerDay = "max_event_publish_per_day",
21
+ maxSentinelNumber = "max_sentinel_number"
21
22
  }
@@ -23,4 +23,5 @@ var Code;
23
23
  Code["maxStoreEntryNumber"] = "max_store_entry_number";
24
24
  Code["slugAlreadyExist"] = "slug_already_exist";
25
25
  Code["maxEventPublishPerDay"] = "max_event_publish_per_day";
26
+ Code["maxSentinelNumber"] = "max_sentinel_number";
26
27
  })(Code || (exports.Code = Code = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum ApplicationSentinelType {
2
+ PING = "PING",
3
+ HTTP = "HTTP",
4
+ TCP = "TCP"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplicationSentinelType = void 0;
4
+ var ApplicationSentinelType;
5
+ (function (ApplicationSentinelType) {
6
+ ApplicationSentinelType["PING"] = "PING";
7
+ ApplicationSentinelType["HTTP"] = "HTTP";
8
+ ApplicationSentinelType["TCP"] = "TCP";
9
+ })(ApplicationSentinelType || (exports.ApplicationSentinelType = ApplicationSentinelType = {}));
@@ -1,3 +1,4 @@
1
1
  export declare enum ApplicationWebhookScope {
2
- EVENT = "EVENT"
2
+ EVENT = "EVENT",
3
+ SENTINEL = "SENTINEL"
3
4
  }
@@ -4,4 +4,5 @@ exports.ApplicationWebhookScope = void 0;
4
4
  var ApplicationWebhookScope;
5
5
  (function (ApplicationWebhookScope) {
6
6
  ApplicationWebhookScope["EVENT"] = "EVENT";
7
+ ApplicationWebhookScope["SENTINEL"] = "SENTINEL";
7
8
  })(ApplicationWebhookScope || (exports.ApplicationWebhookScope = ApplicationWebhookScope = {}));
@@ -5,3 +5,4 @@ export * from './application-alert-type.enum';
5
5
  export * from './log-level.enum';
6
6
  export * from './log-scenario.enum';
7
7
  export * from './application-webhook-scope.enum';
8
+ export * from './application-sentinel-type.enum';
@@ -21,3 +21,4 @@ __exportStar(require("./application-alert-type.enum"), exports);
21
21
  __exportStar(require("./log-level.enum"), exports);
22
22
  __exportStar(require("./log-scenario.enum"), exports);
23
23
  __exportStar(require("./application-webhook-scope.enum"), exports);
24
+ __exportStar(require("./application-sentinel-type.enum"), exports);
@@ -19,6 +19,9 @@ export * from './requests/application-webhook.request';
19
19
  export * from './requests/application-webhook.admin.request';
20
20
  export * from './requests/application-webhook-history.admin.request';
21
21
  export * from './requests/application-webhook-history.request';
22
+ export * from './requests/application-sentinel.admin.request';
23
+ export * from './requests/application-sentinel.request';
24
+ export * from './requests/metrics.request';
22
25
  export * from './responses/application.response';
23
26
  export * from './responses/application.admin.response';
24
27
  export * from './responses/application-stats.admin.response';
@@ -37,3 +40,6 @@ export * from './responses/application-webhook.response';
37
40
  export * from './responses/application-webhook.admin.response';
38
41
  export * from './responses/application-webhook-history.admin.response';
39
42
  export * from './responses/application-webhook-history.response';
43
+ export * from './responses/application-sentinel.admin.response';
44
+ export * from './responses/application-sentinel.response';
45
+ export * from './responses/metrics.response';
@@ -35,6 +35,9 @@ __exportStar(require("./requests/application-webhook.request"), exports);
35
35
  __exportStar(require("./requests/application-webhook.admin.request"), exports);
36
36
  __exportStar(require("./requests/application-webhook-history.admin.request"), exports);
37
37
  __exportStar(require("./requests/application-webhook-history.request"), exports);
38
+ __exportStar(require("./requests/application-sentinel.admin.request"), exports);
39
+ __exportStar(require("./requests/application-sentinel.request"), exports);
40
+ __exportStar(require("./requests/metrics.request"), exports);
38
41
  __exportStar(require("./responses/application.response"), exports);
39
42
  __exportStar(require("./responses/application.admin.response"), exports);
40
43
  __exportStar(require("./responses/application-stats.admin.response"), exports);
@@ -53,3 +56,6 @@ __exportStar(require("./responses/application-webhook.response"), exports);
53
56
  __exportStar(require("./responses/application-webhook.admin.response"), exports);
54
57
  __exportStar(require("./responses/application-webhook-history.admin.response"), exports);
55
58
  __exportStar(require("./responses/application-webhook-history.response"), exports);
59
+ __exportStar(require("./responses/application-sentinel.admin.response"), exports);
60
+ __exportStar(require("./responses/application-sentinel.response"), exports);
61
+ __exportStar(require("./responses/metrics.response"), exports);
@@ -0,0 +1,52 @@
1
+ import { QueryPaginate } from '..';
2
+ import { ApplicationSentinelConfigurationDto } from '../../dto';
3
+ export interface IGetApplicationSentinelAdminParams {
4
+ applicationSentinelId: string;
5
+ }
6
+ export interface IGetHistoryApplicationSentinelAdminParams {
7
+ applicationSentinelHistoryId: string;
8
+ }
9
+ export interface ICreateApplicationSentinelAdminParams {
10
+ applicationId: string;
11
+ }
12
+ export interface ICreateApplicationSentinelAdminBody {
13
+ name: string;
14
+ scheduleConfiguration: string;
15
+ description?: string | null;
16
+ isActivated: boolean;
17
+ alertOnFailure: boolean;
18
+ webhookMetadata: Record<string, string>;
19
+ configuration: ApplicationSentinelConfigurationDto;
20
+ }
21
+ export type IPaginateApplicationSentinelAdminQuery = {
22
+ name?: string[];
23
+ description?: string[];
24
+ webhookUrl?: string[];
25
+ isActivated?: boolean;
26
+ applicationId?: string[];
27
+ } & QueryPaginate;
28
+ export interface IUpdateApplicationSentinelAdminParams {
29
+ applicationSentinelId: string;
30
+ }
31
+ export interface IUpdateApplicationSentinelAdminBody {
32
+ name?: string;
33
+ scheduleConfiguration?: string;
34
+ description?: string | null;
35
+ isActivated?: boolean;
36
+ alertOnFailure?: boolean;
37
+ webhookMetadata?: Record<string, string>;
38
+ configuration?: ApplicationSentinelConfigurationDto;
39
+ }
40
+ export type IPaginateHistoryApplicationSentinelAdminQuery = {
41
+ startDateMin?: Date;
42
+ startDateMax?: Date;
43
+ requestId?: string[];
44
+ applicationId?: string[];
45
+ applicationSentinelId?: string[];
46
+ } & QueryPaginate;
47
+ export interface IDeleteApplicationSentinelAdminParams {
48
+ applicationSentinelId: string;
49
+ }
50
+ export interface ITriggerApplicationSentinelAdminParams {
51
+ applicationSentinelId: string;
52
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,63 @@
1
+ import { QueryPaginate } from '..';
2
+ import { ApplicationSentinelConfigurationDto } from '../../dto';
3
+ export interface IGetApplicationSentinelParams {
4
+ applicationId: string;
5
+ applicationSentinelId: string;
6
+ }
7
+ export interface IGetHistoryApplicationSentinelParams {
8
+ applicationId: string;
9
+ applicationSentinelId: string;
10
+ applicationSentinelHistoryId: string;
11
+ }
12
+ export interface ICreateApplicationSentinelParams {
13
+ applicationId: string;
14
+ }
15
+ export interface ICreateApplicationSentinelBody {
16
+ name: string;
17
+ scheduleConfiguration: string;
18
+ description?: string | null;
19
+ isActivated: boolean;
20
+ alertOnFailure: boolean;
21
+ webhookMetadata: Record<string, string>;
22
+ configuration: ApplicationSentinelConfigurationDto;
23
+ }
24
+ export interface IPaginateApplicationSentinelParams {
25
+ applicationId: string;
26
+ }
27
+ export type IPaginateApplicationSentinelQuery = {
28
+ name?: string[];
29
+ isActivated?: boolean;
30
+ alertOnFailure?: boolean;
31
+ } & QueryPaginate;
32
+ export interface IUpdateApplicationSentinelParams {
33
+ applicationId: string;
34
+ applicationSentinelId: string;
35
+ }
36
+ export interface IUpdateApplicationSentinelBody {
37
+ name?: string;
38
+ scheduleConfiguration?: string;
39
+ description?: string | null;
40
+ isActivated?: boolean;
41
+ alertOnFailure?: boolean;
42
+ webhookMetadata?: Record<string, string>;
43
+ configuration?: ApplicationSentinelConfigurationDto;
44
+ }
45
+ export interface IPaginateHistoryApplicationSentinelParams {
46
+ applicationId: string;
47
+ applicationSentinelId: string;
48
+ }
49
+ export type IPaginateHistoryApplicationSentinelQuery = {
50
+ startDateMin?: Date;
51
+ startDateMax?: Date;
52
+ minLatency?: number;
53
+ maxLatency?: number;
54
+ hasFailed?: boolean;
55
+ } & QueryPaginate;
56
+ export interface IDeleteApplicationSentinelParams {
57
+ applicationId: string;
58
+ applicationSentinelId: string;
59
+ }
60
+ export interface ITriggerApplicationSentinelParams {
61
+ applicationId: string;
62
+ applicationSentinelId: string;
63
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,4 +11,7 @@ export type IPaginateApplicationWebhookHistoryAdminQuery = {
11
11
  webhookId?: string;
12
12
  groupId?: string;
13
13
  scope?: ApplicationWebhookScope[];
14
+ applicationEventId?: string[];
15
+ applicationSentinelHistoryId?: string[];
16
+ applicationSentinelId?: string[];
14
17
  } & QueryPaginate;
@@ -14,4 +14,7 @@ export type IPaginateApplicationWebhookHistoryQuery = {
14
14
  webhookId?: string;
15
15
  groupId?: string;
16
16
  scope?: ApplicationWebhookScope[];
17
+ applicationEventId?: string[];
18
+ applicationSentinelHistoryId?: string[];
19
+ applicationSentinelId?: string[];
17
20
  } & QueryPaginate;
@@ -0,0 +1,3 @@
1
+ export interface IGetSentinelMetricsParams {
2
+ projectId: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { IResponse, IApplicationSentinel, IApplicationSentinelHistory, BasePaginate } from '../..';
2
+ export interface IGetApplicationSentinelAdminData {
3
+ applicationSentinel: IApplicationSentinel;
4
+ }
5
+ export type IGetApplicationSentinelAdminResponse = IResponse<IGetApplicationSentinelAdminData>;
6
+ export interface IUpdateApplicationSentinelAdminData {
7
+ applicationSentinel: IApplicationSentinel;
8
+ }
9
+ export type IUpdateApplicationSentinelAdminResponse = IResponse<IUpdateApplicationSentinelAdminData>;
10
+ export type IPaginateApplicationSentinelAdminResponse = IResponse<BasePaginate<IApplicationSentinel>>;
11
+ export type IPaginateHistoryApplicationSentinelAdminResponse = IResponse<BasePaginate<IApplicationSentinelHistory>>;
12
+ export interface ICreateApplicationSentinelAdminData {
13
+ applicationSentinel: IApplicationSentinel;
14
+ }
15
+ export type ICreateApplicationSentinelAdminResponse = IResponse<ICreateApplicationSentinelAdminData>;
16
+ export interface IGetHistoryApplicationSentinelAdminData {
17
+ applicationSentinelHistory: IApplicationSentinelHistory;
18
+ }
19
+ export type IGetHistoryApplicationSentinelAdminResponse = IResponse<IGetHistoryApplicationSentinelAdminData>;
20
+ export interface IDeleteApplicationSentinelAdminData {
21
+ }
22
+ export type IDeleteApplicationSentinelAdminResponse = IResponse<IDeleteApplicationSentinelAdminData>;
23
+ export interface ITriggerApplicationSentinelAdminData {
24
+ applicationSentinelHistory: IApplicationSentinelHistory;
25
+ }
26
+ export type ITriggerApplicationSentinelAdminResponse = IResponse<ITriggerApplicationSentinelAdminData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { IResponse, IApplicationSentinel, IApplicationSentinelHistory, BasePaginate } from '../..';
2
+ export interface IGetApplicationSentinelData {
3
+ applicationSentinel: IApplicationSentinel;
4
+ }
5
+ export type IGetApplicationSentinelResponse = IResponse<IGetApplicationSentinelData>;
6
+ export interface IGetHistoryApplicationSentinelData {
7
+ applicationSentinelHistory: IApplicationSentinelHistory;
8
+ }
9
+ export type IGetHistoryApplicationSentinelResponse = IResponse<IGetHistoryApplicationSentinelData>;
10
+ export type IPaginateHistoryApplicationSentinelResponse = IResponse<BasePaginate<IApplicationSentinelHistory>>;
11
+ export type IPaginateApplicationSentinelResponse = IResponse<BasePaginate<IApplicationSentinel>>;
12
+ export interface ICreateApplicationSentinelData {
13
+ applicationSentinel: IApplicationSentinel;
14
+ }
15
+ export type ICreateApplicationSentinelResponse = IResponse<ICreateApplicationSentinelData>;
16
+ export interface IUpdateApplicationSentinelData {
17
+ applicationSentinel: IApplicationSentinel;
18
+ }
19
+ export type IUpdateApplicationSentinelResponse = IResponse<IUpdateApplicationSentinelData>;
20
+ export interface IDeleteApplicationSentinelData {
21
+ }
22
+ export type IDeleteApplicationSentinelResponse = IResponse<IDeleteApplicationSentinelData>;
23
+ export interface ITriggerApplicationSentinelData {
24
+ applicationSentinelHistory: IApplicationSentinelHistory;
25
+ }
26
+ export type ITriggerApplicationSentinelResponse = IResponse<ITriggerApplicationSentinelData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,26 @@
1
+ import { IResponse, IApplicationSentinel, IApplicationSentinelHistory, BasePaginate } from '../..';
2
+ export interface IGetApplicationSentinelData {
3
+ applicationSentinel: IApplicationSentinel;
4
+ }
5
+ export type IGetApplicationSentinelResponse = IResponse<IGetApplicationSentinelData>;
6
+ export interface IGetHistoryApplicationSentinelData {
7
+ applicationSentinelHistory: IApplicationSentinelHistory;
8
+ }
9
+ export type IGetHistoryApplicationSentinelResponse = IResponse<IGetHistoryApplicationSentinelData>;
10
+ export type IPaginateHistoryApplicationSentinelResponse = IResponse<BasePaginate<IApplicationSentinelHistory>>;
11
+ export type IPaginateApplicationSentinelResponse = IResponse<BasePaginate<IApplicationSentinel>>;
12
+ export interface ICreateApplicationSentinelData {
13
+ applicationSentinel: IApplicationSentinel;
14
+ }
15
+ export type ICreateApplicationSentinelResponse = IResponse<ICreateApplicationSentinelData>;
16
+ export interface IUpdateApplicationSentinelData {
17
+ applicationSentinel: IApplicationSentinel;
18
+ }
19
+ export type IUpdateApplicationSentinelResponse = IResponse<IUpdateApplicationSentinelData>;
20
+ export interface IDeleteApplicationSentinelData {
21
+ }
22
+ export type IDeleteApplicationSentinelResponse = IResponse<IDeleteApplicationSentinelData>;
23
+ export interface ITriggerApplicationSentinelData {
24
+ applicationSentinelHistory: IApplicationSentinelHistory;
25
+ }
26
+ export type ITriggerApplicationSentinelResponse = IResponse<ITriggerApplicationSentinelData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { IResponse, IApplicationSentinel } from '../..';
2
+ export interface IGetSentinelMetricsData {
3
+ metrics: {
4
+ applicationSentinel: IApplicationSentinel[];
5
+ };
6
+ }
7
+ export type IGetSentinelMetricsResponse = IResponse<IGetSentinelMetricsData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,68 @@
1
+ import { ApplicationSentinelType } from '../../enum/application-sentinel-type.enum';
2
+ import { APIMethod } from '../../enum';
3
+ export declare const MAX_APPLICATION_SENTINEL_RETRY_COUNT = 5;
4
+ export type ApplicationSentinelConfigurationDto = ApplicationSentinelConfigurationPing | ApplicationSentinelConfigurationHttp | ApplicationSentinelConfigurationTcp;
5
+ export type ApplicationSentinelConfigurationPing = {
6
+ type: ApplicationSentinelType.PING;
7
+ host: string;
8
+ successPolicy: {
9
+ latency: {
10
+ min: number;
11
+ max: number;
12
+ };
13
+ };
14
+ };
15
+ export type ApplicationSentinelConfigurationHttp = {
16
+ type: ApplicationSentinelType.HTTP;
17
+ url: string;
18
+ method: APIMethod;
19
+ sslVerification: {
20
+ enabled: boolean;
21
+ allowSelfSigned: boolean;
22
+ };
23
+ headers: Record<string, string>;
24
+ successPolicy: {
25
+ latency: {
26
+ min: number;
27
+ max: number;
28
+ };
29
+ };
30
+ };
31
+ export type ApplicationSentinelConfigurationTcp = {
32
+ type: ApplicationSentinelType.TCP;
33
+ host: string;
34
+ port: number;
35
+ successPolicy: {
36
+ latency: {
37
+ min: number;
38
+ max: number;
39
+ };
40
+ };
41
+ };
42
+ export type ApplicationSentinelResult = {
43
+ isSuccess: boolean;
44
+ latency: number;
45
+ retryCount: number;
46
+ metadata: Record<string, string> | null;
47
+ } & (ApplicationSentinelResultPing | ApplicationSentinelResultHttp | ApplicationSentinelResultTcp);
48
+ export type ApplicationSentinelResultPing = {
49
+ type: ApplicationSentinelType.PING;
50
+ host: string;
51
+ };
52
+ export type ApplicationSentinelResultHttp = {
53
+ type: ApplicationSentinelType.HTTP;
54
+ statusCode: number | null;
55
+ url: string;
56
+ method: APIMethod;
57
+ sslResult: ApplicationSentinelSslResult | null;
58
+ };
59
+ export type ApplicationSentinelResultTcp = {
60
+ type: ApplicationSentinelType.TCP;
61
+ host: string;
62
+ port: number;
63
+ };
64
+ export type ApplicationSentinelSslResult = {
65
+ isSelfSigned: boolean;
66
+ isExpired: boolean;
67
+ expiredAt: Date | null;
68
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_APPLICATION_SENTINEL_RETRY_COUNT = void 0;
4
+ exports.MAX_APPLICATION_SENTINEL_RETRY_COUNT = 5;
@@ -1 +1,2 @@
1
1
  export * from './webhook.dto';
2
+ export * from './application-sentinel-configuration.dto';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./webhook.dto"), exports);
18
+ __exportStar(require("./application-sentinel-configuration.dto"), exports);
@@ -1,12 +1,13 @@
1
1
  import { ApplicationWebhookScope, LogLevel } from '../../enum';
2
+ import { ApplicationSentinelResult } from './application-sentinel-configuration.dto';
2
3
  export type WebhookDTO = {
3
4
  id: string;
4
5
  groupId: string;
5
6
  webhookSecret: string;
6
7
  applicationId: string;
7
- } & WebhookEventPayloadDTO;
8
+ } & (WebhookEventPayloadDTO | WebhookSentinelCheckPayloadDTO);
8
9
  export type WebhookEventPayloadDTO = {
9
- scope: ApplicationWebhookScope;
10
+ scope: ApplicationWebhookScope.EVENT;
10
11
  payload: {
11
12
  event: string;
12
13
  applicationEventId: string;
@@ -16,3 +17,11 @@ export type WebhookEventPayloadDTO = {
16
17
  date: Date;
17
18
  };
18
19
  };
20
+ export type WebhookSentinelCheckPayloadDTO = {
21
+ scope: ApplicationWebhookScope.SENTINEL;
22
+ payload: {
23
+ applicationSentinelId: string;
24
+ applicationSentinelHistoryId: string;
25
+ result: ApplicationSentinelResult;
26
+ };
27
+ };
@@ -8,5 +8,7 @@ export * from './models/application-cron-task-history.model';
8
8
  export * from './models/application-event.model';
9
9
  export * from './models/application-webhook.model';
10
10
  export * from './models/application-webhook-history.model';
11
+ export * from './models/application-sentinel.model';
12
+ export * from './models/application-sentinel-history.model';
11
13
  export * from './api';
12
14
  export * from './dto';
@@ -24,5 +24,7 @@ __exportStar(require("./models/application-cron-task-history.model"), exports);
24
24
  __exportStar(require("./models/application-event.model"), exports);
25
25
  __exportStar(require("./models/application-webhook.model"), exports);
26
26
  __exportStar(require("./models/application-webhook-history.model"), exports);
27
+ __exportStar(require("./models/application-sentinel.model"), exports);
28
+ __exportStar(require("./models/application-sentinel-history.model"), exports);
27
29
  __exportStar(require("./api"), exports);
28
30
  __exportStar(require("./dto"), exports);
@@ -1,5 +1,6 @@
1
1
  import { LogLevel } from '../../enum';
2
2
  import { IApplicationLog } from './application-log.model';
3
+ import { IApplicationWebhookHistory } from './application-webhook-history.model';
3
4
  import { IApplication } from './application.model';
4
5
  export interface IApplicationEvent {
5
6
  id?: string;
@@ -14,4 +15,5 @@ export interface IApplicationEvent {
14
15
  deletedAt?: Date | null;
15
16
  application?: IApplication;
16
17
  applicationLog?: IApplicationLog | null;
18
+ applicationWebhookHistory?: IApplicationWebhookHistory[];
17
19
  }
@@ -0,0 +1,16 @@
1
+ import { ApplicationSentinelResult } from '../dto';
2
+ import { IApplicationSentinel } from './application-sentinel.model';
3
+ import { IApplicationWebhookHistory } from './application-webhook-history.model';
4
+ export interface IApplicationSentinelHistory {
5
+ id?: string;
6
+ applicationSentinelId: string;
7
+ startDate: Date;
8
+ hasFailed: boolean;
9
+ latency: number;
10
+ webhookMetadata: Record<string, string>;
11
+ result: ApplicationSentinelResult;
12
+ updatedAt?: Date;
13
+ createdAt?: Date;
14
+ applicationSentinel?: IApplicationSentinel;
15
+ applicationWebhookHistory?: IApplicationWebhookHistory[];
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { ApplicationSentinelConfigurationDto } from '../dto/application-sentinel-configuration.dto';
2
+ import { IApplicationSentinelHistory } from './application-sentinel-history.model';
3
+ import { IApplication } from './application.model';
4
+ export interface IApplicationSentinel {
5
+ id?: string;
6
+ name: string;
7
+ description: string | null;
8
+ isActivated: boolean;
9
+ applicationId: string;
10
+ alertOnFailure: boolean;
11
+ webhookMetadata: Record<string, string>;
12
+ scheduleConfiguration: string;
13
+ configuration: ApplicationSentinelConfigurationDto;
14
+ updatedAt?: Date;
15
+ createdAt?: Date;
16
+ application?: IApplication;
17
+ applicationSentinelsHistory?: IApplicationSentinelHistory[];
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,6 @@
1
1
  import { ApplicationWebhookScope } from '../../enum';
2
+ import { IApplicationEvent } from './application-event.model';
3
+ import { IApplicationSentinelHistory } from './application-sentinel-history.model';
2
4
  import { IApplicationWebhook } from './application-webhook.model';
3
5
  export interface IApplicationWebhookHistory {
4
6
  id?: string;
@@ -10,7 +12,11 @@ export interface IApplicationWebhookHistory {
10
12
  scope: ApplicationWebhookScope;
11
13
  sendAt: Date;
12
14
  applicationWebhookId: string;
15
+ applicationSentinelHistoryId: string | null;
16
+ applicationEventId: string | null;
13
17
  updatedAt?: Date;
14
18
  createdAt?: Date;
15
19
  applicationWebhook?: IApplicationWebhook;
20
+ applicationSentinelHistory?: IApplicationSentinelHistory | null;
21
+ applicationEvent?: IApplicationEvent | null;
16
22
  }
@@ -1,3 +1,4 @@
1
+ import { ApplicationSentinelType } from '../../enum/application-sentinel-type.enum';
1
2
  import { ApplicationWebhookScope } from '../../enum/application-webhook-scope.enum';
2
3
  import { IApplicationWebhookHistory } from './application-webhook-history.model';
3
4
  import { IApplication } from './application.model';
@@ -23,4 +24,9 @@ export type ApplicationWebhookFilters = {
23
24
  startsWith?: string[] | null;
24
25
  endsWith?: string[] | null;
25
26
  } | null;
27
+ [ApplicationWebhookScope.SENTINEL]?: {
28
+ type?: ApplicationSentinelType;
29
+ latency?: number;
30
+ retryCount?: number;
31
+ } | null;
26
32
  };
@@ -1,6 +1,7 @@
1
1
  import { IApplicationCronTask } from './application-cron-task.model';
2
2
  import { IApplicationEvent } from './application-event.model';
3
3
  import { IApplicationLog } from './application-log.model';
4
+ import { IApplicationSentinel } from './application-sentinel.model';
4
5
  import { IApplicationStats } from './application-stats.model';
5
6
  import { IApplicationStoreEntry } from './application-store-entry.model';
6
7
  import { IApplicationWebhook } from './application-webhook.model';
@@ -16,4 +17,5 @@ export interface IApplication {
16
17
  applicationStoreEntry?: IApplicationStoreEntry[];
17
18
  applicationEvent?: IApplicationEvent[];
18
19
  applicationWebhook?: IApplicationWebhook[];
20
+ applicationSentinel?: IApplicationSentinel[];
19
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",