@abyss-project/monitor 6.5.0 → 6.6.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.
Files changed (52) hide show
  1. package/dist/api/alert-rule.api.d.ts +2 -1
  2. package/dist/api/alert-rule.api.js +5 -1
  3. package/dist/api/alert-rule.api.js.map +1 -1
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.js +4 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/rules/condition.bounds.d.ts +35 -0
  8. package/dist/rules/condition.bounds.js +298 -0
  9. package/dist/rules/condition.bounds.js.map +1 -0
  10. package/dist/rules/condition.compiler.d.ts +4 -0
  11. package/dist/rules/condition.compiler.js +102 -0
  12. package/dist/rules/condition.compiler.js.map +1 -0
  13. package/dist/rules/condition.parser.d.ts +2 -0
  14. package/dist/rules/condition.parser.js +381 -0
  15. package/dist/rules/condition.parser.js.map +1 -0
  16. package/dist/rules/condition.printer.d.ts +2 -0
  17. package/dist/rules/condition.printer.js +85 -0
  18. package/dist/rules/condition.printer.js.map +1 -0
  19. package/dist/rules/condition.types.d.ts +74 -0
  20. package/dist/rules/condition.types.js +50 -0
  21. package/dist/rules/condition.types.js.map +1 -0
  22. package/dist/rules/index.d.ts +6 -0
  23. package/dist/rules/index.js +23 -0
  24. package/dist/rules/index.js.map +1 -0
  25. package/dist/rules/safe-regex.d.ts +9 -0
  26. package/dist/rules/safe-regex.js +28 -0
  27. package/dist/rules/safe-regex.js.map +1 -0
  28. package/dist/types/enum/alert-rule-evaluation.enum.d.ts +4 -0
  29. package/dist/types/enum/alert-rule-evaluation.enum.js +9 -0
  30. package/dist/types/enum/alert-rule-evaluation.enum.js.map +1 -0
  31. package/dist/types/enum/alert-rule-field.enum.d.ts +12 -0
  32. package/dist/types/enum/alert-rule-field.enum.js +15 -0
  33. package/dist/types/enum/alert-rule-field.enum.js.map +1 -0
  34. package/dist/types/enum/alert-rule-operator.enum.d.ts +16 -0
  35. package/dist/types/enum/alert-rule-operator.enum.js +21 -0
  36. package/dist/types/enum/alert-rule-operator.enum.js.map +1 -0
  37. package/dist/types/enum/api-error.enum.d.ts +2 -1
  38. package/dist/types/enum/api-error.enum.js +1 -0
  39. package/dist/types/enum/api-error.enum.js.map +1 -1
  40. package/dist/types/enum/index.d.ts +3 -0
  41. package/dist/types/enum/index.js +3 -0
  42. package/dist/types/enum/index.js.map +1 -1
  43. package/dist/types/enum/monitor-warning-code.enum.d.ts +5 -1
  44. package/dist/types/enum/monitor-warning-code.enum.js +6 -1
  45. package/dist/types/enum/monitor-warning-code.enum.js.map +1 -1
  46. package/dist/types/enum/notification-delivery-kind.enum.d.ts +2 -1
  47. package/dist/types/enum/notification-delivery-kind.enum.js +1 -0
  48. package/dist/types/enum/notification-delivery-kind.enum.js.map +1 -1
  49. package/dist/types/interface/api/requests/alert-rule.request.d.ts +13 -3
  50. package/dist/types/interface/api/responses/alert-rule.response.d.ts +1 -0
  51. package/dist/types/interface/models/monitor-alert-rule.model.d.ts +6 -1
  52. package/package.json +2 -1
@@ -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,4 @@
1
+ export declare enum AlertRuleEvaluation {
2
+ WINDOW = "WINDOW",
3
+ EACH_OCCURRENCE = "EACH_OCCURRENCE"
4
+ }
@@ -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,IA+CX;AA/CD,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;AAC9C,CAAC,EA/CW,IAAI,oBAAJ,IAAI,QA+Cf"}
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"}
@@ -23,6 +23,9 @@ export * from './incident-suppressed-reason.enum';
23
23
  export * from './incident-clear-reason.enum';
24
24
  export * from './alert-rule-mode.enum';
25
25
  export * from './alert-rule-group-by.enum';
26
+ export * from './alert-rule-evaluation.enum';
27
+ export * from './alert-rule-field.enum';
28
+ export * from './alert-rule-operator.enum';
26
29
  export * from './notification-provider.enum';
27
30
  export * from './notification-delivery-status.enum';
28
31
  export * from './notification-delivery-kind.enum';
@@ -39,6 +39,9 @@ __exportStar(require("./incident-suppressed-reason.enum"), exports);
39
39
  __exportStar(require("./incident-clear-reason.enum"), exports);
40
40
  __exportStar(require("./alert-rule-mode.enum"), exports);
41
41
  __exportStar(require("./alert-rule-group-by.enum"), exports);
42
+ __exportStar(require("./alert-rule-evaluation.enum"), exports);
43
+ __exportStar(require("./alert-rule-field.enum"), exports);
44
+ __exportStar(require("./alert-rule-operator.enum"), exports);
42
45
  __exportStar(require("./notification-provider.enum"), exports);
43
46
  __exportStar(require("./notification-delivery-status.enum"), exports);
44
47
  __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,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,sEAAoD;AACpD,oEAAkD;AAClD,6EAA2D;AAC3D,oEAAkD;AAClD,gEAA8C;AAC9C,8DAA4C;AAC5C,+DAA6C;AAC7C,+DAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,oDAAkC;AAClC,gEAA8C;AAC9C,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,kBAOX;AAPD,WAAY,kBAAkB;IAE5B,mDAA6B,CAAA;IAE7B,2DAAqC,CAAA;IAErC,6DAAuC,CAAA;AACzC,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B"}
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"}
@@ -3,5 +3,6 @@ export declare enum NotificationDeliveryKind {
3
3
  SUMMARY = "SUMMARY",
4
4
  RECOVERY = "RECOVERY",
5
5
  TEST = "TEST",
6
- REPLAY = "REPLAY"
6
+ REPLAY = "REPLAY",
7
+ EVENT = "EVENT"
7
8
  }
@@ -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,wBAOX;AAPD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,yCAAa,CAAA;IAEb,6CAAiB,CAAA;AACnB,CAAC,EAPW,wBAAwB,wCAAxB,wBAAwB,QAOnC"}
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 { AlertRuleGroupBy } from '../../../enum';
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
- type AlertRuleDefinitionMembers = Pick<IMonitorAlertRule, 'name' | 'slug' | 'isEnabled' | 'applicationIds' | 'mode' | 'filter' | 'windowMinutes' | 'threshold' | 'groupBy' | 'severity'>;
10
- export type ICreateAlertRuleBody = Omit<AlertRuleDefinitionMembers, 'isEnabled' | 'groupBy'> & {
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 { AlertRuleGroupBy, AlertRuleMode, IncidentSeverity, LogLevel } from '../../enum';
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/monitor",
3
- "version": "6.5.0",
3
+ "version": "6.6.0",
4
4
  "description": "Core package to interact with Abyss-Monitor",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,7 @@
25
25
  "joi-to-swagger": "^6.2.0",
26
26
  "lodash": "^4.17.21",
27
27
  "node-os-utils": "^1.3.7",
28
+ "re2js": "^2.8.6",
28
29
  "reflect-metadata": "^0.1.13",
29
30
  "stack-trace": "^0.0.10",
30
31
  "systeminformation": "^5.17.13",