@abyss-project/monitor 1.0.9 → 1.0.11
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/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/models/logger.model.d.ts +0 -1
- package/dist/types/enum/application-webhook-scope.enum.d.ts +3 -0
- package/dist/types/enum/application-webhook-scope.enum.js +7 -0
- package/dist/types/enum/index.d.ts +1 -1
- package/dist/types/enum/index.js +1 -1
- package/dist/types/interface/api/index.d.ts +8 -0
- package/dist/types/interface/api/index.js +8 -0
- package/dist/types/interface/api/requests/application-event.admin.request.d.ts +1 -2
- package/dist/types/interface/api/requests/application-event.request.d.ts +1 -3
- package/dist/types/interface/api/requests/application-log.request.d.ts +0 -1
- package/dist/types/interface/api/requests/application-webhook-history.admin.request.d.ts +14 -0
- package/dist/types/interface/api/requests/application-webhook-history.admin.request.js +2 -0
- package/dist/types/interface/api/requests/application-webhook-history.request.d.ts +17 -0
- package/dist/types/interface/api/requests/application-webhook-history.request.js +2 -0
- package/dist/types/interface/api/requests/application-webhook.admin.request.d.ts +40 -0
- package/dist/types/interface/api/requests/application-webhook.admin.request.js +2 -0
- package/dist/types/interface/api/requests/application-webhook.request.d.ts +46 -0
- package/dist/types/interface/api/requests/application-webhook.request.js +2 -0
- package/dist/types/interface/api/responses/application-webhook-history.admin.response.d.ts +7 -0
- package/dist/types/interface/api/responses/application-webhook-history.admin.response.js +2 -0
- package/dist/types/interface/api/responses/application-webhook-history.response.d.ts +7 -0
- package/dist/types/interface/api/responses/application-webhook-history.response.js +2 -0
- package/dist/types/interface/api/responses/application-webhook.admin.response.d.ts +21 -0
- package/dist/types/interface/api/responses/application-webhook.admin.response.js +2 -0
- package/dist/types/interface/api/responses/application-webhook.response.d.ts +21 -0
- package/dist/types/interface/api/responses/application-webhook.response.js +2 -0
- package/dist/types/interface/dto/index.d.ts +1 -0
- package/dist/types/interface/dto/index.js +17 -0
- package/dist/types/interface/dto/webhook.dto.d.ts +18 -0
- package/dist/types/interface/dto/webhook.dto.js +2 -0
- package/dist/types/interface/index.d.ts +3 -0
- package/dist/types/interface/index.js +3 -0
- package/dist/types/interface/models/application-webhook-history.model.d.ts +16 -0
- package/dist/types/interface/models/application-webhook-history.model.js +2 -0
- package/dist/types/interface/models/application-webhook.model.d.ts +25 -0
- package/dist/types/interface/models/application-webhook.model.js +3 -0
- package/dist/types/interface/models/application.model.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare const API_KEY_APPLICATION_HEADER = "abyss-monitor-api-key-applica
|
|
|
13
13
|
export declare const ADMIN_TOKEN_HEADER = "abyss-admin-token";
|
|
14
14
|
export declare const HEADER_CRON_TASK_SIGNATURE_NAME = "abyss-monitor-cron-task-signature";
|
|
15
15
|
export declare const CRON_TASK_SIGNATURE_ALGORITHM = "sha256";
|
|
16
|
+
export declare const HEADER_WEBHOOK_SIGNATURE_NAME = "abyss-monitor-webhook-signature";
|
|
17
|
+
export declare const WEBHOOK_SIGNATURE_ALGORITHM = "sha256";
|
|
16
18
|
export declare const NUMBER_RETRY_API = 10;
|
|
17
19
|
export declare const BASE_DELAY_BETWEEN_RETRY = 5000;
|
|
18
20
|
export declare const RETRY_CODES: number[];
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
var _a;
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.AbyssMonitorCore = exports.RETRY_CODES = exports.BASE_DELAY_BETWEEN_RETRY = exports.NUMBER_RETRY_API = exports.CRON_TASK_SIGNATURE_ALGORITHM = exports.HEADER_CRON_TASK_SIGNATURE_NAME = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_APPLICATION_HEADER = void 0;
|
|
33
|
+
exports.AbyssMonitorCore = exports.RETRY_CODES = exports.BASE_DELAY_BETWEEN_RETRY = exports.NUMBER_RETRY_API = exports.WEBHOOK_SIGNATURE_ALGORITHM = exports.HEADER_WEBHOOK_SIGNATURE_NAME = exports.CRON_TASK_SIGNATURE_ALGORITHM = exports.HEADER_CRON_TASK_SIGNATURE_NAME = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_APPLICATION_HEADER = void 0;
|
|
34
34
|
require("reflect-metadata");
|
|
35
35
|
const axios_1 = __importDefault(require("axios"));
|
|
36
36
|
const axios_retry_1 = __importStar(require("axios-retry"));
|
|
@@ -47,6 +47,8 @@ exports.API_KEY_APPLICATION_HEADER = 'abyss-monitor-api-key-application';
|
|
|
47
47
|
exports.ADMIN_TOKEN_HEADER = 'abyss-admin-token';
|
|
48
48
|
exports.HEADER_CRON_TASK_SIGNATURE_NAME = 'abyss-monitor-cron-task-signature';
|
|
49
49
|
exports.CRON_TASK_SIGNATURE_ALGORITHM = 'sha256';
|
|
50
|
+
exports.HEADER_WEBHOOK_SIGNATURE_NAME = 'abyss-monitor-webhook-signature';
|
|
51
|
+
exports.WEBHOOK_SIGNATURE_ALGORITHM = 'sha256';
|
|
50
52
|
exports.NUMBER_RETRY_API = 10;
|
|
51
53
|
exports.BASE_DELAY_BETWEEN_RETRY = 5000;
|
|
52
54
|
exports.RETRY_CODES = [
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApplicationWebhookScope = void 0;
|
|
4
|
+
var ApplicationWebhookScope;
|
|
5
|
+
(function (ApplicationWebhookScope) {
|
|
6
|
+
ApplicationWebhookScope["EVENT"] = "EVENT";
|
|
7
|
+
})(ApplicationWebhookScope || (exports.ApplicationWebhookScope = ApplicationWebhookScope = {}));
|
package/dist/types/enum/index.js
CHANGED
|
@@ -20,4 +20,4 @@ __exportStar(require("./application-stats-type.enum"), exports);
|
|
|
20
20
|
__exportStar(require("./application-alert-type.enum"), exports);
|
|
21
21
|
__exportStar(require("./log-level.enum"), exports);
|
|
22
22
|
__exportStar(require("./log-scenario.enum"), exports);
|
|
23
|
-
__exportStar(require("./webhook-
|
|
23
|
+
__exportStar(require("./application-webhook-scope.enum"), exports);
|
|
@@ -15,6 +15,10 @@ export * from './requests/application-store.public.request';
|
|
|
15
15
|
export * from './requests/application-store.request';
|
|
16
16
|
export * from './requests/application-event.request';
|
|
17
17
|
export * from './requests/application-event.admin.request';
|
|
18
|
+
export * from './requests/application-webhook.request';
|
|
19
|
+
export * from './requests/application-webhook.admin.request';
|
|
20
|
+
export * from './requests/application-webhook-history.admin.request';
|
|
21
|
+
export * from './requests/application-webhook-history.request';
|
|
18
22
|
export * from './responses/application.response';
|
|
19
23
|
export * from './responses/application.admin.response';
|
|
20
24
|
export * from './responses/application-stats.admin.response';
|
|
@@ -29,3 +33,7 @@ export * from './responses/application-store.public.response';
|
|
|
29
33
|
export * from './responses/application-store.response';
|
|
30
34
|
export * from './responses/application-event.response';
|
|
31
35
|
export * from './responses/application-event.admin.response';
|
|
36
|
+
export * from './responses/application-webhook.response';
|
|
37
|
+
export * from './responses/application-webhook.admin.response';
|
|
38
|
+
export * from './responses/application-webhook-history.admin.response';
|
|
39
|
+
export * from './responses/application-webhook-history.response';
|
|
@@ -31,6 +31,10 @@ __exportStar(require("./requests/application-store.public.request"), exports);
|
|
|
31
31
|
__exportStar(require("./requests/application-store.request"), exports);
|
|
32
32
|
__exportStar(require("./requests/application-event.request"), exports);
|
|
33
33
|
__exportStar(require("./requests/application-event.admin.request"), exports);
|
|
34
|
+
__exportStar(require("./requests/application-webhook.request"), exports);
|
|
35
|
+
__exportStar(require("./requests/application-webhook.admin.request"), exports);
|
|
36
|
+
__exportStar(require("./requests/application-webhook-history.admin.request"), exports);
|
|
37
|
+
__exportStar(require("./requests/application-webhook-history.request"), exports);
|
|
34
38
|
__exportStar(require("./responses/application.response"), exports);
|
|
35
39
|
__exportStar(require("./responses/application.admin.response"), exports);
|
|
36
40
|
__exportStar(require("./responses/application-stats.admin.response"), exports);
|
|
@@ -45,3 +49,7 @@ __exportStar(require("./responses/application-store.public.response"), exports);
|
|
|
45
49
|
__exportStar(require("./responses/application-store.response"), exports);
|
|
46
50
|
__exportStar(require("./responses/application-event.response"), exports);
|
|
47
51
|
__exportStar(require("./responses/application-event.admin.response"), exports);
|
|
52
|
+
__exportStar(require("./responses/application-webhook.response"), exports);
|
|
53
|
+
__exportStar(require("./responses/application-webhook.admin.response"), exports);
|
|
54
|
+
__exportStar(require("./responses/application-webhook-history.admin.response"), exports);
|
|
55
|
+
__exportStar(require("./responses/application-webhook-history.response"), exports);
|
|
@@ -4,10 +4,9 @@ export interface IGetApplicationEventAdminParams {
|
|
|
4
4
|
applicationEventId: string;
|
|
5
5
|
}
|
|
6
6
|
export type IPaginateApplicationEventAdminQuery = {
|
|
7
|
-
prefix?: (string | null)[];
|
|
8
|
-
prefixContains?: string;
|
|
9
7
|
event?: string[];
|
|
10
8
|
eventContains?: string;
|
|
9
|
+
eventStartsWith?: string;
|
|
11
10
|
level?: LogLevel[];
|
|
12
11
|
messageContains?: string;
|
|
13
12
|
applicationId?: string[];
|
|
@@ -10,7 +10,6 @@ export interface ICreateApplicationEventParams {
|
|
|
10
10
|
export interface ICreateApplicationEventBody {
|
|
11
11
|
event: string;
|
|
12
12
|
level: LogLevel;
|
|
13
|
-
prefix?: string | null;
|
|
14
13
|
data?: Record<string, unknown> | null;
|
|
15
14
|
message?: string | null;
|
|
16
15
|
}
|
|
@@ -18,10 +17,9 @@ export interface IPaginateApplicationEventParams {
|
|
|
18
17
|
applicationId: string;
|
|
19
18
|
}
|
|
20
19
|
export type IPaginateApplicationEventQuery = {
|
|
21
|
-
prefix?: (string | null)[];
|
|
22
|
-
prefixContains?: string;
|
|
23
20
|
event?: string[];
|
|
24
21
|
eventContains?: string;
|
|
22
|
+
eventStartsWith?: string;
|
|
25
23
|
level?: LogLevel[];
|
|
26
24
|
messageContains?: string;
|
|
27
25
|
} & QueryPaginate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as core from 'express-serve-static-core';
|
|
2
|
+
import { ApplicationWebhookScope } from '../../../enum';
|
|
3
|
+
import { QueryPaginate } from '..';
|
|
4
|
+
export interface IGetApplicationWebhookHistoryAdminParams extends core.ParamsDictionary {
|
|
5
|
+
applicationWebhookHistoryId: string;
|
|
6
|
+
}
|
|
7
|
+
export type IPaginateApplicationWebhookHistoryAdminQuery = {
|
|
8
|
+
responseCode?: number[];
|
|
9
|
+
applicationWebhookId?: string[];
|
|
10
|
+
applicationId?: string[];
|
|
11
|
+
webhookId?: string;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
scope?: ApplicationWebhookScope[];
|
|
14
|
+
} & QueryPaginate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as core from 'express-serve-static-core';
|
|
2
|
+
import { QueryPaginate } from '..';
|
|
3
|
+
import { ApplicationWebhookScope } from '../../../enum';
|
|
4
|
+
export interface IGetApplicationWebhookHistoryParams extends core.ParamsDictionary {
|
|
5
|
+
applicationId: string;
|
|
6
|
+
applicationWebhookHistoryId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface IPaginateApplicationWebhookHistoryParams extends core.ParamsDictionary {
|
|
9
|
+
applicationId: string;
|
|
10
|
+
}
|
|
11
|
+
export type IPaginateApplicationWebhookHistoryQuery = {
|
|
12
|
+
responseCode?: number[];
|
|
13
|
+
applicationWebhookId?: string[];
|
|
14
|
+
webhookId?: string;
|
|
15
|
+
groupId?: string;
|
|
16
|
+
scope?: ApplicationWebhookScope[];
|
|
17
|
+
} & QueryPaginate;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as core from 'express-serve-static-core';
|
|
2
|
+
import { QueryPaginate } from '..';
|
|
3
|
+
import { ApplicationWebhookScope } from '../../../enum';
|
|
4
|
+
import { ApplicationWebhookFilters } from '../../models/application-webhook.model';
|
|
5
|
+
export interface IGetApplicationWebhookAdminParams extends core.ParamsDictionary {
|
|
6
|
+
applicationWebhookId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface IDeleteApplicationWebhookAdminParams extends core.ParamsDictionary {
|
|
9
|
+
applicationWebhookId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IUpdateApplicationWebhookAdminParams extends core.ParamsDictionary {
|
|
12
|
+
applicationWebhookId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IUpdateApplicationWebhookAdminBody {
|
|
15
|
+
webhookUrl?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
isEnabled?: boolean;
|
|
18
|
+
description?: string;
|
|
19
|
+
scopes?: ApplicationWebhookScope[];
|
|
20
|
+
filters?: ApplicationWebhookFilters | null;
|
|
21
|
+
}
|
|
22
|
+
export interface ICreateApplicationWebhookAdminParams extends core.ParamsDictionary {
|
|
23
|
+
applicationId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ICreateApplicationWebhookAdminBody {
|
|
26
|
+
webhookUrl: string;
|
|
27
|
+
name: string;
|
|
28
|
+
isEnabled: boolean;
|
|
29
|
+
description?: string;
|
|
30
|
+
scopes: ApplicationWebhookScope[];
|
|
31
|
+
filters: ApplicationWebhookFilters | null;
|
|
32
|
+
}
|
|
33
|
+
export interface IResetSecretApplicationWebhookAdminParams extends core.ParamsDictionary {
|
|
34
|
+
applicationWebhookId: string;
|
|
35
|
+
}
|
|
36
|
+
export type IPaginateApplicationWebhookAdminQuery = {
|
|
37
|
+
applicationId?: string[];
|
|
38
|
+
name?: string;
|
|
39
|
+
scopes?: ApplicationWebhookScope[];
|
|
40
|
+
} & QueryPaginate;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as core from 'express-serve-static-core';
|
|
2
|
+
import { QueryPaginate } from '..';
|
|
3
|
+
import { ApplicationWebhookScope } from '../../../enum';
|
|
4
|
+
import { ApplicationWebhookFilters } from '../../models/application-webhook.model';
|
|
5
|
+
export interface IGetApplicationWebhookParams extends core.ParamsDictionary {
|
|
6
|
+
applicationId: string;
|
|
7
|
+
applicationWebhookId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IDeleteApplicationWebhookParams extends core.ParamsDictionary {
|
|
10
|
+
applicationId: string;
|
|
11
|
+
applicationWebhookId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IUpdateApplicationWebhookParams extends core.ParamsDictionary {
|
|
14
|
+
applicationId: string;
|
|
15
|
+
applicationWebhookId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IUpdateApplicationWebhookBody {
|
|
18
|
+
webhookUrl?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
isEnabled?: boolean;
|
|
21
|
+
description?: string;
|
|
22
|
+
scopes?: ApplicationWebhookScope[];
|
|
23
|
+
filters?: ApplicationWebhookFilters | null;
|
|
24
|
+
}
|
|
25
|
+
export interface ICreateApplicationWebhookParams extends core.ParamsDictionary {
|
|
26
|
+
applicationId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ICreateApplicationWebhookBody {
|
|
29
|
+
webhookUrl: string;
|
|
30
|
+
name: string;
|
|
31
|
+
isEnabled: boolean;
|
|
32
|
+
description?: string;
|
|
33
|
+
scopes: ApplicationWebhookScope[];
|
|
34
|
+
filters: ApplicationWebhookFilters | null;
|
|
35
|
+
}
|
|
36
|
+
export interface IResetSecretApplicationWebhookParams extends core.ParamsDictionary {
|
|
37
|
+
applicationId: string;
|
|
38
|
+
applicationWebhookId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IPaginateApplicationWebhookParams extends core.ParamsDictionary {
|
|
41
|
+
applicationId: string;
|
|
42
|
+
}
|
|
43
|
+
export type IPaginateApplicationWebhookQuery = {
|
|
44
|
+
name?: string;
|
|
45
|
+
scopes?: ApplicationWebhookScope[];
|
|
46
|
+
} & QueryPaginate;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BasePaginate, IResponse } from '..';
|
|
2
|
+
import { IApplicationWebhookHistory } from '../../models/application-webhook-history.model';
|
|
3
|
+
export type IPaginateApplicationWebhookHistoryAdminResponse = IResponse<BasePaginate<IApplicationWebhookHistory>>;
|
|
4
|
+
export interface IGetApplicationWebhookHistoryAdminData {
|
|
5
|
+
applicationWebhookHistory: IApplicationWebhookHistory;
|
|
6
|
+
}
|
|
7
|
+
export type IGetApplicationWebhookHistoryAdminResponse = IResponse<IGetApplicationWebhookHistoryAdminData>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BasePaginate, IResponse } from '..';
|
|
2
|
+
import { IApplicationWebhookHistory } from '../../models/application-webhook-history.model';
|
|
3
|
+
export type IPaginateApplicationWebhookHistoryResponse = IResponse<BasePaginate<IApplicationWebhookHistory>>;
|
|
4
|
+
export interface IGetApplicationWebhookHistoryData {
|
|
5
|
+
applicationWebhookHistory: IApplicationWebhookHistory;
|
|
6
|
+
}
|
|
7
|
+
export type IGetApplicationWebhookHistoryResponse = IResponse<IGetApplicationWebhookHistoryData>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BasePaginate, IResponse } from '..';
|
|
2
|
+
import { IApplicationWebhook } from '../../models/application-webhook.model';
|
|
3
|
+
export type IPaginateApplicationWebhookAdminResponse = IResponse<BasePaginate<IApplicationWebhook>>;
|
|
4
|
+
export interface IGetApplicationWebhookAdminData {
|
|
5
|
+
applicationWebhook: IApplicationWebhook;
|
|
6
|
+
}
|
|
7
|
+
export type IGetApplicationWebhookAdminResponse = IResponse<IGetApplicationWebhookAdminData>;
|
|
8
|
+
export interface IResetSecretApplicationWebhookAdminData {
|
|
9
|
+
applicationWebhook: IApplicationWebhook;
|
|
10
|
+
}
|
|
11
|
+
export type IResetSecretApplicationWebhookAdminResponse = IResponse<IResetSecretApplicationWebhookAdminData>;
|
|
12
|
+
export interface IUpdateApplicationWebhookAdminData {
|
|
13
|
+
applicationWebhook: IApplicationWebhook;
|
|
14
|
+
}
|
|
15
|
+
export type IUpdateApplicationWebhookAdminResponse = IResponse<IUpdateApplicationWebhookAdminData>;
|
|
16
|
+
export interface ICreateApplicationWebhookAdminData {
|
|
17
|
+
applicationWebhook: IApplicationWebhook;
|
|
18
|
+
}
|
|
19
|
+
export type ICreateApplicationWebhookAdminResponse = IResponse<ICreateApplicationWebhookAdminData>;
|
|
20
|
+
export type IDeleteApplicationWebhookAdminData = Record<string, never>;
|
|
21
|
+
export type IDeleteApplicationWebhookAdminResponse = IResponse<IDeleteApplicationWebhookAdminData>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BasePaginate, IResponse } from '..';
|
|
2
|
+
import { IApplicationWebhook } from '../../models/application-webhook.model';
|
|
3
|
+
export type IPaginateApplicationWebhookResponse = IResponse<BasePaginate<IApplicationWebhook>>;
|
|
4
|
+
export interface IGetApplicationWebhookData {
|
|
5
|
+
applicationWebhook: IApplicationWebhook;
|
|
6
|
+
}
|
|
7
|
+
export type IGetApplicationWebhookResponse = IResponse<IGetApplicationWebhookData>;
|
|
8
|
+
export interface IResetSecretApplicationWebhookData {
|
|
9
|
+
applicationWebhook: IApplicationWebhook;
|
|
10
|
+
}
|
|
11
|
+
export type IResetSecretApplicationWebhookResponse = IResponse<IResetSecretApplicationWebhookData>;
|
|
12
|
+
export interface IUpdateApplicationWebhookData {
|
|
13
|
+
applicationWebhook: IApplicationWebhook;
|
|
14
|
+
}
|
|
15
|
+
export type IUpdateApplicationWebhookResponse = IResponse<IUpdateApplicationWebhookData>;
|
|
16
|
+
export interface ICreateApplicationWebhookData {
|
|
17
|
+
applicationWebhook: IApplicationWebhook;
|
|
18
|
+
}
|
|
19
|
+
export type ICreateApplicationWebhookResponse = IResponse<ICreateApplicationWebhookData>;
|
|
20
|
+
export type IDeleteApplicationWebhookData = Record<string, never>;
|
|
21
|
+
export type IDeleteApplicationWebhookResponse = IResponse<IDeleteApplicationWebhookData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './webhook.dto';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./webhook.dto"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApplicationWebhookScope, LogLevel } from '../../enum';
|
|
2
|
+
export type WebhookDTO = {
|
|
3
|
+
id: string;
|
|
4
|
+
groupId: string;
|
|
5
|
+
webhookSecret: string;
|
|
6
|
+
applicationId: string;
|
|
7
|
+
} & WebhookEventPayloadDTO;
|
|
8
|
+
export type WebhookEventPayloadDTO = {
|
|
9
|
+
scope: ApplicationWebhookScope;
|
|
10
|
+
payload: {
|
|
11
|
+
event: string;
|
|
12
|
+
applicationEventId: string;
|
|
13
|
+
level: LogLevel;
|
|
14
|
+
message: string | null;
|
|
15
|
+
data: Record<string, unknown> | null;
|
|
16
|
+
date: Date;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -6,4 +6,7 @@ export * from './models/application-log-endpoint.model';
|
|
|
6
6
|
export * from './models/application-cron-task.model';
|
|
7
7
|
export * from './models/application-cron-task-history.model';
|
|
8
8
|
export * from './models/application-event.model';
|
|
9
|
+
export * from './models/application-webhook.model';
|
|
10
|
+
export * from './models/application-webhook-history.model';
|
|
9
11
|
export * from './api';
|
|
12
|
+
export * from './dto';
|
|
@@ -22,4 +22,7 @@ __exportStar(require("./models/application-log-endpoint.model"), exports);
|
|
|
22
22
|
__exportStar(require("./models/application-cron-task.model"), exports);
|
|
23
23
|
__exportStar(require("./models/application-cron-task-history.model"), exports);
|
|
24
24
|
__exportStar(require("./models/application-event.model"), exports);
|
|
25
|
+
__exportStar(require("./models/application-webhook.model"), exports);
|
|
26
|
+
__exportStar(require("./models/application-webhook-history.model"), exports);
|
|
25
27
|
__exportStar(require("./api"), exports);
|
|
28
|
+
__exportStar(require("./dto"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApplicationWebhookScope } from '../../enum';
|
|
2
|
+
import { IApplicationWebhook } from './application-webhook.model';
|
|
3
|
+
export interface IApplicationWebhookHistory {
|
|
4
|
+
id?: string;
|
|
5
|
+
body: Record<string, unknown>;
|
|
6
|
+
response: string | null;
|
|
7
|
+
responseCode: number | null;
|
|
8
|
+
webhookId: string;
|
|
9
|
+
groupId: string;
|
|
10
|
+
scope: ApplicationWebhookScope;
|
|
11
|
+
sendAt: Date;
|
|
12
|
+
applicationWebhookId: string;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
applicationWebhook?: IApplicationWebhook;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApplicationWebhookScope } from '../../enum/application-webhook-scope.enum';
|
|
2
|
+
import { IApplicationWebhookHistory } from './application-webhook-history.model';
|
|
3
|
+
import { IApplication } from './application.model';
|
|
4
|
+
export interface IApplicationWebhook {
|
|
5
|
+
id?: string;
|
|
6
|
+
scopes: ApplicationWebhookScope[];
|
|
7
|
+
webhookSecret: string;
|
|
8
|
+
webhookUrl: string;
|
|
9
|
+
isEnabled: boolean;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
applicationId: string;
|
|
13
|
+
filters: ApplicationWebhookFilters | null;
|
|
14
|
+
updatedAt?: Date;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
application: IApplication;
|
|
17
|
+
applicationWebhookHistory: IApplicationWebhookHistory[];
|
|
18
|
+
}
|
|
19
|
+
export type ApplicationWebhookFilters = {
|
|
20
|
+
[ApplicationWebhookScope.EVENT]?: {
|
|
21
|
+
include?: string[] | null;
|
|
22
|
+
exclude?: string[] | null;
|
|
23
|
+
equals?: string[] | null;
|
|
24
|
+
} | null;
|
|
25
|
+
};
|
|
@@ -3,6 +3,7 @@ import { IApplicationEvent } from './application-event.model';
|
|
|
3
3
|
import { IApplicationLog } from './application-log.model';
|
|
4
4
|
import { IApplicationStats } from './application-stats.model';
|
|
5
5
|
import { IApplicationStoreEntry } from './application-store-entry.model';
|
|
6
|
+
import { IApplicationWebhook } from './application-webhook.model';
|
|
6
7
|
export interface IApplication {
|
|
7
8
|
id?: string;
|
|
8
9
|
projectId: string;
|
|
@@ -14,4 +15,5 @@ export interface IApplication {
|
|
|
14
15
|
applicationCronTask?: IApplicationCronTask[];
|
|
15
16
|
applicationStoreEntry?: IApplicationStoreEntry[];
|
|
16
17
|
applicationEvent?: IApplicationEvent[];
|
|
18
|
+
applicationWebhook?: IApplicationWebhook[];
|
|
17
19
|
}
|