@meyicloud/meyi-insight-server 1.0.7 → 1.1.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/constants/incidentCategories.d.ts +38 -9
- package/dist/constants/incidentCategories.d.ts.map +1 -1
- package/dist/constants/incidentCategories.js +70 -10
- package/dist/constants/incidentCategories.js.map +1 -1
- package/dist/controllers/incident.controller.d.ts.map +1 -1
- package/dist/controllers/incident.controller.js +23 -3
- package/dist/controllers/incident.controller.js.map +1 -1
- package/dist/database/schema.d.ts +257 -18
- package/dist/database/schema.d.ts.map +1 -1
- package/dist/database/schema.js +36 -3
- package/dist/database/schema.js.map +1 -1
- package/dist/features/incident-priority/index.d.ts +3 -0
- package/dist/features/incident-priority/index.d.ts.map +1 -0
- package/dist/features/incident-priority/index.js +3 -0
- package/dist/features/incident-priority/index.js.map +1 -0
- package/dist/features/incident-priority/priority.rules.d.ts +15 -0
- package/dist/features/incident-priority/priority.rules.d.ts.map +1 -0
- package/dist/features/incident-priority/priority.rules.js +38 -0
- package/dist/features/incident-priority/priority.rules.js.map +1 -0
- package/dist/features/incident-priority/priority.types.d.ts +13 -0
- package/dist/features/incident-priority/priority.types.d.ts.map +1 -0
- package/dist/features/incident-priority/priority.types.js +7 -0
- package/dist/features/incident-priority/priority.types.js.map +1 -0
- package/dist/features/sla/domain/sla.defaults.d.ts +12 -0
- package/dist/features/sla/domain/sla.defaults.d.ts.map +1 -0
- package/dist/features/sla/domain/sla.defaults.js +30 -0
- package/dist/features/sla/domain/sla.defaults.js.map +1 -0
- package/dist/features/sla/domain/sla.evaluator.d.ts +22 -2
- package/dist/features/sla/domain/sla.evaluator.d.ts.map +1 -1
- package/dist/features/sla/domain/sla.evaluator.js +26 -3
- package/dist/features/sla/domain/sla.evaluator.js.map +1 -1
- package/dist/features/sla/domain/sla.resolver.d.ts +42 -10
- package/dist/features/sla/domain/sla.resolver.d.ts.map +1 -1
- package/dist/features/sla/domain/sla.resolver.js +109 -15
- package/dist/features/sla/domain/sla.resolver.js.map +1 -1
- package/dist/features/sla/domain/sla.types.d.ts +54 -8
- package/dist/features/sla/domain/sla.types.d.ts.map +1 -1
- package/dist/features/sla/domain/sla.types.js +1 -0
- package/dist/features/sla/domain/sla.types.js.map +1 -1
- package/dist/features/sla/index.d.ts +2 -1
- package/dist/features/sla/index.d.ts.map +1 -1
- package/dist/features/sla/index.js +1 -0
- package/dist/features/sla/index.js.map +1 -1
- package/dist/features/sla/sla-policy.model.d.ts +30 -10
- package/dist/features/sla/sla-policy.model.d.ts.map +1 -1
- package/dist/features/sla/sla-policy.model.js +64 -28
- package/dist/features/sla/sla-policy.model.js.map +1 -1
- package/dist/features/sla/sla-policy.service.d.ts +16 -13
- package/dist/features/sla/sla-policy.service.d.ts.map +1 -1
- package/dist/features/sla/sla-policy.service.js +65 -23
- package/dist/features/sla/sla-policy.service.js.map +1 -1
- package/dist/features/sla/sla.schema.d.ts +84 -2
- package/dist/features/sla/sla.schema.d.ts.map +1 -1
- package/dist/features/sla/sla.schema.js +25 -7
- package/dist/features/sla/sla.schema.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations/run.d.ts.map +1 -1
- package/dist/migrations/run.js +212 -5
- package/dist/migrations/run.js.map +1 -1
- package/dist/models/incident.model.d.ts +47 -2
- package/dist/models/incident.model.d.ts.map +1 -1
- package/dist/models/incident.model.js +127 -21
- package/dist/models/incident.model.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -1
- package/dist/server.js.map +1 -1
- package/dist/service.d.ts +28 -3
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +14 -2
- package/dist/service.js.map +1 -1
- package/dist/services/alert.service.d.ts.map +1 -1
- package/dist/services/alert.service.js +2 -0
- package/dist/services/alert.service.js.map +1 -1
- package/dist/services/incident.service.d.ts +50 -2
- package/dist/services/incident.service.d.ts.map +1 -1
- package/dist/services/incident.service.js +113 -17
- package/dist/services/incident.service.js.map +1 -1
- package/dist/services/retention.service.d.ts +63 -0
- package/dist/services/retention.service.d.ts.map +1 -0
- package/dist/services/retention.service.js +264 -0
- package/dist/services/retention.service.js.map +1 -0
- package/dist/services/workflow.service.d.ts.map +1 -1
- package/dist/services/workflow.service.js +2 -0
- package/dist/services/workflow.service.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DEFAULT_INCIDENT_PRIORITY, INCIDENT_PRIORITIES } from "./priority.types.js";
|
|
2
|
+
/** Accepts "P1".."P4" in any case, with surrounding spaces. Anything else is null. */
|
|
3
|
+
export function normalizePriority(raw) {
|
|
4
|
+
if (typeof raw !== "string")
|
|
5
|
+
return null;
|
|
6
|
+
const value = raw.trim().toUpperCase();
|
|
7
|
+
return INCIDENT_PRIORITIES.includes(value) ? value : null;
|
|
8
|
+
}
|
|
9
|
+
/** Alert severity to incident priority: critical P1, high P2, medium P3, low or info P4. */
|
|
10
|
+
export function priorityFromSeverity(raw) {
|
|
11
|
+
if (typeof raw !== "string")
|
|
12
|
+
return null;
|
|
13
|
+
switch (raw.trim().toLowerCase()) {
|
|
14
|
+
case "critical":
|
|
15
|
+
return "P1";
|
|
16
|
+
case "high":
|
|
17
|
+
return "P2";
|
|
18
|
+
case "medium":
|
|
19
|
+
return "P3";
|
|
20
|
+
case "low":
|
|
21
|
+
case "info":
|
|
22
|
+
return "P4";
|
|
23
|
+
default:
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The priority an incident gets when it is created: an explicit value wins, then a priority tag,
|
|
29
|
+
* then the alert severity (or a severity tag), then the default.
|
|
30
|
+
*/
|
|
31
|
+
export function derivePriority(input) {
|
|
32
|
+
return (normalizePriority(input.explicit) ??
|
|
33
|
+
normalizePriority(input.tags?.priority) ??
|
|
34
|
+
priorityFromSeverity(input.severity) ??
|
|
35
|
+
priorityFromSeverity(input.tags?.severity) ??
|
|
36
|
+
DEFAULT_INCIDENT_PRIORITY);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=priority.rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.rules.js","sourceRoot":"","sources":["../../../src/features/incident-priority/priority.rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAyB,MAAM,qBAAqB,CAAC;AAE5G,sFAAsF;AACtF,MAAM,UAAU,iBAAiB,CAAC,GAAY;IAC5C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,OAAQ,mBAAyC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAA0B,CAAC,CAAC,CAAC,IAAI,CAAC;AACzG,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QACjC,KAAK,UAAU;YACb,OAAO,IAAI,CAAC;QACd,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd,KAAK,KAAK,CAAC;QACX,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAI9B;IACC,OAAO,CACL,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC;QACjC,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC;QACvC,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,oBAAoB,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC;QAC1C,yBAAyB,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Incident priority, highest first. Stored on insight_incidents.priority. */
|
|
3
|
+
export declare const INCIDENT_PRIORITIES: readonly ["P1", "P2", "P3", "P4"];
|
|
4
|
+
export type IncidentPriority = (typeof INCIDENT_PRIORITIES)[number];
|
|
5
|
+
/** Used when nothing in the incident says otherwise. */
|
|
6
|
+
export declare const DEFAULT_INCIDENT_PRIORITY: IncidentPriority;
|
|
7
|
+
export declare const IncidentPrioritySchema: z.ZodEnum<{
|
|
8
|
+
P2: "P2";
|
|
9
|
+
P1: "P1";
|
|
10
|
+
P3: "P3";
|
|
11
|
+
P4: "P4";
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=priority.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.types.d.ts","sourceRoot":"","sources":["../../../src/features/incident-priority/priority.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,mCAAoC,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,EAAE,gBAAuB,CAAC;AAEhE,eAAO,MAAM,sBAAsB;;;;;EAA8B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Incident priority, highest first. Stored on insight_incidents.priority. */
|
|
3
|
+
export const INCIDENT_PRIORITIES = ["P1", "P2", "P3", "P4"];
|
|
4
|
+
/** Used when nothing in the incident says otherwise. */
|
|
5
|
+
export const DEFAULT_INCIDENT_PRIORITY = "P2";
|
|
6
|
+
export const IncidentPrioritySchema = z.enum(INCIDENT_PRIORITIES);
|
|
7
|
+
//# sourceMappingURL=priority.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.types.js","sourceRoot":"","sources":["../../../src/features/incident-priority/priority.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAIrE,wDAAwD;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAqB,IAAI,CAAC;AAEhE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SlaOverrides, SlaPreset, SlaTargets } from "./sla.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The standard SLA preset. It pre-fills the settings form, and it is the policy applied to accounts
|
|
4
|
+
* that are implicitly enabled (see SLA_DEFAULT_ON_AFTER). Saved policies keep their stored values.
|
|
5
|
+
* P4 resolve is best effort (null).
|
|
6
|
+
*/
|
|
7
|
+
export declare const STANDARD_SLA_TARGETS: Readonly<SlaTargets>;
|
|
8
|
+
export declare function standardTargets(): SlaTargets;
|
|
9
|
+
export declare function isStandardTargets(targets: SlaTargets): boolean;
|
|
10
|
+
/** "standard" only when the account default and every group override equal the standard preset. */
|
|
11
|
+
export declare function detectPreset(targets: SlaTargets, overrides?: SlaOverrides): SlaPreset;
|
|
12
|
+
//# sourceMappingURL=sla.defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sla.defaults.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAKpD,CAAC;AAEH,wBAAgB,eAAe,IAAI,UAAU,CAG5C;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAM9D;AAED,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,GAAE,YAAiB,GAAG,SAAS,CAGzF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { INCIDENT_PRIORITIES } from "../../incident-priority/priority.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The standard SLA preset. It pre-fills the settings form, and it is the policy applied to accounts
|
|
4
|
+
* that are implicitly enabled (see SLA_DEFAULT_ON_AFTER). Saved policies keep their stored values.
|
|
5
|
+
* P4 resolve is best effort (null).
|
|
6
|
+
*/
|
|
7
|
+
export const STANDARD_SLA_TARGETS = Object.freeze({
|
|
8
|
+
P1: Object.freeze({ ackMinutes: 10, resolveMinutes: 60 }),
|
|
9
|
+
P2: Object.freeze({ ackMinutes: 30, resolveMinutes: 240 }),
|
|
10
|
+
P3: Object.freeze({ ackMinutes: 360, resolveMinutes: 5_760 }),
|
|
11
|
+
P4: Object.freeze({ ackMinutes: 2_880, resolveMinutes: null }),
|
|
12
|
+
});
|
|
13
|
+
export function standardTargets() {
|
|
14
|
+
const t = STANDARD_SLA_TARGETS;
|
|
15
|
+
return { P1: { ...t.P1 }, P2: { ...t.P2 }, P3: { ...t.P3 }, P4: { ...t.P4 } };
|
|
16
|
+
}
|
|
17
|
+
export function isStandardTargets(targets) {
|
|
18
|
+
return INCIDENT_PRIORITIES.every((p) => {
|
|
19
|
+
const a = targets[p];
|
|
20
|
+
const b = STANDARD_SLA_TARGETS[p];
|
|
21
|
+
return !!a && a.ackMinutes === b.ackMinutes && (a.resolveMinutes ?? null) === b.resolveMinutes;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** "standard" only when the account default and every group override equal the standard preset. */
|
|
25
|
+
export function detectPreset(targets, overrides = {}) {
|
|
26
|
+
if (!isStandardTargets(targets))
|
|
27
|
+
return "custom";
|
|
28
|
+
return Object.values(overrides).every((o) => !o || isStandardTargets(o)) ? "standard" : "custom";
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=sla.defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sla.defaults.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyB,MAAM,CAAC,MAAM,CAAC;IACtE,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;IAC1D,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IAC7D,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,UAAU,eAAe;IAC7B,MAAM,CAAC,GAAG,oBAAoB,CAAC;IAC/B,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAmB;IACnD,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;IACjG,CAAC,CAAC,CAAC;AACL,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,YAAY,CAAC,OAAmB,EAAE,YAA0B,EAAE;IAC5E,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QAAE,OAAO,QAAQ,CAAC;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnG,CAAC"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import type { SlaEvaluation, SlaIncidentInput, SlaPolicy, SlaPolicyResolver } from "./sla.types.js";
|
|
1
|
+
import type { SlaEvaluation, SlaIncidentInput, SlaPhase, SlaPolicy, SlaPolicyResolver } from "./sla.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Evaluates one phase (acknowledge or resolve). A null limit is "best effort": it reports elapsed
|
|
4
|
+
* time but is never overdue or late, so it never breaches.
|
|
5
|
+
*/
|
|
6
|
+
export declare function evaluatePhase(opts: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
limitMinutes: number | null;
|
|
9
|
+
done: boolean;
|
|
10
|
+
createdMs: number | null;
|
|
11
|
+
endMs: number | null;
|
|
12
|
+
nowMs: number;
|
|
13
|
+
}): SlaPhase;
|
|
2
14
|
/** Pure: evaluates one incident against one policy. No I/O, no clock access beyond `now`. */
|
|
3
15
|
export declare function evaluateIncidentSla(incident: SlaIncidentInput, policy: SlaPolicy, now?: Date): SlaEvaluation;
|
|
4
16
|
/** True while an unresolved incident is currently past an SLA limit. */
|
|
5
17
|
export declare function isBreachingNow(evaluation: SlaEvaluation, status: string): boolean;
|
|
6
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* True when the incident is measured against at least one SLA limit. Disabled policies and
|
|
20
|
+
* best-effort phases do not count, so the UI can hide SLA stats when nothing is tracked.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isSlaTracked(evaluation: SlaEvaluation): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates a raw incident row, resolving the policy for its account, group (from `source`) and
|
|
25
|
+
* priority. Ack time keeps the historic definition.
|
|
26
|
+
*/
|
|
7
27
|
export declare function evaluateIncidentRow(row: any, resolve: SlaPolicyResolver, now?: Date): SlaEvaluation;
|
|
8
28
|
//# sourceMappingURL=sla.evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.evaluator.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sla.evaluator.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.evaluator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAW9G;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,QAAQ,CA4BX;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAE,IAAiB,GAAG,aAAa,CAyBxH;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGjF;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAE/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,GAAG,GAAE,IAAiB,GAAG,aAAa,CAe/G"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { DEFAULT_INCIDENT_PRIORITY } from "../../incident-priority/priority.types.js";
|
|
2
|
+
import { normalizePriority } from "../../incident-priority/priority.rules.js";
|
|
3
|
+
import { incidentGroupForSource } from "../../../constants/incidentCategories.js";
|
|
1
4
|
const toMs = (v) => {
|
|
2
5
|
if (!v)
|
|
3
6
|
return null;
|
|
@@ -5,10 +8,18 @@ const toMs = (v) => {
|
|
|
5
8
|
return Number.isNaN(t) ? null : t;
|
|
6
9
|
};
|
|
7
10
|
const minutesBetween = (fromMs, toMsValue) => fromMs == null || toMsValue == null ? null : Math.max(0, Math.floor((toMsValue - fromMs) / 60_000));
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Evaluates one phase (acknowledge or resolve). A null limit is "best effort": it reports elapsed
|
|
13
|
+
* time but is never overdue or late, so it never breaches.
|
|
14
|
+
*/
|
|
15
|
+
export function evaluatePhase(opts) {
|
|
9
16
|
const { enabled, limitMinutes, done, createdMs, endMs, nowMs } = opts;
|
|
10
17
|
if (!enabled)
|
|
11
18
|
return { state: "disabled", limitMinutes, elapsedMinutes: null, remainingMinutes: null };
|
|
19
|
+
if (limitMinutes == null) {
|
|
20
|
+
const elapsed = done ? minutesBetween(createdMs, endMs) : minutesBetween(createdMs, nowMs);
|
|
21
|
+
return { state: "best_effort", limitMinutes: null, elapsedMinutes: elapsed, remainingMinutes: null };
|
|
22
|
+
}
|
|
12
23
|
if (done) {
|
|
13
24
|
const elapsed = minutesBetween(createdMs, endMs);
|
|
14
25
|
if (elapsed == null)
|
|
@@ -60,13 +71,25 @@ export function isBreachingNow(evaluation, status) {
|
|
|
60
71
|
return false;
|
|
61
72
|
return evaluation.ack.state === "overdue" || evaluation.resolve.state === "overdue";
|
|
62
73
|
}
|
|
63
|
-
/**
|
|
74
|
+
/** A phase is measured when it has a real limit (not disabled, not best effort). */
|
|
75
|
+
const isMeasured = (p) => p.state !== "disabled" && p.state !== "best_effort";
|
|
76
|
+
/**
|
|
77
|
+
* True when the incident is measured against at least one SLA limit. Disabled policies and
|
|
78
|
+
* best-effort phases do not count, so the UI can hide SLA stats when nothing is tracked.
|
|
79
|
+
*/
|
|
80
|
+
export function isSlaTracked(evaluation) {
|
|
81
|
+
return evaluation.policy.enabled && (isMeasured(evaluation.ack) || isMeasured(evaluation.resolve));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Evaluates a raw incident row, resolving the policy for its account, group (from `source`) and
|
|
85
|
+
* priority. Ack time keeps the historic definition.
|
|
86
|
+
*/
|
|
64
87
|
export function evaluateIncidentRow(row, resolve, now = new Date()) {
|
|
65
88
|
return evaluateIncidentSla({
|
|
66
89
|
status: row.status,
|
|
67
90
|
createdAt: row.createdAt,
|
|
68
91
|
ackedAt: row.analysisTriggeredAt ?? row.updatedAt,
|
|
69
92
|
resolvedAt: row.resolvedAt,
|
|
70
|
-
}, resolve(row.accountId), now);
|
|
93
|
+
}, resolve(row.accountId, normalizePriority(row.priority) ?? DEFAULT_INCIDENT_PRIORITY, incidentGroupForSource(row.source)), now);
|
|
71
94
|
}
|
|
72
95
|
//# sourceMappingURL=sla.evaluator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.evaluator.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.evaluator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sla.evaluator.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAGlF,MAAM,IAAI,GAAG,CAAC,CAAmC,EAAiB,EAAE;IAClE,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,MAAqB,EAAE,SAAwB,EAAiB,EAAE,CACxF,MAAM,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAEtG;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAO7B;IACC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACtE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,KAAK,E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,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AACtF,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,GAAG,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC;AAExF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,UAAyB;IACpD,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAQ,EAAE,OAA0B,EAAE,MAAY,IAAI,IAAI,EAAE;IAC9F,OAAO,mBAAmB,CACxB;QACE,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,OAAO,EAAE,GAAG,CAAC,mBAAmB,IAAI,GAAG,CAAC,SAAS;QACjD,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,EACD,OAAO,CACL,GAAG,CAAC,SAAS,EACb,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,yBAAyB,EAC5D,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CACnC,EACD,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type IncidentPriority } from "../../incident-priority/priority.types.js";
|
|
2
|
+
import { type IncidentGroup } from "../../../constants/incidentCategories.js";
|
|
3
|
+
import type { AccountSlaConfig, SlaOverrides, SlaPolicy, SlaPolicyRecord, SlaPolicyResolver, SlaTargetRecord, SlaTargets } from "./sla.types.js";
|
|
4
|
+
/** Options that change what "no saved policy" means. */
|
|
5
|
+
export interface SlaResolverOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Accounts whose connector was created at or after this instant are implicitly enabled with the
|
|
8
|
+
* standard preset for every group when they have no saved policy. Null/undefined = never.
|
|
9
|
+
*/
|
|
10
|
+
defaultOnAfter?: Date | null;
|
|
11
|
+
/** Connector created_at per account id; only consulted when `defaultOnAfter` is set. */
|
|
12
|
+
connectorCreatedAt?: Map<string, Date | string | null | undefined>;
|
|
13
|
+
}
|
|
2
14
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
15
|
+
* Parses SLA_DEFAULT_ON_AFTER (an ISO date). Unset, empty or invalid = null (never implicitly enabled),
|
|
16
|
+
* which keeps the pre-1.1.0 behaviour: SLA off until a policy is saved.
|
|
5
17
|
*/
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
18
|
+
export declare function parseDefaultOnAfter(raw: string | null | undefined): Date | null;
|
|
19
|
+
/** True when an account with no saved policy is implicitly on (connector created on/after the cutoff). */
|
|
20
|
+
export declare function isImplicitlyEnabled(createdAt: Date | string | null | undefined, defaultOnAfter: Date | null | undefined): boolean;
|
|
21
|
+
/** The policy for an account with no saved row: disabled, or the standard preset when implicitly enabled. */
|
|
22
|
+
export declare function defaultSlaPolicy(priority: IncidentPriority, group?: IncidentGroup, enabled?: boolean): SlaPolicy;
|
|
23
|
+
/** Normalises stored applies_to; missing (pre-1.1.0) = every group. Unknown values are ignored. */
|
|
24
|
+
export declare function appliesToFromRecord(policy: SlaPolicyRecord | null | undefined): IncidentGroup[];
|
|
25
|
+
/** Fills any priority missing from storage with its standard limits, so callers always get all four. */
|
|
26
|
+
export declare function targetsFromRecords(records: SlaTargetRecord[]): SlaTargets;
|
|
27
|
+
/** Splits stored rows into the account default and per-group overrides. */
|
|
28
|
+
export declare function splitTargetRecords(records: SlaTargetRecord[]): {
|
|
29
|
+
targets: SlaTargets;
|
|
30
|
+
overrides: SlaOverrides;
|
|
9
31
|
};
|
|
10
|
-
|
|
11
|
-
export declare function
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
/** Builds the API view of one account; with no policy row it is the default (disabled unless implicitly on). */
|
|
33
|
+
export declare function accountConfigFromRecords(accountId: string, policy: SlaPolicyRecord | null, targetRecords: SlaTargetRecord[], opts?: {
|
|
34
|
+
implicitlyEnabled?: boolean;
|
|
35
|
+
}): AccountSlaConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Builds a resolver over the tenant's account policies and their limits. Precedence for an incident
|
|
38
|
+
* (account, group, priority):
|
|
39
|
+
* 1. no policy row → disabled, unless the connector is implicitly enabled (standard preset, all groups);
|
|
40
|
+
* 2. policy disabled → disabled;
|
|
41
|
+
* 3. group not in applies_to → disabled;
|
|
42
|
+
* 4. the group's override row for the priority;
|
|
43
|
+
* 5. the account default row for the priority (standard preset if missing).
|
|
44
|
+
*/
|
|
45
|
+
export declare function createSlaResolver(policies: SlaPolicyRecord[], targets: SlaTargetRecord[], opts?: SlaResolverOptions): SlaPolicyResolver;
|
|
14
46
|
//# sourceMappingURL=sla.resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.resolver.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sla.resolver.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACvG,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEhH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,gBAAgB,CAAC;AAExB,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,GAAG,CAAC,MA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
+
import { INCIDENT_PRIORITIES } from "../../incident-priority/priority.types.js";
|
|
2
|
+
import { INCIDENT_GROUPS, isIncidentGroup } from "../../../constants/incidentCategories.js";
|
|
3
|
+
import { STANDARD_SLA_TARGETS, detectPreset, standardTargets } from "./sla.defaults.js";
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
5
|
+
* Parses SLA_DEFAULT_ON_AFTER (an ISO date). Unset, empty or invalid = null (never implicitly enabled),
|
|
6
|
+
* which keeps the pre-1.1.0 behaviour: SLA off until a policy is saved.
|
|
4
7
|
*/
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
export function parseDefaultOnAfter(raw) {
|
|
9
|
+
if (!raw || !raw.trim())
|
|
10
|
+
return null;
|
|
11
|
+
const t = Date.parse(raw.trim());
|
|
12
|
+
return Number.isNaN(t) ? null : new Date(t);
|
|
8
13
|
}
|
|
9
|
-
|
|
14
|
+
/** True when an account with no saved policy is implicitly on (connector created on/after the cutoff). */
|
|
15
|
+
export function isImplicitlyEnabled(createdAt, defaultOnAfter) {
|
|
16
|
+
if (!defaultOnAfter || !createdAt)
|
|
17
|
+
return false;
|
|
18
|
+
const t = new Date(createdAt).getTime();
|
|
19
|
+
return !Number.isNaN(t) && t >= defaultOnAfter.getTime();
|
|
20
|
+
}
|
|
21
|
+
/** The policy for an account with no saved row: disabled, or the standard preset when implicitly enabled. */
|
|
22
|
+
export function defaultSlaPolicy(priority, group, enabled = false) {
|
|
23
|
+
return { enabled, priority, ...STANDARD_SLA_TARGETS[priority], source: "default", group };
|
|
24
|
+
}
|
|
25
|
+
const recordGroup = (r) => r.incidentGroup || "default";
|
|
26
|
+
/** Normalises stored applies_to; missing (pre-1.1.0) = every group. Unknown values are ignored. */
|
|
27
|
+
export function appliesToFromRecord(policy) {
|
|
28
|
+
const raw = policy?.appliesTo;
|
|
29
|
+
if (!Array.isArray(raw))
|
|
30
|
+
return [...INCIDENT_GROUPS];
|
|
31
|
+
return INCIDENT_GROUPS.filter((g) => raw.includes(g));
|
|
32
|
+
}
|
|
33
|
+
/** Fills any priority missing from storage with its standard limits, so callers always get all four. */
|
|
34
|
+
export function targetsFromRecords(records) {
|
|
35
|
+
const targets = standardTargets();
|
|
36
|
+
for (const r of records) {
|
|
37
|
+
if (INCIDENT_PRIORITIES.includes(r.priority)) {
|
|
38
|
+
targets[r.priority] = { ackMinutes: r.ackMinutes, resolveMinutes: r.resolveMinutes ?? null };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return targets;
|
|
42
|
+
}
|
|
43
|
+
/** Splits stored rows into the account default and per-group overrides. */
|
|
44
|
+
export function splitTargetRecords(records) {
|
|
45
|
+
const defaults = records.filter((r) => recordGroup(r) === "default");
|
|
46
|
+
const overrides = {};
|
|
47
|
+
for (const group of INCIDENT_GROUPS) {
|
|
48
|
+
const rows = records.filter((r) => recordGroup(r) === group);
|
|
49
|
+
if (rows.length)
|
|
50
|
+
overrides[group] = targetsFromRecords(rows);
|
|
51
|
+
}
|
|
52
|
+
return { targets: targetsFromRecords(defaults), overrides };
|
|
53
|
+
}
|
|
54
|
+
/** Builds the API view of one account; with no policy row it is the default (disabled unless implicitly on). */
|
|
55
|
+
export function accountConfigFromRecords(accountId, policy, targetRecords, opts = {}) {
|
|
56
|
+
if (!policy) {
|
|
57
|
+
return {
|
|
58
|
+
accountId,
|
|
59
|
+
enabled: opts.implicitlyEnabled === true,
|
|
60
|
+
source: "default",
|
|
61
|
+
preset: "standard",
|
|
62
|
+
appliesTo: [...INCIDENT_GROUPS],
|
|
63
|
+
targets: standardTargets(),
|
|
64
|
+
overrides: {},
|
|
65
|
+
updatedBy: null,
|
|
66
|
+
updatedAt: null,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const { targets, overrides } = splitTargetRecords(targetRecords);
|
|
10
70
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
resolveMinutes: record.resolveMinutes,
|
|
71
|
+
accountId,
|
|
72
|
+
enabled: policy.enabled,
|
|
14
73
|
source: "account",
|
|
74
|
+
preset: detectPreset(targets, overrides),
|
|
75
|
+
appliesTo: appliesToFromRecord(policy),
|
|
76
|
+
targets,
|
|
77
|
+
overrides,
|
|
78
|
+
updatedBy: policy.updatedBy,
|
|
79
|
+
updatedAt: policy.updatedAt,
|
|
15
80
|
};
|
|
16
81
|
}
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Builds a resolver over the tenant's account policies and their limits. Precedence for an incident
|
|
84
|
+
* (account, group, priority):
|
|
85
|
+
* 1. no policy row → disabled, unless the connector is implicitly enabled (standard preset, all groups);
|
|
86
|
+
* 2. policy disabled → disabled;
|
|
87
|
+
* 3. group not in applies_to → disabled;
|
|
88
|
+
* 4. the group's override row for the priority;
|
|
89
|
+
* 5. the account default row for the priority (standard preset if missing).
|
|
90
|
+
*/
|
|
91
|
+
export function createSlaResolver(policies, targets, opts = {}) {
|
|
92
|
+
const policyByAccount = new Map(policies.map((p) => [p.accountId, p]));
|
|
93
|
+
// accountId -> group -> priority -> record
|
|
94
|
+
const index = new Map();
|
|
95
|
+
for (const t of targets) {
|
|
96
|
+
const byGroup = index.get(t.accountId) ?? new Map();
|
|
97
|
+
const g = recordGroup(t);
|
|
98
|
+
const byPriority = byGroup.get(g) ?? new Map();
|
|
99
|
+
byPriority.set(t.priority, t);
|
|
100
|
+
byGroup.set(g, byPriority);
|
|
101
|
+
index.set(t.accountId, byGroup);
|
|
102
|
+
}
|
|
103
|
+
return (accountId, priority, group = "operations") => {
|
|
104
|
+
const effectiveGroup = isIncidentGroup(group) ? group : "operations";
|
|
105
|
+
const policy = accountId ? policyByAccount.get(accountId) : undefined;
|
|
106
|
+
if (!accountId || !policy) {
|
|
107
|
+
const implicit = !!accountId && isImplicitlyEnabled(opts.connectorCreatedAt?.get(accountId), opts.defaultOnAfter ?? null);
|
|
108
|
+
return defaultSlaPolicy(priority, effectiveGroup, implicit);
|
|
109
|
+
}
|
|
110
|
+
const byGroup = index.get(accountId);
|
|
111
|
+
const record = byGroup?.get(effectiveGroup)?.get(priority) ?? byGroup?.get("default")?.get(priority);
|
|
112
|
+
const limits = record
|
|
113
|
+
? { ackMinutes: record.ackMinutes, resolveMinutes: record.resolveMinutes ?? null }
|
|
114
|
+
: { ...STANDARD_SLA_TARGETS[priority] };
|
|
115
|
+
const applies = appliesToFromRecord(policy).includes(effectiveGroup);
|
|
116
|
+
return { enabled: policy.enabled && applies, priority, ...limits, source: "account", group: effectiveGroup };
|
|
23
117
|
};
|
|
24
118
|
}
|
|
25
119
|
//# sourceMappingURL=sla.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.resolver.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sla.resolver.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAyB,MAAM,2CAA2C,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,eAAe,EAAsB,MAAM,0CAA0C,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAsBxF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAA8B;IAChE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,0GAA0G;AAC1G,MA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,CAAC"}
|
|
@@ -1,25 +1,68 @@
|
|
|
1
|
+
import type { IncidentPriority } from "../../incident-priority/priority.types.js";
|
|
2
|
+
import type { IncidentGroup } from "../../../constants/incidentCategories.js";
|
|
1
3
|
/** Where an effective SLA policy came from. */
|
|
2
4
|
export type SlaPolicySource = "account" | "default";
|
|
5
|
+
/** Which target rows a stored limit belongs to: the account default, or one incident group's override. */
|
|
6
|
+
export type SlaTargetGroup = "default" | IncidentGroup;
|
|
7
|
+
export declare const SLA_TARGET_GROUPS: readonly SlaTargetGroup[];
|
|
8
|
+
/** "standard" when every stored value equals the standard preset; otherwise "custom". */
|
|
9
|
+
export type SlaPreset = "standard" | "custom";
|
|
10
|
+
/** Acknowledge and resolve limits for one priority. A null resolve limit means "best effort". */
|
|
11
|
+
export interface SlaTarget {
|
|
12
|
+
ackMinutes: number;
|
|
13
|
+
resolveMinutes: number | null;
|
|
14
|
+
}
|
|
15
|
+
/** Limits for every priority; an enabled account always has all four. */
|
|
16
|
+
export type SlaTargets = Record<IncidentPriority, SlaTarget>;
|
|
17
|
+
/** Per-group overrides of the account default. Only groups with their own values appear. */
|
|
18
|
+
export type SlaOverrides = Partial<Record<IncidentGroup, SlaTargets>>;
|
|
19
|
+
/** The policy that applies to one incident: its account's settings resolved for the incident's group and priority. */
|
|
3
20
|
export interface SlaPolicy {
|
|
4
21
|
enabled: boolean;
|
|
22
|
+
priority: IncidentPriority;
|
|
5
23
|
ackMinutes: number;
|
|
6
|
-
resolveMinutes: number;
|
|
24
|
+
resolveMinutes: number | null;
|
|
7
25
|
source: SlaPolicySource;
|
|
26
|
+
/** The incident group the policy was resolved for. */
|
|
27
|
+
group?: IncidentGroup;
|
|
8
28
|
}
|
|
9
|
-
/** Persisted
|
|
29
|
+
/** Persisted account-level switch (one row per tenant + AWS account). */
|
|
10
30
|
export interface SlaPolicyRecord {
|
|
11
31
|
tenantId: string;
|
|
12
32
|
accountId: string;
|
|
13
33
|
enabled: boolean;
|
|
34
|
+
/** Groups the account SLA applies to. Missing (pre-1.1.0 rows) = all groups. */
|
|
35
|
+
appliesTo?: string[] | null;
|
|
36
|
+
updatedBy: string | null;
|
|
37
|
+
updatedAt: Date | string | null;
|
|
38
|
+
}
|
|
39
|
+
/** Persisted limits for one priority of one account, for the default or one group override. */
|
|
40
|
+
export interface SlaTargetRecord {
|
|
41
|
+
tenantId: string;
|
|
42
|
+
accountId: string;
|
|
43
|
+
/** Missing (pre-1.1.0 rows) = "default". */
|
|
44
|
+
incidentGroup?: SlaTargetGroup | string | null;
|
|
45
|
+
priority: IncidentPriority;
|
|
14
46
|
ackMinutes: number;
|
|
15
|
-
resolveMinutes: number;
|
|
47
|
+
resolveMinutes: number | null;
|
|
48
|
+
}
|
|
49
|
+
/** An account's whole SLA configuration, as the API presents it. */
|
|
50
|
+
export interface AccountSlaConfig {
|
|
51
|
+
accountId: string;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
source: SlaPolicySource;
|
|
54
|
+
preset: SlaPreset;
|
|
55
|
+
appliesTo: IncidentGroup[];
|
|
56
|
+
targets: SlaTargets;
|
|
57
|
+
overrides: SlaOverrides;
|
|
16
58
|
updatedBy: string | null;
|
|
17
59
|
updatedAt: Date | string | null;
|
|
18
60
|
}
|
|
19
|
-
export type SlaPhaseState = "met" | "met_late" | "pending" | "overdue" | "disabled";
|
|
61
|
+
export type SlaPhaseState = "met" | "met_late" | "pending" | "overdue" | "disabled" | "best_effort";
|
|
20
62
|
export interface SlaPhase {
|
|
21
63
|
state: SlaPhaseState;
|
|
22
|
-
|
|
64
|
+
/** Null when the phase has no limit (best effort). */
|
|
65
|
+
limitMinutes: number | null;
|
|
23
66
|
/** Minutes from creation until the phase completed (or until now while pending). */
|
|
24
67
|
elapsedMinutes: number | null;
|
|
25
68
|
/** Minutes left while pending; negative once overdue. Null when not pending. */
|
|
@@ -29,7 +72,7 @@ export interface SlaEvaluation {
|
|
|
29
72
|
policy: SlaPolicy;
|
|
30
73
|
ack: SlaPhase;
|
|
31
74
|
resolve: SlaPhase;
|
|
32
|
-
/** True when either phase is overdue or was completed late. */
|
|
75
|
+
/** True when either phase is overdue or was completed late. Best-effort phases never breach. */
|
|
33
76
|
breached: boolean;
|
|
34
77
|
}
|
|
35
78
|
/** Minimal incident shape the evaluator needs. */
|
|
@@ -40,8 +83,11 @@ export interface SlaIncidentInput {
|
|
|
40
83
|
ackedAt?: Date | string | null;
|
|
41
84
|
resolvedAt?: Date | string | null;
|
|
42
85
|
}
|
|
43
|
-
/**
|
|
44
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Resolves the effective policy for an incident's account, priority and group. Built once per request.
|
|
88
|
+
* `group` defaults to "operations" for callers that predate incident groups.
|
|
89
|
+
*/
|
|
90
|
+
export type SlaPolicyResolver = (accountId: string | null | undefined, priority: IncidentPriority, group?: IncidentGroup) => SlaPolicy;
|
|
45
91
|
/**
|
|
46
92
|
* Port used by incident code so it doesn't depend on persistence details.
|
|
47
93
|
* `tenantId` undefined yields a resolver that only returns defaults.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.types.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.types.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sla.types.d.ts","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE9E,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpD,0GAA0G;AAC1G,MAAM,MA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AAG,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,CAAC,EAAE,aAAa,KAClB,SAAS,CAAC;AAEf;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC7D;AAED,eAAO,MAAM,UAAU;;IAErB,eAAe;;CAEP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sla.types.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sla.types.js","sourceRoot":"","sources":["../../../../src/features/sla/domain/sla.types.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,iBAAiB,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC,CAAC;AA8GlI,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,EAAE,CAAC;IACb,eAAe;IACf,UAAU,EAAE,MAAM;CACV,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./domain/sla.types.js";
|
|
2
|
+
export * from "./domain/sla.defaults.js";
|
|
2
3
|
export * from "./domain/sla.resolver.js";
|
|
3
4
|
export * from "./domain/sla.evaluator.js";
|
|
4
5
|
export { SlaPolicyModel } from "./sla-policy.model.js";
|
|
5
|
-
export { SlaPolicyService, SlaError
|
|
6
|
+
export { SlaPolicyService, SlaError } from "./sla-policy.service.js";
|
|
6
7
|
export { createSlaRouter } from "./sla.routes.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/sla/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/sla/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/sla/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/sla/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"}
|