@abyss-project/monitor 6.5.0 → 7.0.0
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/api/alert-rule.api.d.ts +2 -1
- package/dist/api/alert-rule.api.js +5 -1
- package/dist/api/alert-rule.api.js.map +1 -1
- package/dist/index.d.ts +4 -11
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/models/logger.model.d.ts +0 -1
- package/dist/models/logger.model.js +0 -24
- package/dist/models/logger.model.js.map +1 -1
- package/dist/models/stats-publisher.model.js +0 -11
- package/dist/models/stats-publisher.model.js.map +1 -1
- package/dist/rules/condition.bounds.d.ts +35 -0
- package/dist/rules/condition.bounds.js +298 -0
- package/dist/rules/condition.bounds.js.map +1 -0
- package/dist/rules/condition.compiler.d.ts +4 -0
- package/dist/rules/condition.compiler.js +102 -0
- package/dist/rules/condition.compiler.js.map +1 -0
- package/dist/rules/condition.parser.d.ts +2 -0
- package/dist/rules/condition.parser.js +381 -0
- package/dist/rules/condition.parser.js.map +1 -0
- package/dist/rules/condition.printer.d.ts +2 -0
- package/dist/rules/condition.printer.js +85 -0
- package/dist/rules/condition.printer.js.map +1 -0
- package/dist/rules/condition.types.d.ts +74 -0
- package/dist/rules/condition.types.js +50 -0
- package/dist/rules/condition.types.js.map +1 -0
- package/dist/rules/index.d.ts +6 -0
- package/dist/rules/index.js +23 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/safe-regex.d.ts +9 -0
- package/dist/rules/safe-regex.js +28 -0
- package/dist/rules/safe-regex.js.map +1 -0
- package/dist/types/enum/alert-rule-evaluation.enum.d.ts +4 -0
- package/dist/types/enum/alert-rule-evaluation.enum.js +9 -0
- package/dist/types/enum/alert-rule-evaluation.enum.js.map +1 -0
- package/dist/types/enum/alert-rule-field.enum.d.ts +12 -0
- package/dist/types/enum/alert-rule-field.enum.js +15 -0
- package/dist/types/enum/alert-rule-field.enum.js.map +1 -0
- package/dist/types/enum/alert-rule-operator.enum.d.ts +16 -0
- package/dist/types/enum/alert-rule-operator.enum.js +21 -0
- package/dist/types/enum/alert-rule-operator.enum.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +2 -1
- package/dist/types/enum/api-error.enum.js +1 -0
- package/dist/types/enum/api-error.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +3 -1
- package/dist/types/enum/index.js +3 -1
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/monitor-warning-code.enum.d.ts +5 -1
- package/dist/types/enum/monitor-warning-code.enum.js +6 -1
- package/dist/types/enum/monitor-warning-code.enum.js.map +1 -1
- package/dist/types/enum/notification-delivery-kind.enum.d.ts +2 -1
- package/dist/types/enum/notification-delivery-kind.enum.js +1 -0
- package/dist/types/enum/notification-delivery-kind.enum.js.map +1 -1
- package/dist/types/interface/api/requests/alert-rule.request.d.ts +13 -3
- package/dist/types/interface/api/responses/alert-rule.response.d.ts +1 -0
- package/dist/types/interface/models/monitor-alert-rule.model.d.ts +6 -1
- package/dist/types/interface/models/user.model.d.ts +1 -0
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +2 -3
- package/dist/types/enum/application-alert-type.enum.d.ts +0 -5
- package/dist/types/enum/application-alert-type.enum.js +0 -10
- package/dist/types/enum/application-alert-type.enum.js.map +0 -1
- package/dist/utils/alert.utils.d.ts +0 -36
- package/dist/utils/alert.utils.js +0 -138
- package/dist/utils/alert.utils.js.map +0 -1
- package/dist/utils/discord-webhook-log-formatter.utils.d.ts +0 -48
- package/dist/utils/discord-webhook-log-formatter.utils.js +0 -335
- package/dist/utils/discord-webhook-log-formatter.utils.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AlertRuleConditionField, AlertRuleOperator, LogLevel } from '../types/enum';
|
|
2
|
+
export type IAlertRuleCondition = {
|
|
3
|
+
op: 'AND' | 'OR';
|
|
4
|
+
children: IAlertRuleCondition[];
|
|
5
|
+
} | {
|
|
6
|
+
op: 'NOT';
|
|
7
|
+
child: IAlertRuleCondition;
|
|
8
|
+
} | {
|
|
9
|
+
op: 'COMPARE';
|
|
10
|
+
field: AlertRuleConditionField;
|
|
11
|
+
operator: AlertRuleOperator;
|
|
12
|
+
value?: string | number | boolean | Array<string | number>;
|
|
13
|
+
};
|
|
14
|
+
export interface IAlertRuleLogView {
|
|
15
|
+
level: LogLevel;
|
|
16
|
+
title: string | null;
|
|
17
|
+
message: string;
|
|
18
|
+
stack: string | null;
|
|
19
|
+
context: string | null;
|
|
20
|
+
scenario: string | null;
|
|
21
|
+
endpoint: string | null;
|
|
22
|
+
httpStatus: number | null;
|
|
23
|
+
data: unknown;
|
|
24
|
+
}
|
|
25
|
+
export declare enum AlertRuleConditionExpected {
|
|
26
|
+
FIELD = "FIELD",
|
|
27
|
+
DATA_PATH = "DATA_PATH",
|
|
28
|
+
OPERATOR = "OPERATOR",
|
|
29
|
+
OPERATOR_FOR_FIELD = "OPERATOR_FOR_FIELD",
|
|
30
|
+
LEVEL_NAME = "LEVEL_NAME",
|
|
31
|
+
TEXT = "TEXT",
|
|
32
|
+
NUMBER = "NUMBER",
|
|
33
|
+
INTEGER = "INTEGER",
|
|
34
|
+
SCALAR = "SCALAR",
|
|
35
|
+
TEXT_OR_NUMBER = "TEXT_OR_NUMBER",
|
|
36
|
+
LIST = "LIST",
|
|
37
|
+
REGEX = "REGEX",
|
|
38
|
+
REGEX_FLAG = "REGEX_FLAG",
|
|
39
|
+
VALID_REGEX = "VALID_REGEX",
|
|
40
|
+
CLOSING_QUOTE = "CLOSING_QUOTE",
|
|
41
|
+
STRING_ESCAPE = "STRING_ESCAPE",
|
|
42
|
+
CLOSING_SLASH = "CLOSING_SLASH",
|
|
43
|
+
CLOSING_PAREN = "CLOSING_PAREN",
|
|
44
|
+
END = "END",
|
|
45
|
+
SHALLOWER_NESTING = "SHALLOWER_NESTING"
|
|
46
|
+
}
|
|
47
|
+
export type ParseConditionResult = {
|
|
48
|
+
ok: true;
|
|
49
|
+
condition: IAlertRuleCondition;
|
|
50
|
+
} | {
|
|
51
|
+
ok: false;
|
|
52
|
+
error: {
|
|
53
|
+
position: number;
|
|
54
|
+
expected: AlertRuleConditionExpected;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare enum AlertRuleConditionViolation {
|
|
58
|
+
MALFORMED_NODE = "MALFORMED_NODE",
|
|
59
|
+
EMPTY_GROUP = "EMPTY_GROUP",
|
|
60
|
+
DEPTH_EXCEEDED = "DEPTH_EXCEEDED",
|
|
61
|
+
TOO_MANY_NODES = "TOO_MANY_NODES",
|
|
62
|
+
TEXT_TOO_LONG = "TEXT_TOO_LONG",
|
|
63
|
+
TOO_MANY_VALUES = "TOO_MANY_VALUES",
|
|
64
|
+
REGEX_TOO_LONG = "REGEX_TOO_LONG",
|
|
65
|
+
INVALID_REGEX = "INVALID_REGEX",
|
|
66
|
+
INVALID_DATA_PATH = "INVALID_DATA_PATH",
|
|
67
|
+
UNKNOWN_FIELD = "UNKNOWN_FIELD",
|
|
68
|
+
OPERATOR_NOT_ALLOWED = "OPERATOR_NOT_ALLOWED",
|
|
69
|
+
INVALID_VALUE = "INVALID_VALUE"
|
|
70
|
+
}
|
|
71
|
+
export declare class InvalidAlertRuleConditionError extends Error {
|
|
72
|
+
readonly violation: AlertRuleConditionViolation;
|
|
73
|
+
constructor(violation: AlertRuleConditionViolation);
|
|
74
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidAlertRuleConditionError = exports.AlertRuleConditionViolation = exports.AlertRuleConditionExpected = void 0;
|
|
4
|
+
var AlertRuleConditionExpected;
|
|
5
|
+
(function (AlertRuleConditionExpected) {
|
|
6
|
+
AlertRuleConditionExpected["FIELD"] = "FIELD";
|
|
7
|
+
AlertRuleConditionExpected["DATA_PATH"] = "DATA_PATH";
|
|
8
|
+
AlertRuleConditionExpected["OPERATOR"] = "OPERATOR";
|
|
9
|
+
AlertRuleConditionExpected["OPERATOR_FOR_FIELD"] = "OPERATOR_FOR_FIELD";
|
|
10
|
+
AlertRuleConditionExpected["LEVEL_NAME"] = "LEVEL_NAME";
|
|
11
|
+
AlertRuleConditionExpected["TEXT"] = "TEXT";
|
|
12
|
+
AlertRuleConditionExpected["NUMBER"] = "NUMBER";
|
|
13
|
+
AlertRuleConditionExpected["INTEGER"] = "INTEGER";
|
|
14
|
+
AlertRuleConditionExpected["SCALAR"] = "SCALAR";
|
|
15
|
+
AlertRuleConditionExpected["TEXT_OR_NUMBER"] = "TEXT_OR_NUMBER";
|
|
16
|
+
AlertRuleConditionExpected["LIST"] = "LIST";
|
|
17
|
+
AlertRuleConditionExpected["REGEX"] = "REGEX";
|
|
18
|
+
AlertRuleConditionExpected["REGEX_FLAG"] = "REGEX_FLAG";
|
|
19
|
+
AlertRuleConditionExpected["VALID_REGEX"] = "VALID_REGEX";
|
|
20
|
+
AlertRuleConditionExpected["CLOSING_QUOTE"] = "CLOSING_QUOTE";
|
|
21
|
+
AlertRuleConditionExpected["STRING_ESCAPE"] = "STRING_ESCAPE";
|
|
22
|
+
AlertRuleConditionExpected["CLOSING_SLASH"] = "CLOSING_SLASH";
|
|
23
|
+
AlertRuleConditionExpected["CLOSING_PAREN"] = "CLOSING_PAREN";
|
|
24
|
+
AlertRuleConditionExpected["END"] = "END";
|
|
25
|
+
AlertRuleConditionExpected["SHALLOWER_NESTING"] = "SHALLOWER_NESTING";
|
|
26
|
+
})(AlertRuleConditionExpected || (exports.AlertRuleConditionExpected = AlertRuleConditionExpected = {}));
|
|
27
|
+
var AlertRuleConditionViolation;
|
|
28
|
+
(function (AlertRuleConditionViolation) {
|
|
29
|
+
AlertRuleConditionViolation["MALFORMED_NODE"] = "MALFORMED_NODE";
|
|
30
|
+
AlertRuleConditionViolation["EMPTY_GROUP"] = "EMPTY_GROUP";
|
|
31
|
+
AlertRuleConditionViolation["DEPTH_EXCEEDED"] = "DEPTH_EXCEEDED";
|
|
32
|
+
AlertRuleConditionViolation["TOO_MANY_NODES"] = "TOO_MANY_NODES";
|
|
33
|
+
AlertRuleConditionViolation["TEXT_TOO_LONG"] = "TEXT_TOO_LONG";
|
|
34
|
+
AlertRuleConditionViolation["TOO_MANY_VALUES"] = "TOO_MANY_VALUES";
|
|
35
|
+
AlertRuleConditionViolation["REGEX_TOO_LONG"] = "REGEX_TOO_LONG";
|
|
36
|
+
AlertRuleConditionViolation["INVALID_REGEX"] = "INVALID_REGEX";
|
|
37
|
+
AlertRuleConditionViolation["INVALID_DATA_PATH"] = "INVALID_DATA_PATH";
|
|
38
|
+
AlertRuleConditionViolation["UNKNOWN_FIELD"] = "UNKNOWN_FIELD";
|
|
39
|
+
AlertRuleConditionViolation["OPERATOR_NOT_ALLOWED"] = "OPERATOR_NOT_ALLOWED";
|
|
40
|
+
AlertRuleConditionViolation["INVALID_VALUE"] = "INVALID_VALUE";
|
|
41
|
+
})(AlertRuleConditionViolation || (exports.AlertRuleConditionViolation = AlertRuleConditionViolation = {}));
|
|
42
|
+
class InvalidAlertRuleConditionError extends Error {
|
|
43
|
+
constructor(violation) {
|
|
44
|
+
super(`Invalid alert rule condition: ${violation}`);
|
|
45
|
+
this.violation = violation;
|
|
46
|
+
this.name = 'InvalidAlertRuleConditionError';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.InvalidAlertRuleConditionError = InvalidAlertRuleConditionError;
|
|
50
|
+
//# sourceMappingURL=condition.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.types.js","sourceRoot":"","sources":["../../src/rules/condition.types.ts"],"names":[],"mappings":";;;AAuCA,IAAY,0BA6BX;AA7BD,WAAY,0BAA0B;IACpC,6CAAe,CAAA;IAEf,qDAAuB,CAAA;IACvB,mDAAqB,CAAA;IAErB,uEAAyC,CAAA;IACzC,uDAAyB,CAAA;IACzB,2CAAa,CAAA;IACb,+CAAiB,CAAA;IACjB,iDAAmB,CAAA;IAEnB,+CAAiB,CAAA;IACjB,+DAAiC,CAAA;IAEjC,2CAAa,CAAA;IACb,6CAAe,CAAA;IAEf,uDAAyB,CAAA;IAEzB,yDAA2B,CAAA;IAC3B,6DAA+B,CAAA;IAE/B,6DAA+B,CAAA;IAC/B,6DAA+B,CAAA;IAC/B,6DAA+B,CAAA;IAC/B,yCAAW,CAAA;IAEX,qEAAuC,CAAA;AACzC,CAAC,EA7BW,0BAA0B,0CAA1B,0BAA0B,QA6BrC;AAOD,IAAY,2BAgBX;AAhBD,WAAY,2BAA2B;IAErC,gEAAiC,CAAA;IAEjC,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,gEAAiC,CAAA;IACjC,8DAA+B,CAAA;IAC/B,kEAAmC,CAAA;IACnC,gEAAiC,CAAA;IACjC,8DAA+B,CAAA;IAC/B,sEAAuC,CAAA;IACvC,8DAA+B,CAAA;IAC/B,4EAA6C,CAAA;IAE7C,8DAA+B,CAAA;AACjC,CAAC,EAhBW,2BAA2B,2CAA3B,2BAA2B,QAgBtC;AAGD,MAAa,8BAA+B,SAAQ,KAAK;IACvD,YAA4B,SAAsC;QAChE,KAAK,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;QAD1B,cAAS,GAAT,SAAS,CAA6B;QAEhE,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF;AALD,wEAKC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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("./condition.types"), exports);
|
|
18
|
+
__exportStar(require("./condition.bounds"), exports);
|
|
19
|
+
__exportStar(require("./condition.parser"), exports);
|
|
20
|
+
__exportStar(require("./condition.printer"), exports);
|
|
21
|
+
__exportStar(require("./condition.compiler"), exports);
|
|
22
|
+
__exportStar(require("./safe-regex"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,qDAAmC;AACnC,qDAAmC;AACnC,sDAAoC;AACpC,uDAAqC;AACrC,+CAA6B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class InvalidSafeRegexError extends Error {
|
|
2
|
+
readonly source: string;
|
|
3
|
+
readonly reason: string;
|
|
4
|
+
constructor(source: string, reason: string);
|
|
5
|
+
}
|
|
6
|
+
export interface ISafeRegex {
|
|
7
|
+
test(s: string): boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const compileSafeRegex: (source: string, flags: 'i' | '') => ISafeRegex;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileSafeRegex = exports.InvalidSafeRegexError = void 0;
|
|
4
|
+
const re2js_1 = require("re2js");
|
|
5
|
+
class InvalidSafeRegexError extends Error {
|
|
6
|
+
constructor(source, reason) {
|
|
7
|
+
super(`Invalid RE2 regular expression /${source}/: ${reason}`);
|
|
8
|
+
this.source = source;
|
|
9
|
+
this.reason = reason;
|
|
10
|
+
this.name = 'InvalidSafeRegexError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.InvalidSafeRegexError = InvalidSafeRegexError;
|
|
14
|
+
const compileSafeRegex = (source, flags) => {
|
|
15
|
+
let compiled;
|
|
16
|
+
try {
|
|
17
|
+
compiled = re2js_1.RE2JS.compile(source, flags === 'i' ? re2js_1.RE2JS.CASE_INSENSITIVE : 0);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof re2js_1.RE2JSException) {
|
|
21
|
+
throw new InvalidSafeRegexError(source, error.message);
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
return { test: (s) => compiled.test(s) };
|
|
26
|
+
};
|
|
27
|
+
exports.compileSafeRegex = compileSafeRegex;
|
|
28
|
+
//# sourceMappingURL=safe-regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-regex.js","sourceRoot":"","sources":["../../src/rules/safe-regex.ts"],"names":[],"mappings":";;;AAAA,iCAA8C;AAG9C,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAA4B,MAAc,EAAkB,MAAc;QACxE,KAAK,CAAC,mCAAmC,MAAM,MAAM,MAAM,EAAE,CAAC,CAAC;QADrC,WAAM,GAAN,MAAM,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAQ;QAExE,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC;AAYM,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,KAAe,EAAc,EAAE;IAC9E,IAAI,QAAe,CAAC;IACpB,IAAI,CAAC;QACH,QAAQ,GAAG,aAAK,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,aAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,sBAAc,EAAE,CAAC;YACpC,MAAM,IAAI,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACzD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,CAAS,EAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertRuleEvaluation = void 0;
|
|
4
|
+
var AlertRuleEvaluation;
|
|
5
|
+
(function (AlertRuleEvaluation) {
|
|
6
|
+
AlertRuleEvaluation["WINDOW"] = "WINDOW";
|
|
7
|
+
AlertRuleEvaluation["EACH_OCCURRENCE"] = "EACH_OCCURRENCE";
|
|
8
|
+
})(AlertRuleEvaluation || (exports.AlertRuleEvaluation = AlertRuleEvaluation = {}));
|
|
9
|
+
//# sourceMappingURL=alert-rule-evaluation.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-rule-evaluation.enum.js","sourceRoot":"","sources":["../../../src/types/enum/alert-rule-evaluation.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAE7B,wCAAiB,CAAA;IAEjB,0DAAmC,CAAA;AACrC,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum AlertRuleField {
|
|
2
|
+
LEVEL = "level",
|
|
3
|
+
TITLE = "title",
|
|
4
|
+
MESSAGE = "message",
|
|
5
|
+
STACK = "stack",
|
|
6
|
+
CONTEXT = "context",
|
|
7
|
+
SCENARIO = "scenario",
|
|
8
|
+
ENDPOINT = "endpoint",
|
|
9
|
+
HTTP_STATUS = "httpStatus"
|
|
10
|
+
}
|
|
11
|
+
export type AlertRuleDataField = `data.${string}`;
|
|
12
|
+
export type AlertRuleConditionField = AlertRuleField | AlertRuleDataField;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertRuleField = void 0;
|
|
4
|
+
var AlertRuleField;
|
|
5
|
+
(function (AlertRuleField) {
|
|
6
|
+
AlertRuleField["LEVEL"] = "level";
|
|
7
|
+
AlertRuleField["TITLE"] = "title";
|
|
8
|
+
AlertRuleField["MESSAGE"] = "message";
|
|
9
|
+
AlertRuleField["STACK"] = "stack";
|
|
10
|
+
AlertRuleField["CONTEXT"] = "context";
|
|
11
|
+
AlertRuleField["SCENARIO"] = "scenario";
|
|
12
|
+
AlertRuleField["ENDPOINT"] = "endpoint";
|
|
13
|
+
AlertRuleField["HTTP_STATUS"] = "httpStatus";
|
|
14
|
+
})(AlertRuleField || (exports.AlertRuleField = AlertRuleField = {}));
|
|
15
|
+
//# sourceMappingURL=alert-rule-field.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-rule-field.enum.js","sourceRoot":"","sources":["../../../src/types/enum/alert-rule-field.enum.ts"],"names":[],"mappings":";;;AAKA,IAAY,cAUX;AAVD,WAAY,cAAc;IAExB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,4CAA0B,CAAA;AAC5B,CAAC,EAVW,cAAc,8BAAd,cAAc,QAUzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum AlertRuleOperator {
|
|
2
|
+
EQUALS = "EQUALS",
|
|
3
|
+
NOT_EQUALS = "NOT_EQUALS",
|
|
4
|
+
CONTAINS = "CONTAINS",
|
|
5
|
+
STARTS_WITH = "STARTS_WITH",
|
|
6
|
+
ENDS_WITH = "ENDS_WITH",
|
|
7
|
+
GT = "GT",
|
|
8
|
+
GTE = "GTE",
|
|
9
|
+
LT = "LT",
|
|
10
|
+
LTE = "LTE",
|
|
11
|
+
IN = "IN",
|
|
12
|
+
NOT_IN = "NOT_IN",
|
|
13
|
+
EXISTS = "EXISTS",
|
|
14
|
+
NOT_EXISTS = "NOT_EXISTS",
|
|
15
|
+
MATCHES = "MATCHES"
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertRuleOperator = void 0;
|
|
4
|
+
var AlertRuleOperator;
|
|
5
|
+
(function (AlertRuleOperator) {
|
|
6
|
+
AlertRuleOperator["EQUALS"] = "EQUALS";
|
|
7
|
+
AlertRuleOperator["NOT_EQUALS"] = "NOT_EQUALS";
|
|
8
|
+
AlertRuleOperator["CONTAINS"] = "CONTAINS";
|
|
9
|
+
AlertRuleOperator["STARTS_WITH"] = "STARTS_WITH";
|
|
10
|
+
AlertRuleOperator["ENDS_WITH"] = "ENDS_WITH";
|
|
11
|
+
AlertRuleOperator["GT"] = "GT";
|
|
12
|
+
AlertRuleOperator["GTE"] = "GTE";
|
|
13
|
+
AlertRuleOperator["LT"] = "LT";
|
|
14
|
+
AlertRuleOperator["LTE"] = "LTE";
|
|
15
|
+
AlertRuleOperator["IN"] = "IN";
|
|
16
|
+
AlertRuleOperator["NOT_IN"] = "NOT_IN";
|
|
17
|
+
AlertRuleOperator["EXISTS"] = "EXISTS";
|
|
18
|
+
AlertRuleOperator["NOT_EXISTS"] = "NOT_EXISTS";
|
|
19
|
+
AlertRuleOperator["MATCHES"] = "MATCHES";
|
|
20
|
+
})(AlertRuleOperator || (exports.AlertRuleOperator = AlertRuleOperator = {}));
|
|
21
|
+
//# sourceMappingURL=alert-rule-operator.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-rule-operator.enum.js","sourceRoot":"","sources":["../../../src/types/enum/alert-rule-operator.enum.ts"],"names":[],"mappings":";;;AAKA,IAAY,iBAqBX;AArBD,WAAY,iBAAiB;IAE3B,sCAAiB,CAAA;IACjB,8CAAyB,CAAA;IAEzB,0CAAqB,CAAA;IAErB,gDAA2B,CAAA;IAE3B,4CAAuB,CAAA;IACvB,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,8BAAS,CAAA;IACT,gCAAW,CAAA;IAEX,8BAAS,CAAA;IACT,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;IACjB,8CAAyB,CAAA;IAEzB,wCAAmB,CAAA;AACrB,CAAC,EArBW,iBAAiB,iCAAjB,iBAAiB,QAqB5B"}
|
|
@@ -27,5 +27,6 @@ export declare enum Code {
|
|
|
27
27
|
maxCronTaskNumber = "max_cron_task_number",
|
|
28
28
|
maxEventPublishPerDay = "max_event_publish_per_day",
|
|
29
29
|
maxSentinelNumber = "max_sentinel_number",
|
|
30
|
-
maxAlertRuleNumber = "max_alert_rule_number"
|
|
30
|
+
maxAlertRuleNumber = "max_alert_rule_number",
|
|
31
|
+
maxEachOccurrenceAlertRuleNumber = "max_each_occurrence_alert_rule_number"
|
|
31
32
|
}
|
|
@@ -33,5 +33,6 @@ var Code;
|
|
|
33
33
|
Code["maxEventPublishPerDay"] = "max_event_publish_per_day";
|
|
34
34
|
Code["maxSentinelNumber"] = "max_sentinel_number";
|
|
35
35
|
Code["maxAlertRuleNumber"] = "max_alert_rule_number";
|
|
36
|
+
Code["maxEachOccurrenceAlertRuleNumber"] = "max_each_occurrence_alert_rule_number";
|
|
36
37
|
})(Code || (exports.Code = Code = {}));
|
|
37
38
|
//# sourceMappingURL=api-error.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.enum.js","sourceRoot":"","sources":["../../../src/types/enum/api-error.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,mCAAsB,CAAA;IACtB,+CAAkC,CAAA;IAClC,6CAAgC,CAAA;AAClC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"api-error.enum.js","sourceRoot":"","sources":["../../../src/types/enum/api-error.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,mCAAsB,CAAA;IACtB,+CAAkC,CAAA;IAClC,6CAAgC,CAAA;AAClC,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAED,IAAY,IAiDX;AAjDD,WAAY,IAAI;IAEd,qDAA6C,CAAA;IAC7C,oEAA4D,CAAA;IAC5D,+CAAuC,CAAA;IACvC,8BAAsB,CAAA;IACtB,qDAA6C,CAAA;IAC7C,qDAA6C,CAAA;IAC7C,qDAA6C,CAAA;IAC7C,kDAA0C,CAAA;IAC1C,oCAA4B,CAAA;IAC5B,0CAAkC,CAAA;IAIlC,0EAAkE,CAAA;IAElE,8CAAsC,CAAA;IAEtC,+CAAuC,CAAA;IAEvC,+CAAuC,CAAA;IAEvC,wDAAgD,CAAA;IAEhD,4EAAoE,CAAA;IAEpE,iGAAyF,CAAA;IAEzF,qEAA6D,CAAA;IAE7D,uEAA+D,CAAA;IAE/D,qEAA6D,CAAA;IAG7D,kDAA0C,CAAA;IAG1C,2DAAmD,CAAA;IAGnD,iDAAyC,CAAA;IAIzC,oDAA4C,CAAA;IAE5C,kFAA0E,CAAA;AAC5E,CAAC,EAjDW,IAAI,oBAAJ,IAAI,QAiDf"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './api-error.enum';
|
|
2
2
|
export * from './api-method.enum';
|
|
3
3
|
export * from './application-stats-type.enum';
|
|
4
|
-
export * from './application-alert-type.enum';
|
|
5
4
|
export * from './log-level.enum';
|
|
6
5
|
export * from './log-scenario.enum';
|
|
7
6
|
export * from './application-webhook-scope.enum';
|
|
@@ -23,6 +22,9 @@ export * from './incident-suppressed-reason.enum';
|
|
|
23
22
|
export * from './incident-clear-reason.enum';
|
|
24
23
|
export * from './alert-rule-mode.enum';
|
|
25
24
|
export * from './alert-rule-group-by.enum';
|
|
25
|
+
export * from './alert-rule-evaluation.enum';
|
|
26
|
+
export * from './alert-rule-field.enum';
|
|
27
|
+
export * from './alert-rule-operator.enum';
|
|
26
28
|
export * from './notification-provider.enum';
|
|
27
29
|
export * from './notification-delivery-status.enum';
|
|
28
30
|
export * from './notification-delivery-kind.enum';
|
package/dist/types/enum/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./api-error.enum"), exports);
|
|
18
18
|
__exportStar(require("./api-method.enum"), exports);
|
|
19
19
|
__exportStar(require("./application-stats-type.enum"), exports);
|
|
20
|
-
__exportStar(require("./application-alert-type.enum"), exports);
|
|
21
20
|
__exportStar(require("./log-level.enum"), exports);
|
|
22
21
|
__exportStar(require("./log-scenario.enum"), exports);
|
|
23
22
|
__exportStar(require("./application-webhook-scope.enum"), exports);
|
|
@@ -39,6 +38,9 @@ __exportStar(require("./incident-suppressed-reason.enum"), exports);
|
|
|
39
38
|
__exportStar(require("./incident-clear-reason.enum"), exports);
|
|
40
39
|
__exportStar(require("./alert-rule-mode.enum"), exports);
|
|
41
40
|
__exportStar(require("./alert-rule-group-by.enum"), exports);
|
|
41
|
+
__exportStar(require("./alert-rule-evaluation.enum"), exports);
|
|
42
|
+
__exportStar(require("./alert-rule-field.enum"), exports);
|
|
43
|
+
__exportStar(require("./alert-rule-operator.enum"), exports);
|
|
42
44
|
__exportStar(require("./notification-provider.enum"), exports);
|
|
43
45
|
__exportStar(require("./notification-delivery-status.enum"), exports);
|
|
44
46
|
__exportStar(require("./notification-delivery-kind.enum"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC;AAClC,gEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC;AAClC,gEAA8C;AAC9C,mDAAiC;AACjC,sDAAoC;AACpC,mEAAiD;AACjD,mEAAiD;AACjD,2EAAyD;AACzD,wDAAsC;AACtC,gEAA8C;AAC9C,+DAA6C;AAC7C,iEAA+C;AAC/C,iEAA+C;AAC/C,oEAAkD;AAClD,oEAAkD;AAClD,yDAAuC;AACvC,2DAAyC;AACzC,yDAAuC;AACvC,6DAA2C;AAC3C,kEAAgD;AAChD,oEAAkD;AAClD,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,+DAA6C;AAC7C,0DAAwC;AACxC,6DAA2C;AAC3C,+DAA6C;AAC7C,sEAAoD;AACpD,oEAAkD;AAClD,6EAA2D;AAC3D,oEAAkD;AAClD,gEAA8C;AAC9C,8DAA4C;AAC5C,+DAA6C;AAC7C,+DAA6C"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare enum MonitorWarningCode {
|
|
2
2
|
ABYSS_OUTAGE = "ABYSS_OUTAGE",
|
|
3
3
|
CHANNEL_DISABLED = "CHANNEL_DISABLED",
|
|
4
|
-
MESSAGE_TRUNCATED = "MESSAGE_TRUNCATED"
|
|
4
|
+
MESSAGE_TRUNCATED = "MESSAGE_TRUNCATED",
|
|
5
|
+
EVENTS_DROPPED = "EVENTS_DROPPED"
|
|
6
|
+
}
|
|
7
|
+
export declare enum MonitorWarningReason {
|
|
8
|
+
RULE_SCAN_CAPPED = "RULE_SCAN_CAPPED"
|
|
5
9
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MonitorWarningCode = void 0;
|
|
3
|
+
exports.MonitorWarningReason = exports.MonitorWarningCode = void 0;
|
|
4
4
|
var MonitorWarningCode;
|
|
5
5
|
(function (MonitorWarningCode) {
|
|
6
6
|
MonitorWarningCode["ABYSS_OUTAGE"] = "ABYSS_OUTAGE";
|
|
7
7
|
MonitorWarningCode["CHANNEL_DISABLED"] = "CHANNEL_DISABLED";
|
|
8
8
|
MonitorWarningCode["MESSAGE_TRUNCATED"] = "MESSAGE_TRUNCATED";
|
|
9
|
+
MonitorWarningCode["EVENTS_DROPPED"] = "EVENTS_DROPPED";
|
|
9
10
|
})(MonitorWarningCode || (exports.MonitorWarningCode = MonitorWarningCode = {}));
|
|
11
|
+
var MonitorWarningReason;
|
|
12
|
+
(function (MonitorWarningReason) {
|
|
13
|
+
MonitorWarningReason["RULE_SCAN_CAPPED"] = "RULE_SCAN_CAPPED";
|
|
14
|
+
})(MonitorWarningReason || (exports.MonitorWarningReason = MonitorWarningReason = {}));
|
|
10
15
|
//# sourceMappingURL=monitor-warning-code.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitor-warning-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/monitor-warning-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,
|
|
1
|
+
{"version":3,"file":"monitor-warning-code.enum.js","sourceRoot":"","sources":["../../../src/types/enum/monitor-warning-code.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,kBASX;AATD,WAAY,kBAAkB;IAE5B,mDAA6B,CAAA;IAE7B,2DAAqC,CAAA;IAErC,6DAAuC,CAAA;IAEvC,uDAAiC,CAAA;AACnC,CAAC,EATW,kBAAkB,kCAAlB,kBAAkB,QAS7B;AAGD,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAE9B,6DAAqC,CAAA;AACvC,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
|
|
@@ -8,5 +8,6 @@ var NotificationDeliveryKind;
|
|
|
8
8
|
NotificationDeliveryKind["RECOVERY"] = "RECOVERY";
|
|
9
9
|
NotificationDeliveryKind["TEST"] = "TEST";
|
|
10
10
|
NotificationDeliveryKind["REPLAY"] = "REPLAY";
|
|
11
|
+
NotificationDeliveryKind["EVENT"] = "EVENT";
|
|
11
12
|
})(NotificationDeliveryKind || (exports.NotificationDeliveryKind = NotificationDeliveryKind = {}));
|
|
12
13
|
//# sourceMappingURL=notification-delivery-kind.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-delivery-kind.enum.js","sourceRoot":"","sources":["../../../src/types/enum/notification-delivery-kind.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,
|
|
1
|
+
{"version":3,"file":"notification-delivery-kind.enum.js","sourceRoot":"","sources":["../../../src/types/enum/notification-delivery-kind.enum.ts"],"names":[],"mappings":";;;AACA,IAAY,wBASX;AATD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,yCAAa,CAAA;IAEb,6CAAiB,CAAA;IAEjB,2CAAe,CAAA;AACjB,CAAC,EATW,wBAAwB,wCAAxB,wBAAwB,QASnC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IAlertRuleCondition } from '../../../../rules/condition.types';
|
|
2
|
+
import { AlertRuleEvaluation, AlertRuleGroupBy } from '../../../enum';
|
|
2
3
|
import { IMonitorAlertRule } from '../../models/monitor-alert-rule.model';
|
|
3
4
|
export interface IAlertRuleProjectParams {
|
|
4
5
|
projectId: string;
|
|
@@ -6,13 +7,22 @@ export interface IAlertRuleProjectParams {
|
|
|
6
7
|
export interface IAlertRuleParams extends IAlertRuleProjectParams {
|
|
7
8
|
ruleId: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export interface IGetAlertRuleAdminParams {
|
|
11
|
+
ruleId: string;
|
|
12
|
+
}
|
|
13
|
+
type AlertRuleDefinitionMembers = Pick<IMonitorAlertRule, 'name' | 'slug' | 'isEnabled' | 'applicationIds' | 'evaluation' | 'mode' | 'filter' | 'condition' | 'windowMinutes' | 'threshold' | 'groupBy' | 'severity' | 'channelIds' | 'eventBudgetPerMinute'>;
|
|
14
|
+
export type ICreateAlertRuleBody = Omit<AlertRuleDefinitionMembers, 'isEnabled' | 'groupBy' | 'evaluation' | 'condition' | 'channelIds' | 'eventBudgetPerMinute'> & {
|
|
11
15
|
isEnabled?: boolean;
|
|
12
16
|
groupBy?: AlertRuleGroupBy[];
|
|
17
|
+
evaluation?: AlertRuleEvaluation;
|
|
18
|
+
condition?: IAlertRuleCondition | null;
|
|
19
|
+
channelIds?: string[] | null;
|
|
20
|
+
eventBudgetPerMinute?: number | null;
|
|
13
21
|
};
|
|
14
22
|
export type IUpdateAlertRuleBody = Partial<AlertRuleDefinitionMembers>;
|
|
15
23
|
export type IPreviewAlertRuleBody = Pick<AlertRuleDefinitionMembers, 'applicationIds' | 'mode' | 'filter' | 'windowMinutes'> & {
|
|
16
24
|
groupBy?: AlertRuleGroupBy[];
|
|
25
|
+
evaluation?: AlertRuleEvaluation;
|
|
26
|
+
condition?: IAlertRuleCondition | null;
|
|
17
27
|
};
|
|
18
28
|
export {};
|
|
@@ -8,6 +8,7 @@ export interface IAlertRuleData {
|
|
|
8
8
|
alertRule: IMonitorAlertRule;
|
|
9
9
|
}
|
|
10
10
|
export type IAlertRuleResponse = IResponse<IAlertRuleData>;
|
|
11
|
+
export type IGetAlertRuleAdminResponse = IResponse<IAlertRuleData>;
|
|
11
12
|
export type IDeleteAlertRuleData = Record<string, never>;
|
|
12
13
|
export type IDeleteAlertRuleResponse = IResponse<IDeleteAlertRuleData>;
|
|
13
14
|
export interface IPreviewAlertRuleGroup {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IAlertRuleCondition } from '../../../rules/condition.types';
|
|
2
|
+
import { AlertRuleEvaluation, AlertRuleGroupBy, AlertRuleMode, IncidentSeverity, LogLevel } from '../../enum';
|
|
2
3
|
export interface IMonitorAlertRuleFilter {
|
|
3
4
|
levels: LogLevel[];
|
|
4
5
|
contexts: string[];
|
|
@@ -14,12 +15,16 @@ export interface IMonitorAlertRule {
|
|
|
14
15
|
slug: string;
|
|
15
16
|
isEnabled: boolean;
|
|
16
17
|
applicationIds: string[];
|
|
18
|
+
evaluation: AlertRuleEvaluation;
|
|
17
19
|
mode: AlertRuleMode;
|
|
18
20
|
filter: IMonitorAlertRuleFilter;
|
|
21
|
+
condition: IAlertRuleCondition | null;
|
|
19
22
|
windowMinutes: number;
|
|
20
23
|
threshold: number;
|
|
21
24
|
groupBy: AlertRuleGroupBy[];
|
|
22
25
|
severity: IncidentSeverity;
|
|
26
|
+
channelIds: string[] | null;
|
|
27
|
+
eventBudgetPerMinute: number | null;
|
|
23
28
|
lastEvaluatedAt: Date | null;
|
|
24
29
|
createdAt?: Date;
|
|
25
30
|
updatedAt?: Date;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export * from './error.utils';
|
|
2
2
|
export * from './billing-quota-error.utils';
|
|
3
|
-
export * from './discord-webhook-log-formatter.utils';
|
|
4
3
|
export * from './json.utils';
|
|
5
|
-
export * from './alert.utils';
|
|
6
4
|
export * from './non-blocking-promise.utils';
|
|
7
5
|
export * from './request-tracker.utils';
|
|
8
6
|
export * from './graceful-shutdown.utils';
|
package/dist/utils/index.js
CHANGED
|
@@ -16,9 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./error.utils"), exports);
|
|
18
18
|
__exportStar(require("./billing-quota-error.utils"), exports);
|
|
19
|
-
__exportStar(require("./discord-webhook-log-formatter.utils"), exports);
|
|
20
19
|
__exportStar(require("./json.utils"), exports);
|
|
21
|
-
__exportStar(require("./alert.utils"), exports);
|
|
22
20
|
__exportStar(require("./non-blocking-promise.utils"), exports);
|
|
23
21
|
__exportStar(require("./request-tracker.utils"), exports);
|
|
24
22
|
__exportStar(require("./graceful-shutdown.utils"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8DAA4C;AAC5C,+CAA6B;AAC7B,+DAA6C;AAC7C,0DAAwC;AACxC,4DAA0C;AAC1C,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/monitor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Core package to interact with Abyss-Monitor",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,18 +13,17 @@
|
|
|
13
13
|
"homepage": "https://gitlab.com/abyss-group/abyss-monitor/abyss-monitor",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"axios": "^1.6.0",
|
|
16
|
-
"axios-rate-limit": "^1.3.0",
|
|
17
16
|
"axios-retry": "^4.5.0",
|
|
18
17
|
"chalk": "^4.1.1",
|
|
19
18
|
"check-disk-space": "^3.4.0",
|
|
20
19
|
"dayjs": "^1.10.7",
|
|
21
|
-
"discord.js": "14.11.0",
|
|
22
20
|
"fs-extra": "^11.1.1",
|
|
23
21
|
"ioredis": "^5.7.0",
|
|
24
22
|
"joi": "^17.4.0",
|
|
25
23
|
"joi-to-swagger": "^6.2.0",
|
|
26
24
|
"lodash": "^4.17.21",
|
|
27
25
|
"node-os-utils": "^1.3.7",
|
|
26
|
+
"re2js": "^2.8.6",
|
|
28
27
|
"reflect-metadata": "^0.1.13",
|
|
29
28
|
"stack-trace": "^0.0.10",
|
|
30
29
|
"systeminformation": "^5.17.13",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApplicationAlertType = void 0;
|
|
4
|
-
var ApplicationAlertType;
|
|
5
|
-
(function (ApplicationAlertType) {
|
|
6
|
-
ApplicationAlertType["CRON_TASK"] = "CRON_TASK";
|
|
7
|
-
ApplicationAlertType["LOG"] = "LOG";
|
|
8
|
-
ApplicationAlertType["STATS"] = "STATS";
|
|
9
|
-
})(ApplicationAlertType || (exports.ApplicationAlertType = ApplicationAlertType = {}));
|
|
10
|
-
//# sourceMappingURL=application-alert-type.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-alert-type.enum.js","sourceRoot":"","sources":["../../../src/types/enum/application-alert-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,mCAAW,CAAA;IACX,uCAAe,CAAA;AACjB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { LogData, Logger } from '..';
|
|
2
|
-
type BaseSendAlertParams = {
|
|
3
|
-
author?: string;
|
|
4
|
-
logger?: Logger;
|
|
5
|
-
};
|
|
6
|
-
export type ParamsSendLogAlert = {
|
|
7
|
-
logData: LogData;
|
|
8
|
-
applicationLogId?: string | null;
|
|
9
|
-
webhookUrl?: string;
|
|
10
|
-
compact?: boolean;
|
|
11
|
-
} & BaseSendAlertParams;
|
|
12
|
-
export type PayloadSendStatsAlert = {
|
|
13
|
-
statsData: {
|
|
14
|
-
cpu?: {
|
|
15
|
-
value?: number | null;
|
|
16
|
-
percentValue?: number | null;
|
|
17
|
-
};
|
|
18
|
-
ram?: {
|
|
19
|
-
value?: number | null;
|
|
20
|
-
percentValue?: number | null;
|
|
21
|
-
};
|
|
22
|
-
disk?: {
|
|
23
|
-
value?: number | null;
|
|
24
|
-
percentValue?: number | null;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
processId: string;
|
|
28
|
-
dateValue: Date;
|
|
29
|
-
};
|
|
30
|
-
export type ParamsSendStatsAlert = {
|
|
31
|
-
webhookUrl?: string;
|
|
32
|
-
} & BaseSendAlertParams & PayloadSendStatsAlert;
|
|
33
|
-
export declare const buildDashboardLogUrl: (applicationLogId?: string | null) => string;
|
|
34
|
-
export declare const sendLogAlert: (params: ParamsSendLogAlert) => Promise<void>;
|
|
35
|
-
export declare const sendStatsAlert: (params: ParamsSendStatsAlert) => Promise<void>;
|
|
36
|
-
export {};
|