@abyss-project/monitor 1.0.4 → 1.0.5

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.
@@ -0,0 +1,4 @@
1
+ import { IDeleteApplicationEventAdminParams, IDeleteApplicationEventAdminResponse, IGetApplicationEventAdminParams, IGetApplicationEventAdminResponse, IPaginateApplicationEventAdminQuery, IPaginateApplicationEventAdminResponse } from '..';
2
+ export declare const getApplicationEventAdmin: (params: IGetApplicationEventAdminParams) => Promise<IGetApplicationEventAdminResponse>;
3
+ export declare const paginateApplicationEventAdmin: (query: IPaginateApplicationEventAdminQuery) => Promise<IPaginateApplicationEventAdminResponse>;
4
+ export declare const deleteApplicationEventAdmin: (params: IDeleteApplicationEventAdminParams) => Promise<IDeleteApplicationEventAdminResponse>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteApplicationEventAdmin = exports.paginateApplicationEventAdmin = exports.getApplicationEventAdmin = void 0;
4
+ const __1 = require("..");
5
+ const getApplicationEventAdmin = async (params) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/admin/${params.applicationEventId}`)).data;
7
+ };
8
+ exports.getApplicationEventAdmin = getApplicationEventAdmin;
9
+ const paginateApplicationEventAdmin = async (query) => {
10
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/admin/paginate`, { params: query })).data;
11
+ };
12
+ exports.paginateApplicationEventAdmin = paginateApplicationEventAdmin;
13
+ const deleteApplicationEventAdmin = async (params) => {
14
+ return (await __1.AbyssMonitorCore.axios.delete(`application-event/admin/${params.applicationEventId}`)).data;
15
+ };
16
+ exports.deleteApplicationEventAdmin = deleteApplicationEventAdmin;
@@ -0,0 +1,7 @@
1
+ import { ICreateApplicationEventBody, ICreateApplicationEventParams, ICreateApplicationEventResponse, IDeleteApplicationEventParams, IDeleteApplicationEventResponse, IGetApplicationEventParams, IGetApplicationEventResponse, IGetCountPerDayApplicationEventParams, IGetCountPerDayApplicationEventResponse, IGetTotalCountApplicationEventParams, IGetTotalCountApplicationEventResponse, IPaginateApplicationEventParams, IPaginateApplicationEventQuery, IPaginateApplicationEventResponse } from '..';
2
+ export declare const getCountPerDayApplicationEvent: (params: IGetCountPerDayApplicationEventParams) => Promise<IGetCountPerDayApplicationEventResponse>;
3
+ export declare const getTotalCountApplicationEvent: (params: IGetTotalCountApplicationEventParams) => Promise<IGetTotalCountApplicationEventResponse>;
4
+ export declare const getApplicationEvent: (params: IGetApplicationEventParams) => Promise<IGetApplicationEventResponse>;
5
+ export declare const paginateApplicationEvent: (params: IPaginateApplicationEventParams, query: IPaginateApplicationEventQuery) => Promise<IPaginateApplicationEventResponse>;
6
+ export declare const createApplicationEvent: (params: ICreateApplicationEventParams, body: ICreateApplicationEventBody) => Promise<ICreateApplicationEventResponse>;
7
+ export declare const deleteApplicationEvent: (params: IDeleteApplicationEventParams) => Promise<IDeleteApplicationEventResponse>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteApplicationEvent = exports.createApplicationEvent = exports.paginateApplicationEvent = exports.getApplicationEvent = exports.getTotalCountApplicationEvent = exports.getCountPerDayApplicationEvent = void 0;
4
+ const __1 = require("..");
5
+ const getCountPerDayApplicationEvent = async (params) => {
6
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/count-per-day`)).data;
7
+ };
8
+ exports.getCountPerDayApplicationEvent = getCountPerDayApplicationEvent;
9
+ const getTotalCountApplicationEvent = async (params) => {
10
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/total-count`)).data;
11
+ };
12
+ exports.getTotalCountApplicationEvent = getTotalCountApplicationEvent;
13
+ const getApplicationEvent = async (params) => {
14
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/${params.applicationEventId}`)).data;
15
+ };
16
+ exports.getApplicationEvent = getApplicationEvent;
17
+ const paginateApplicationEvent = async (params, query) => {
18
+ return (await __1.AbyssMonitorCore.axios.get(`application-event/${params.applicationId}/paginate`, { params: query })).data;
19
+ };
20
+ exports.paginateApplicationEvent = paginateApplicationEvent;
21
+ const createApplicationEvent = async (params, body) => {
22
+ return (await __1.AbyssMonitorCore.axios.post(`application-event/${params.applicationId}`, body)).data;
23
+ };
24
+ exports.createApplicationEvent = createApplicationEvent;
25
+ const deleteApplicationEvent = async (params) => {
26
+ return (await __1.AbyssMonitorCore.axios.delete(`application-event/${params.applicationId}/${params.applicationEventId}`)).data;
27
+ };
28
+ exports.deleteApplicationEvent = deleteApplicationEvent;
@@ -10,3 +10,5 @@ export * from './application-store.admin.api';
10
10
  export * from './application-store.public.api';
11
11
  export * from './application-store.api';
12
12
  export * from './monitor.api';
13
+ export * from './application-event.admin.api';
14
+ export * from './application-event.api';
package/dist/api/index.js CHANGED
@@ -26,3 +26,5 @@ __exportStar(require("./application-store.admin.api"), exports);
26
26
  __exportStar(require("./application-store.public.api"), exports);
27
27
  __exportStar(require("./application-store.api"), exports);
28
28
  __exportStar(require("./monitor.api"), exports);
29
+ __exportStar(require("./application-event.admin.api"), exports);
30
+ __exportStar(require("./application-event.api"), exports);
@@ -16,5 +16,6 @@ export declare enum Code {
16
16
  notImplemented = "not_implemented",
17
17
  maxCronTaskNumber = "max_cron_task_number",
18
18
  maxStoreEntryNumber = "max_store_entry_number",
19
- slugAlreadyExist = "slug_already_exist"
19
+ slugAlreadyExist = "slug_already_exist",
20
+ maxEventPublishPerDay = "max_event_publish_per_day"
20
21
  }
@@ -22,4 +22,5 @@ var Code;
22
22
  Code["maxCronTaskNumber"] = "max_cron_task_number";
23
23
  Code["maxStoreEntryNumber"] = "max_store_entry_number";
24
24
  Code["slugAlreadyExist"] = "slug_already_exist";
25
+ Code["maxEventPublishPerDay"] = "max_event_publish_per_day";
25
26
  })(Code || (exports.Code = Code = {}));
@@ -13,6 +13,8 @@ export * from './requests/application-log.request';
13
13
  export * from './requests/application-store.admin.request';
14
14
  export * from './requests/application-store.public.request';
15
15
  export * from './requests/application-store.request';
16
+ export * from './requests/application-event.request';
17
+ export * from './requests/application-event.admin.request';
16
18
  export * from './responses/application.response';
17
19
  export * from './responses/application.admin.response';
18
20
  export * from './responses/application-stats.admin.response';
@@ -25,3 +27,5 @@ export * from './responses/monitor.response';
25
27
  export * from './responses/application-store.admin.response';
26
28
  export * from './responses/application-store.public.response';
27
29
  export * from './responses/application-store.response';
30
+ export * from './responses/application-event.response';
31
+ export * from './responses/application-event.admin.response';
@@ -29,6 +29,8 @@ __exportStar(require("./requests/application-log.request"), exports);
29
29
  __exportStar(require("./requests/application-store.admin.request"), exports);
30
30
  __exportStar(require("./requests/application-store.public.request"), exports);
31
31
  __exportStar(require("./requests/application-store.request"), exports);
32
+ __exportStar(require("./requests/application-event.request"), exports);
33
+ __exportStar(require("./requests/application-event.admin.request"), exports);
32
34
  __exportStar(require("./responses/application.response"), exports);
33
35
  __exportStar(require("./responses/application.admin.response"), exports);
34
36
  __exportStar(require("./responses/application-stats.admin.response"), exports);
@@ -41,3 +43,5 @@ __exportStar(require("./responses/monitor.response"), exports);
41
43
  __exportStar(require("./responses/application-store.admin.response"), exports);
42
44
  __exportStar(require("./responses/application-store.public.response"), exports);
43
45
  __exportStar(require("./responses/application-store.response"), exports);
46
+ __exportStar(require("./responses/application-event.response"), exports);
47
+ __exportStar(require("./responses/application-event.admin.response"), exports);
@@ -0,0 +1,17 @@
1
+ import { QueryPaginate } from '..';
2
+ import { LogLevel } from '../../../enum';
3
+ export interface IGetApplicationEventAdminParams {
4
+ applicationEventId: string;
5
+ }
6
+ export type IPaginateApplicationEventAdminQuery = {
7
+ prefix?: (string | null)[];
8
+ prefixContains?: string;
9
+ event?: string[];
10
+ eventContains?: string;
11
+ level?: LogLevel[];
12
+ messageContains?: string;
13
+ applicationId?: string[];
14
+ } & QueryPaginate;
15
+ export interface IDeleteApplicationEventAdminParams {
16
+ applicationEventId: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,37 @@
1
+ import { QueryPaginate } from '..';
2
+ import { LogLevel } from '../../../enum';
3
+ export interface IGetApplicationEventParams {
4
+ applicationId: string;
5
+ applicationEventId: string;
6
+ }
7
+ export interface ICreateApplicationEventParams {
8
+ applicationId: string;
9
+ }
10
+ export interface ICreateApplicationEventBody {
11
+ prefix: string | null;
12
+ event: string;
13
+ message: string | null;
14
+ level: LogLevel;
15
+ data: Record<string, unknown> | null;
16
+ }
17
+ export interface IPaginateApplicationEventParams {
18
+ applicationId: string;
19
+ }
20
+ export type IPaginateApplicationEventQuery = {
21
+ prefix?: (string | null)[];
22
+ prefixContains?: string;
23
+ event?: string[];
24
+ eventContains?: string;
25
+ level?: LogLevel[];
26
+ messageContains?: string;
27
+ } & QueryPaginate;
28
+ export interface IDeleteApplicationEventParams {
29
+ applicationId: string;
30
+ applicationEventId: string;
31
+ }
32
+ export interface IGetTotalCountApplicationEventParams {
33
+ applicationId: string;
34
+ }
35
+ export interface IGetCountPerDayApplicationEventParams {
36
+ applicationId: string;
37
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -50,4 +50,11 @@ export interface ICreateApplicationLogBody {
50
50
  requestBody?: Record<string, unknown> | string | null;
51
51
  responseBody?: Record<string, unknown> | string | null;
52
52
  };
53
+ applicationEvent?: {
54
+ prefix: string | null;
55
+ event: string;
56
+ message: string | null;
57
+ level: LogLevel;
58
+ data: Record<string, unknown> | null;
59
+ };
53
60
  }
@@ -0,0 +1,9 @@
1
+ import { IResponse, IApplicationEvent, BasePaginate } from '../..';
2
+ export interface IGetApplicationEventAdminData {
3
+ applicationEvent: IApplicationEvent;
4
+ }
5
+ export type IGetApplicationEventAdminResponse = IResponse<IGetApplicationEventAdminData>;
6
+ export type IPaginateApplicationEventAdminResponse = IResponse<BasePaginate<IApplicationEvent>>;
7
+ export interface IDeleteApplicationEventAdminData {
8
+ }
9
+ export type IDeleteApplicationEventAdminResponse = IResponse<IDeleteApplicationEventAdminData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import { IResponse, IApplicationEvent, BasePaginate } from '../..';
2
+ export interface IGetApplicationEventData {
3
+ applicationEvent: IApplicationEvent;
4
+ }
5
+ export type IGetApplicationEventResponse = IResponse<IGetApplicationEventData>;
6
+ export type IPaginateApplicationEventResponse = IResponse<BasePaginate<IApplicationEvent>>;
7
+ export interface ICreateApplicationEventData {
8
+ applicationEvent: IApplicationEvent;
9
+ }
10
+ export type ICreateApplicationEventResponse = IResponse<ICreateApplicationEventData>;
11
+ export interface IDeleteApplicationEventData {
12
+ }
13
+ export type IDeleteApplicationEventResponse = IResponse<IDeleteApplicationEventData>;
14
+ export interface IGetCountPerDayApplicationEventData {
15
+ countPerDay: Record<string, Record<string, number>>;
16
+ }
17
+ export type IGetCountPerDayApplicationEventResponse = IResponse<IGetCountPerDayApplicationEventData>;
18
+ export interface IGetTotalCountApplicationEventData {
19
+ count: Record<string, number>;
20
+ }
21
+ export type IGetTotalCountApplicationEventResponse = IResponse<IGetTotalCountApplicationEventData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,7 +8,7 @@ export interface IApplicationEvent {
8
8
  event: string;
9
9
  message: string | null;
10
10
  level: LogLevel;
11
- data: unknown;
11
+ data: Record<string, unknown> | null;
12
12
  applicationLogId?: string | null;
13
13
  updatedAt?: Date;
14
14
  createdAt?: Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",