@abyss-project/monitor 1.0.30 → 1.0.32

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.
@@ -1,3 +1,4 @@
1
- import { IGetLatencySentinelMetricsParams, IGetLatencySentinelMetricsQuery, IGetLatencySentinelMetricsResponse, IGetSentinelMetricsParams, IGetSentinelMetricsQuery, IGetSentinelMetricsResponse } from '../types';
1
+ import { IGetLastIncidentSentinelMetricsParams, IGetLastIncidentSentinelMetricsQuery, IGetLastIncidentSentinelMetricsResponse, IGetLatencySentinelMetricsParams, IGetLatencySentinelMetricsQuery, IGetLatencySentinelMetricsResponse, IGetSentinelMetricsParams, IGetSentinelMetricsQuery, IGetSentinelMetricsResponse } from '../types';
2
2
  export declare const getSentinelMetrics: (params: IGetSentinelMetricsParams, query: IGetSentinelMetricsQuery) => Promise<IGetSentinelMetricsResponse>;
3
3
  export declare const getLatencySentinelMetrics: (params: IGetLatencySentinelMetricsParams, query: IGetLatencySentinelMetricsQuery) => Promise<IGetLatencySentinelMetricsResponse>;
4
+ export declare const getLastIncidentSentinelMetrics: (params: IGetLastIncidentSentinelMetricsParams, query: IGetLastIncidentSentinelMetricsQuery) => Promise<IGetLastIncidentSentinelMetricsResponse>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLatencySentinelMetrics = exports.getSentinelMetrics = void 0;
3
+ exports.getLastIncidentSentinelMetrics = exports.getLatencySentinelMetrics = exports.getSentinelMetrics = void 0;
4
4
  const __1 = require("..");
5
5
  const getSentinelMetrics = async (params, query) => {
6
6
  return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}`, { params: query })).data;
@@ -10,3 +10,7 @@ const getLatencySentinelMetrics = async (params, query) => {
10
10
  return (await __1.AbyssMonitorCore.axios.get(`metrics/sentinel/${params.projectId}/latency`, { params: query })).data;
11
11
  };
12
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;
@@ -15,8 +15,6 @@ export declare enum Code {
15
15
  invalidData = "invalid_data",
16
16
  notImplemented = "not_implemented",
17
17
  maxCronTaskNumber = "max_cron_task_number",
18
- maxStoreEntryNumber = "max_store_entry_number",
19
- slugAlreadyExist = "slug_already_exist",
20
18
  maxEventPublishPerDay = "max_event_publish_per_day",
21
19
  maxSentinelNumber = "max_sentinel_number"
22
20
  }
@@ -20,8 +20,6 @@ var Code;
20
20
  Code["invalidData"] = "invalid_data";
21
21
  Code["notImplemented"] = "not_implemented";
22
22
  Code["maxCronTaskNumber"] = "max_cron_task_number";
23
- Code["maxStoreEntryNumber"] = "max_store_entry_number";
24
- Code["slugAlreadyExist"] = "slug_already_exist";
25
23
  Code["maxEventPublishPerDay"] = "max_event_publish_per_day";
26
24
  Code["maxSentinelNumber"] = "max_sentinel_number";
27
25
  })(Code || (exports.Code = Code = {}));
@@ -1,7 +1,6 @@
1
- import * as core from 'express-serve-static-core';
2
1
  import { ApplicationWebhookScope } from '../../../enum';
3
2
  import { QueryPaginate } from '..';
4
- export interface IGetApplicationWebhookHistoryAdminParams extends core.ParamsDictionary {
3
+ export interface IGetApplicationWebhookHistoryAdminParams {
5
4
  applicationWebhookHistoryId: string;
6
5
  }
7
6
  export type IPaginateApplicationWebhookHistoryAdminQuery = {
@@ -1,11 +1,10 @@
1
- import * as core from 'express-serve-static-core';
2
1
  import { QueryPaginate } from '..';
3
2
  import { ApplicationWebhookScope } from '../../../enum';
4
- export interface IGetApplicationWebhookHistoryParams extends core.ParamsDictionary {
3
+ export interface IGetApplicationWebhookHistoryParams {
5
4
  applicationId: string;
6
5
  applicationWebhookHistoryId: string;
7
6
  }
8
- export interface IPaginateApplicationWebhookHistoryParams extends core.ParamsDictionary {
7
+ export interface IPaginateApplicationWebhookHistoryParams {
9
8
  applicationId: string;
10
9
  }
11
10
  export type IPaginateApplicationWebhookHistoryQuery = {
@@ -1,14 +1,13 @@
1
- import * as core from 'express-serve-static-core';
2
1
  import { QueryPaginate } from '..';
3
2
  import { ApplicationWebhookScope } from '../../../enum';
4
3
  import { ApplicationWebhookFilters } from '../../models/application-webhook.model';
5
- export interface IGetApplicationWebhookAdminParams extends core.ParamsDictionary {
4
+ export interface IGetApplicationWebhookAdminParams {
6
5
  applicationWebhookId: string;
7
6
  }
8
- export interface IDeleteApplicationWebhookAdminParams extends core.ParamsDictionary {
7
+ export interface IDeleteApplicationWebhookAdminParams {
9
8
  applicationWebhookId: string;
10
9
  }
11
- export interface IUpdateApplicationWebhookAdminParams extends core.ParamsDictionary {
10
+ export interface IUpdateApplicationWebhookAdminParams {
12
11
  applicationWebhookId: string;
13
12
  }
14
13
  export interface IUpdateApplicationWebhookAdminBody {
@@ -19,7 +18,7 @@ export interface IUpdateApplicationWebhookAdminBody {
19
18
  scopes?: ApplicationWebhookScope[];
20
19
  filters?: ApplicationWebhookFilters | null;
21
20
  }
22
- export interface ICreateApplicationWebhookAdminParams extends core.ParamsDictionary {
21
+ export interface ICreateApplicationWebhookAdminParams {
23
22
  applicationId: string;
24
23
  }
25
24
  export interface ICreateApplicationWebhookAdminBody {
@@ -30,7 +29,7 @@ export interface ICreateApplicationWebhookAdminBody {
30
29
  scopes: ApplicationWebhookScope[];
31
30
  filters: ApplicationWebhookFilters | null;
32
31
  }
33
- export interface IResetSecretApplicationWebhookAdminParams extends core.ParamsDictionary {
32
+ export interface IResetSecretApplicationWebhookAdminParams {
34
33
  applicationWebhookId: string;
35
34
  }
36
35
  export type IPaginateApplicationWebhookAdminQuery = {
@@ -1,16 +1,15 @@
1
- import * as core from 'express-serve-static-core';
2
1
  import { QueryPaginate } from '..';
3
2
  import { ApplicationWebhookScope } from '../../../enum';
4
3
  import { ApplicationWebhookFilters } from '../../models/application-webhook.model';
5
- export interface IGetApplicationWebhookParams extends core.ParamsDictionary {
4
+ export interface IGetApplicationWebhookParams {
6
5
  applicationId: string;
7
6
  applicationWebhookId: string;
8
7
  }
9
- export interface IDeleteApplicationWebhookParams extends core.ParamsDictionary {
8
+ export interface IDeleteApplicationWebhookParams {
10
9
  applicationId: string;
11
10
  applicationWebhookId: string;
12
11
  }
13
- export interface IUpdateApplicationWebhookParams extends core.ParamsDictionary {
12
+ export interface IUpdateApplicationWebhookParams {
14
13
  applicationId: string;
15
14
  applicationWebhookId: string;
16
15
  }
@@ -22,7 +21,7 @@ export interface IUpdateApplicationWebhookBody {
22
21
  scopes?: ApplicationWebhookScope[];
23
22
  filters?: ApplicationWebhookFilters | null;
24
23
  }
25
- export interface ICreateApplicationWebhookParams extends core.ParamsDictionary {
24
+ export interface ICreateApplicationWebhookParams {
26
25
  applicationId: string;
27
26
  }
28
27
  export interface ICreateApplicationWebhookBody {
@@ -33,11 +32,11 @@ export interface ICreateApplicationWebhookBody {
33
32
  scopes: ApplicationWebhookScope[];
34
33
  filters: ApplicationWebhookFilters | null;
35
34
  }
36
- export interface IResetSecretApplicationWebhookParams extends core.ParamsDictionary {
35
+ export interface IResetSecretApplicationWebhookParams {
37
36
  applicationId: string;
38
37
  applicationWebhookId: string;
39
38
  }
40
- export interface IPaginateApplicationWebhookParams extends core.ParamsDictionary {
39
+ export interface IPaginateApplicationWebhookParams {
41
40
  applicationId: string;
42
41
  }
43
42
  export type IPaginateApplicationWebhookQuery = {
@@ -13,3 +13,11 @@ export interface IGetLatencySentinelMetricsQuery {
13
13
  startDate?: Date;
14
14
  endDate?: Date;
15
15
  }
16
+ export interface IGetLastIncidentSentinelMetricsParams {
17
+ projectId: string;
18
+ }
19
+ export interface IGetLastIncidentSentinelMetricsQuery {
20
+ applicationIds?: string[];
21
+ startDate?: Date;
22
+ endDate?: Date;
23
+ }
@@ -1,4 +1,4 @@
1
- import { IResponse, IApplicationSentinel } from '../..';
1
+ import { IResponse, IApplicationSentinel, IApplicationSentinelHistory } from '../..';
2
2
  export interface IGetSentinelMetricsData {
3
3
  metrics: {
4
4
  applicationSentinel: IApplicationSentinel[];
@@ -19,3 +19,11 @@ export interface IGetLatencySentinelMetricsData {
19
19
  }>;
20
20
  }
21
21
  export type IGetLatencySentinelMetricsResponse = IResponse<IGetLatencySentinelMetricsData>;
22
+ export interface IGetLastIncidentSentinelMetricsData {
23
+ metrics: {
24
+ incident: IApplicationSentinelHistory;
25
+ sentinel: IApplicationSentinel;
26
+ durationMs: number | null;
27
+ }[];
28
+ }
29
+ export type IGetLastIncidentSentinelMetricsResponse = IResponse<IGetLastIncidentSentinelMetricsData>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",