@abyss-project/monitor 1.0.7 → 1.0.8

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,6 +1,7 @@
1
- import { ICreateApplicationEventBody, ICreateApplicationEventParams, ICreateApplicationEventResponse, IDeleteApplicationEventParams, IDeleteApplicationEventResponse, IGetApplicationEventParams, IGetApplicationEventResponse, IGetCountPerDayApplicationEventParams, IGetCountPerDayApplicationEventResponse, IGetTotalCountApplicationEventParams, IGetTotalCountApplicationEventResponse, IPaginateApplicationEventParams, IPaginateApplicationEventQuery, IPaginateApplicationEventResponse } from '..';
1
+ import { ICreateApplicationEventBody, ICreateApplicationEventParams, ICreateApplicationEventResponse, IDeleteApplicationEventParams, IDeleteApplicationEventResponse, IGetApplicationEventParams, IGetApplicationEventResponse, IGetCountPerDayApplicationEventParams, IGetCountPerDayApplicationEventResponse, IGetMetricsApplicationEventParams, IGetMetricsApplicationEventResponse, IGetTotalCountApplicationEventParams, IGetTotalCountApplicationEventResponse, IPaginateApplicationEventParams, IPaginateApplicationEventQuery, IPaginateApplicationEventResponse } from '..';
2
2
  export declare const getCountPerDayApplicationEvent: (params: IGetCountPerDayApplicationEventParams) => Promise<IGetCountPerDayApplicationEventResponse>;
3
3
  export declare const getTotalCountApplicationEvent: (params: IGetTotalCountApplicationEventParams) => Promise<IGetTotalCountApplicationEventResponse>;
4
+ export declare const getMetricsApplicationEvent: (params: IGetMetricsApplicationEventParams) => Promise<IGetMetricsApplicationEventResponse>;
4
5
  export declare const getApplicationEvent: (params: IGetApplicationEventParams) => Promise<IGetApplicationEventResponse>;
5
6
  export declare const paginateApplicationEvent: (params: IPaginateApplicationEventParams, query: IPaginateApplicationEventQuery) => Promise<IPaginateApplicationEventResponse>;
6
7
  export declare const createApplicationEvent: (params: ICreateApplicationEventParams, body: ICreateApplicationEventBody) => Promise<ICreateApplicationEventResponse>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteApplicationEvent = exports.createApplicationEvent = exports.paginateApplicationEvent = exports.getApplicationEvent = exports.getTotalCountApplicationEvent = exports.getCountPerDayApplicationEvent = void 0;
3
+ exports.deleteApplicationEvent = exports.createApplicationEvent = exports.paginateApplicationEvent = exports.getApplicationEvent = exports.getMetricsApplicationEvent = exports.getTotalCountApplicationEvent = exports.getCountPerDayApplicationEvent = void 0;
4
4
  const __1 = require("..");
5
5
  const getCountPerDayApplicationEvent = async (params) => {
6
6
  return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/count-per-day`)).data;
@@ -10,6 +10,10 @@ const getTotalCountApplicationEvent = async (params) => {
10
10
  return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/total-count`)).data;
11
11
  };
12
12
  exports.getTotalCountApplicationEvent = getTotalCountApplicationEvent;
13
+ const getMetricsApplicationEvent = async (params) => {
14
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/metrics`)).data;
15
+ };
16
+ exports.getMetricsApplicationEvent = getMetricsApplicationEvent;
13
17
  const getApplicationEvent = async (params) => {
14
18
  return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/${params.applicationEventId}`)).data;
15
19
  };
@@ -35,3 +35,6 @@ export interface IGetTotalCountApplicationEventParams {
35
35
  export interface IGetCountPerDayApplicationEventParams {
36
36
  applicationId: string;
37
37
  }
38
+ export interface IGetMetricsApplicationEventParams {
39
+ applicationId: string;
40
+ }
@@ -19,3 +19,14 @@ export interface IGetTotalCountApplicationEventData {
19
19
  count: Record<string, number>;
20
20
  }
21
21
  export type IGetTotalCountApplicationEventResponse = IResponse<IGetTotalCountApplicationEventData>;
22
+ export interface IGetMetricsApplicationEventData {
23
+ metrics: {
24
+ totalEvent: number;
25
+ firstEventDate: Date | null;
26
+ lastEventDate: Date | null;
27
+ totalErrorEvent: number;
28
+ lastErrorDate: Date | null;
29
+ eventLast24Hours: number;
30
+ };
31
+ }
32
+ export type IGetMetricsApplicationEventResponse = IResponse<IGetMetricsApplicationEventData>;
@@ -4,7 +4,6 @@ import { IApplication } from './application.model';
4
4
  export interface IApplicationEvent {
5
5
  id?: string;
6
6
  applicationId: string;
7
- prefix: string | null;
8
7
  event: string;
9
8
  message: string | null;
10
9
  level: LogLevel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",