clarion-shared-types 1.0.116 → 1.0.117
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/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-enums.js +4 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-enums.js.map +1 -1
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-display.util.js +4 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-display.util.js.map +1 -1
- package/dist/cjs/modules/incident/enums/incident-actions.enum.js +4 -0
- package/dist/cjs/modules/incident/enums/incident-actions.enum.js.map +1 -1
- package/dist/cjs/modules/incident-sla/enums/incident-sla-enums.js +225 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-enums.js.map +1 -0
- package/dist/cjs/modules/incident-sla/index.js +23 -0
- package/dist/cjs/modules/incident-sla/index.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-display.util.js +250 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-display.util.js.map +1 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +8 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-enums.js +4 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-enums.js.map +1 -1
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-display.util.js +4 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-display.util.js.map +1 -1
- package/dist/esm/modules/incident/enums/incident-actions.enum.js +4 -0
- package/dist/esm/modules/incident/enums/incident-actions.enum.js.map +1 -1
- package/dist/esm/modules/incident-sla/enums/incident-sla-enums.js +222 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-enums.js.map +1 -0
- package/dist/esm/modules/incident-sla/index.js +7 -0
- package/dist/esm/modules/incident-sla/index.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-display.util.js +239 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-display.util.js.map +1 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +8 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-enums.d.ts +6 -2
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch.dto.d.ts +4 -0
- package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-enums.d.ts +196 -0
- package/dist/types/modules/incident-sla/index.d.ts +3 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla.dto.d.ts +286 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-display.util.d.ts +38 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +6 -0
- package/dist/types/modules/permission/enums/permissions-moudule.enum.d.ts +2 -1
- package/package.json +45 -45
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** The milestones an emergency is measured against, each with its own clock. */
|
|
2
|
+
export declare enum IncidentSlaStage {
|
|
3
|
+
ACKNOWLEDGEMENT = "ACKNOWLEDGEMENT",
|
|
4
|
+
TRIAGE = "TRIAGE",
|
|
5
|
+
DISPATCH = "DISPATCH",
|
|
6
|
+
RESPONSE_UNIT_ACCEPTANCE = "RESPONSE_UNIT_ACCEPTANCE",
|
|
7
|
+
MOBILIZATION = "MOBILIZATION",
|
|
8
|
+
ARRIVAL = "ARRIVAL",
|
|
9
|
+
INITIAL_ASSESSMENT = "INITIAL_ASSESSMENT",
|
|
10
|
+
RESOLUTION = "RESOLUTION",
|
|
11
|
+
CLOSURE = "CLOSURE"
|
|
12
|
+
}
|
|
13
|
+
/** Where one SLA instance stands. BREACHED is permanent; an exception only changes how it counts. */
|
|
14
|
+
export declare enum IncidentSlaStatus {
|
|
15
|
+
NOT_STARTED = "NOT_STARTED",
|
|
16
|
+
RUNNING = "RUNNING",
|
|
17
|
+
WARNING = "WARNING",
|
|
18
|
+
AT_RISK = "AT_RISK",
|
|
19
|
+
PAUSED = "PAUSED",
|
|
20
|
+
BREACHED = "BREACHED",
|
|
21
|
+
MET = "MET",
|
|
22
|
+
WAIVED = "WAIVED",
|
|
23
|
+
CANCELLED = "CANCELLED",
|
|
24
|
+
EXPIRED = "EXPIRED"
|
|
25
|
+
}
|
|
26
|
+
/** The response's milestones (not the incident's status, which is unchanged). */
|
|
27
|
+
export declare enum EmergencyIncidentStage {
|
|
28
|
+
INCIDENT_CREATED = "INCIDENT_CREATED",
|
|
29
|
+
ACKNOWLEDGED = "ACKNOWLEDGED",
|
|
30
|
+
TRIAGED = "TRIAGED",
|
|
31
|
+
DISPATCH_INITIATED = "DISPATCH_INITIATED",
|
|
32
|
+
RESPONSE_UNIT_ASSIGNED = "RESPONSE_UNIT_ASSIGNED",
|
|
33
|
+
RESPONSE_UNIT_ACCEPTED = "RESPONSE_UNIT_ACCEPTED",
|
|
34
|
+
EN_ROUTE = "EN_ROUTE",
|
|
35
|
+
ON_SCENE = "ON_SCENE",
|
|
36
|
+
STABILIZING = "STABILIZING",
|
|
37
|
+
RESOLVED = "RESOLVED",
|
|
38
|
+
CLOSED = "CLOSED"
|
|
39
|
+
}
|
|
40
|
+
export declare enum IncidentSlaEventType {
|
|
41
|
+
SLA_STARTED = "SLA_STARTED",
|
|
42
|
+
SLA_WARNING = "SLA_WARNING",
|
|
43
|
+
SLA_AT_RISK = "SLA_AT_RISK",
|
|
44
|
+
SLA_BREACHED = "SLA_BREACHED",
|
|
45
|
+
SLA_MET = "SLA_MET",
|
|
46
|
+
SLA_COMPLETED_LATE = "SLA_COMPLETED_LATE",
|
|
47
|
+
SLA_CANCELLED = "SLA_CANCELLED",
|
|
48
|
+
SLA_EXPIRED = "SLA_EXPIRED",
|
|
49
|
+
SLA_WAIVED = "SLA_WAIVED",
|
|
50
|
+
SLA_PAUSE_REQUESTED = "SLA_PAUSE_REQUESTED",
|
|
51
|
+
SLA_PAUSE_REJECTED = "SLA_PAUSE_REJECTED",
|
|
52
|
+
SLA_PAUSED = "SLA_PAUSED",
|
|
53
|
+
SLA_RESUMED = "SLA_RESUMED",
|
|
54
|
+
SLA_EXCEPTION_REQUESTED = "SLA_EXCEPTION_REQUESTED",
|
|
55
|
+
SLA_EXCEPTION_APPROVED = "SLA_EXCEPTION_APPROVED",
|
|
56
|
+
SLA_EXCEPTION_REJECTED = "SLA_EXCEPTION_REJECTED",
|
|
57
|
+
MILESTONE_RECORDED = "MILESTONE_RECORDED",
|
|
58
|
+
PRIORITY_TRIAGED = "PRIORITY_TRIAGED",
|
|
59
|
+
ETA_CHANGED = "ETA_CHANGED",
|
|
60
|
+
ARRIVAL_INFERRED = "ARRIVAL_INFERRED",
|
|
61
|
+
ARRIVAL_CONFIRMED = "ARRIVAL_CONFIRMED",
|
|
62
|
+
UNIT_RECOMMENDED = "UNIT_RECOMMENDED",
|
|
63
|
+
UNIT_REASSIGNED = "UNIT_REASSIGNED",
|
|
64
|
+
ESCALATED = "ESCALATED",
|
|
65
|
+
NOTIFICATION_SENT = "NOTIFICATION_SENT",
|
|
66
|
+
NOTIFICATION_FAILED = "NOTIFICATION_FAILED",
|
|
67
|
+
AUTO_CLOSE_DEFERRED = "AUTO_CLOSE_DEFERRED",
|
|
68
|
+
INCIDENT_AUTO_CLOSED = "INCIDENT_AUTO_CLOSED",
|
|
69
|
+
INCIDENT_CLOSED = "INCIDENT_CLOSED"
|
|
70
|
+
}
|
|
71
|
+
export declare enum IncidentActorType {
|
|
72
|
+
CONTROL_CENTRE = "CONTROL_CENTRE",
|
|
73
|
+
RESPONDER = "RESPONDER",
|
|
74
|
+
SYSTEM = "SYSTEM",
|
|
75
|
+
TRACKING = "TRACKING",
|
|
76
|
+
REPORTER = "REPORTER",
|
|
77
|
+
PARTNER = "PARTNER"
|
|
78
|
+
}
|
|
79
|
+
export declare enum IncidentSlaEventSource {
|
|
80
|
+
CONTROL_ROOM = "CONTROL_ROOM",
|
|
81
|
+
RESPONDER_APP = "RESPONDER_APP",
|
|
82
|
+
WORKFLOW = "WORKFLOW",
|
|
83
|
+
TRACKING = "TRACKING",
|
|
84
|
+
INCIDENT_LIFECYCLE = "INCIDENT_LIFECYCLE",
|
|
85
|
+
DISPATCH = "DISPATCH",
|
|
86
|
+
PARTNER = "PARTNER",
|
|
87
|
+
NOTIFICATION = "NOTIFICATION",
|
|
88
|
+
SYSTEM = "SYSTEM"
|
|
89
|
+
}
|
|
90
|
+
export declare enum SlaEscalationLevel {
|
|
91
|
+
DISPATCHER = "DISPATCHER",
|
|
92
|
+
SUPERVISOR = "SUPERVISOR",
|
|
93
|
+
DUTY_MANAGER = "DUTY_MANAGER",
|
|
94
|
+
ORGANIZATION_ADMIN = "ORGANIZATION_ADMIN"
|
|
95
|
+
}
|
|
96
|
+
export declare enum SlaEscalationTrigger {
|
|
97
|
+
SLA_WARNING = "SLA_WARNING",
|
|
98
|
+
SLA_AT_RISK = "SLA_AT_RISK",
|
|
99
|
+
SLA_BREACHED = "SLA_BREACHED",
|
|
100
|
+
ETA_AT_RISK = "ETA_AT_RISK",
|
|
101
|
+
ETA_LIKELY_BREACH = "ETA_LIKELY_BREACH",
|
|
102
|
+
ETA_UNCERTAIN = "ETA_UNCERTAIN",
|
|
103
|
+
DISPATCH_REJECTED = "DISPATCH_REJECTED",
|
|
104
|
+
DISPATCH_CANCELLED = "DISPATCH_CANCELLED"
|
|
105
|
+
}
|
|
106
|
+
export declare enum SlaPauseReason {
|
|
107
|
+
WAITING_FOR_CUSTOMER = "WAITING_FOR_CUSTOMER",
|
|
108
|
+
WAITING_FOR_EXTERNAL_AGENCY = "WAITING_FOR_EXTERNAL_AGENCY",
|
|
109
|
+
LOCATION_INACCESSIBLE = "LOCATION_INACCESSIBLE",
|
|
110
|
+
ENVIRONMENT_UNSAFE = "ENVIRONMENT_UNSAFE",
|
|
111
|
+
INCIDENT_DEESCALATED = "INCIDENT_DEESCALATED",
|
|
112
|
+
OTHER_APPROVED_REASON = "OTHER_APPROVED_REASON"
|
|
113
|
+
}
|
|
114
|
+
export declare enum SlaPauseStatus {
|
|
115
|
+
REQUESTED = "REQUESTED",
|
|
116
|
+
ACTIVE = "ACTIVE",
|
|
117
|
+
ENDED = "ENDED",
|
|
118
|
+
REJECTED = "REJECTED",
|
|
119
|
+
WITHDRAWN = "WITHDRAWN"
|
|
120
|
+
}
|
|
121
|
+
export declare enum SlaExceptionReason {
|
|
122
|
+
ROAD_INACCESSIBLE = "ROAD_INACCESSIBLE",
|
|
123
|
+
SEVERE_WEATHER = "SEVERE_WEATHER",
|
|
124
|
+
CUSTOMER_UNREACHABLE = "CUSTOMER_UNREACHABLE",
|
|
125
|
+
INCORRECT_LOCATION = "INCORRECT_LOCATION",
|
|
126
|
+
EXTERNAL_AGENCY_DELAY = "EXTERNAL_AGENCY_DELAY",
|
|
127
|
+
SAFETY_HOLD = "SAFETY_HOLD",
|
|
128
|
+
SYSTEM_OUTAGE = "SYSTEM_OUTAGE",
|
|
129
|
+
OTHER = "OTHER"
|
|
130
|
+
}
|
|
131
|
+
export declare enum SlaExceptionStatus {
|
|
132
|
+
NONE = "NONE",
|
|
133
|
+
REQUESTED = "REQUESTED",
|
|
134
|
+
APPROVED = "APPROVED",
|
|
135
|
+
REJECTED = "REJECTED"
|
|
136
|
+
}
|
|
137
|
+
export declare enum SlaPolicyScope {
|
|
138
|
+
PLATFORM = "PLATFORM",
|
|
139
|
+
ORGANIZATION = "ORGANIZATION",
|
|
140
|
+
CONTROL_CENTRE = "CONTROL_CENTRE",
|
|
141
|
+
INCIDENT_CATEGORY = "INCIDENT_CATEGORY",
|
|
142
|
+
INCIDENT_TYPE = "INCIDENT_TYPE",
|
|
143
|
+
PRIORITY = "PRIORITY",
|
|
144
|
+
ZONE = "ZONE"
|
|
145
|
+
}
|
|
146
|
+
export declare enum IncidentClosureReason {
|
|
147
|
+
MANUAL = "MANUAL",
|
|
148
|
+
AUTO_CLOSED_AFTER_RESOLUTION_TIMEOUT = "AUTO_CLOSED_AFTER_RESOLUTION_TIMEOUT"
|
|
149
|
+
}
|
|
150
|
+
export declare enum IncidentArrivalSource {
|
|
151
|
+
ARRIVAL_CONFIRMED_BY_RESPONDER = "ARRIVAL_CONFIRMED_BY_RESPONDER",
|
|
152
|
+
ARRIVAL_CONFIRMED_BY_CONTROL_CENTRE = "ARRIVAL_CONFIRMED_BY_CONTROL_CENTRE",
|
|
153
|
+
ARRIVAL_INFERRED_FROM_TRACKING = "ARRIVAL_INFERRED_FROM_TRACKING"
|
|
154
|
+
}
|
|
155
|
+
export declare enum EtaStatus {
|
|
156
|
+
ON_TRACK = "ON_TRACK",
|
|
157
|
+
AT_RISK = "AT_RISK",
|
|
158
|
+
LIKELY_BREACH = "LIKELY_BREACH",
|
|
159
|
+
UNCERTAIN = "UNCERTAIN",
|
|
160
|
+
NO_TARGET = "NO_TARGET",
|
|
161
|
+
ARRIVED = "ARRIVED"
|
|
162
|
+
}
|
|
163
|
+
export declare enum EtaBasis {
|
|
164
|
+
ESTIMATE = "ESTIMATE",
|
|
165
|
+
ROAD_ROUTE = "ROAD_ROUTE"
|
|
166
|
+
}
|
|
167
|
+
export declare enum SlaOverallState {
|
|
168
|
+
NOT_TRACKED = "NOT_TRACKED",
|
|
169
|
+
ON_TRACK = "ON_TRACK",
|
|
170
|
+
WARNING = "WARNING",
|
|
171
|
+
AT_RISK = "AT_RISK",
|
|
172
|
+
BREACHED = "BREACHED",
|
|
173
|
+
PAUSED = "PAUSED",
|
|
174
|
+
MET = "MET",
|
|
175
|
+
EXCEPTION = "EXCEPTION"
|
|
176
|
+
}
|
|
177
|
+
export declare enum SlaPriorityLevel {
|
|
178
|
+
P1 = "P1",
|
|
179
|
+
P2 = "P2",
|
|
180
|
+
P3 = "P3",
|
|
181
|
+
P4 = "P4"
|
|
182
|
+
}
|
|
183
|
+
export declare enum IncidentSlaErrorCode {
|
|
184
|
+
SLA_NOT_TRACKED = "SLA_NOT_TRACKED",
|
|
185
|
+
SLA_INSTANCE_NOT_FOUND = "SLA_INSTANCE_NOT_FOUND",
|
|
186
|
+
SLA_PAUSE_NOT_FOUND = "SLA_PAUSE_NOT_FOUND",
|
|
187
|
+
SLA_POLICY_NOT_FOUND = "SLA_POLICY_NOT_FOUND",
|
|
188
|
+
SLA_INVALID_STATE = "SLA_INVALID_STATE",
|
|
189
|
+
SLA_APPROVER_REQUIRED = "SLA_APPROVER_REQUIRED",
|
|
190
|
+
SLA_SELF_APPROVAL = "SLA_SELF_APPROVAL",
|
|
191
|
+
SLA_POLICY_INVALID = "SLA_POLICY_INVALID",
|
|
192
|
+
SLA_POLICY_FORBIDDEN = "SLA_POLICY_FORBIDDEN",
|
|
193
|
+
INCIDENT_NOT_EMERGENCY = "INCIDENT_NOT_EMERGENCY",
|
|
194
|
+
INCIDENT_ENDED = "INCIDENT_ENDED",
|
|
195
|
+
SLA_ESCALATION_RULE_NOT_FOUND = "SLA_ESCALATION_RULE_NOT_FOUND"
|
|
196
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { IncidentEmergencyType } from '../../incident/enums/incident-emergency-type.enum';
|
|
2
|
+
import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
|
|
3
|
+
import { EmergencyIncidentStage, EtaBasis, EtaStatus, IncidentActorType, IncidentArrivalSource, IncidentClosureReason, IncidentSlaEventSource, IncidentSlaEventType, IncidentSlaStage, IncidentSlaStatus, SlaEscalationLevel, SlaEscalationTrigger, SlaExceptionReason, SlaExceptionStatus, SlaOverallState, SlaPauseReason, SlaPauseStatus, SlaPolicyScope, SlaPriorityLevel } from '../enums/incident-sla-enums';
|
|
4
|
+
export interface IncidentSlaExceptionDto {
|
|
5
|
+
status: SlaExceptionStatus;
|
|
6
|
+
reason: SlaExceptionReason | null;
|
|
7
|
+
note: string | null;
|
|
8
|
+
requestedBy: number | null;
|
|
9
|
+
requestedAt: string | null;
|
|
10
|
+
decidedBy: number | null;
|
|
11
|
+
decidedAt: string | null;
|
|
12
|
+
decisionNote: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface IncidentSlaInstanceDto {
|
|
15
|
+
id: number;
|
|
16
|
+
stage: IncidentSlaStage;
|
|
17
|
+
cycle: number;
|
|
18
|
+
responseUnitDispatchId: number | null;
|
|
19
|
+
responseUnitId: number | null;
|
|
20
|
+
responseUnitName: string | null;
|
|
21
|
+
priority: IncidentPriority;
|
|
22
|
+
status: IncidentSlaStatus;
|
|
23
|
+
targetSeconds: number | null;
|
|
24
|
+
startedAt: string | null;
|
|
25
|
+
deadlineAt: string | null;
|
|
26
|
+
originalDeadlineAt: string | null;
|
|
27
|
+
warningAt: string | null;
|
|
28
|
+
atRiskAt: string | null;
|
|
29
|
+
warnedAt: string | null;
|
|
30
|
+
atRiskSince: string | null;
|
|
31
|
+
breachedAt: string | null;
|
|
32
|
+
completedAt: string | null;
|
|
33
|
+
endedAt: string | null;
|
|
34
|
+
endReason: string | null;
|
|
35
|
+
pausedAt: string | null;
|
|
36
|
+
totalPausedSeconds: number;
|
|
37
|
+
elapsedSeconds: number | null;
|
|
38
|
+
remainingSeconds: number | null;
|
|
39
|
+
overdueSeconds: number | null;
|
|
40
|
+
exception: IncidentSlaExceptionDto | null;
|
|
41
|
+
waivedBy: number | null;
|
|
42
|
+
waivedAt: string | null;
|
|
43
|
+
waiveReason: string | null;
|
|
44
|
+
slaPolicyId: number | null;
|
|
45
|
+
slaPolicyVersion: number | null;
|
|
46
|
+
}
|
|
47
|
+
export type IncidentSlaTimelineState = 'DONE' | 'CURRENT' | 'PENDING' | 'SKIPPED';
|
|
48
|
+
export interface IncidentSlaTimelineItemDto {
|
|
49
|
+
milestone: EmergencyIncidentStage;
|
|
50
|
+
state: IncidentSlaTimelineState;
|
|
51
|
+
at: string | null;
|
|
52
|
+
implied: boolean;
|
|
53
|
+
actorType: IncidentActorType | null;
|
|
54
|
+
source: IncidentSlaEventSource | null;
|
|
55
|
+
stage: IncidentSlaStage | null;
|
|
56
|
+
slaStatus: IncidentSlaStatus | null;
|
|
57
|
+
targetAt: string | null;
|
|
58
|
+
etaAt: string | null;
|
|
59
|
+
arrivalSource: IncidentArrivalSource | null;
|
|
60
|
+
}
|
|
61
|
+
export interface IncidentSlaStatsDto {
|
|
62
|
+
total: number;
|
|
63
|
+
decided: number;
|
|
64
|
+
met: number;
|
|
65
|
+
breached: number;
|
|
66
|
+
breachedWithApprovedException: number;
|
|
67
|
+
open: number;
|
|
68
|
+
warnings: number;
|
|
69
|
+
atRisk: number;
|
|
70
|
+
compliancePercent: number | null;
|
|
71
|
+
complianceWithExceptionsPercent: number | null;
|
|
72
|
+
}
|
|
73
|
+
export interface IncidentEtaDto {
|
|
74
|
+
dispatchId: number;
|
|
75
|
+
responseUnitId: number;
|
|
76
|
+
responseUnitName: string | null;
|
|
77
|
+
status: EtaStatus;
|
|
78
|
+
etaSeconds: number | null;
|
|
79
|
+
predictedArrivalAt: string | null;
|
|
80
|
+
distanceMetres: number | null;
|
|
81
|
+
basis: EtaBasis | null;
|
|
82
|
+
computedAt: string | null;
|
|
83
|
+
lastLocationAt: string | null;
|
|
84
|
+
locationAgeSeconds: number | null;
|
|
85
|
+
arrivalDeadlineAt: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface IncidentSlaPauseDto {
|
|
88
|
+
id: number;
|
|
89
|
+
instanceId: number;
|
|
90
|
+
stage: IncidentSlaStage;
|
|
91
|
+
reason: SlaPauseReason;
|
|
92
|
+
note: string | null;
|
|
93
|
+
status: SlaPauseStatus;
|
|
94
|
+
requestedBy: number | null;
|
|
95
|
+
requestedAt: string;
|
|
96
|
+
decidedBy: number | null;
|
|
97
|
+
decidedAt: string | null;
|
|
98
|
+
decisionNote: string | null;
|
|
99
|
+
startedAt: string | null;
|
|
100
|
+
endedAt: string | null;
|
|
101
|
+
pausedSeconds: number;
|
|
102
|
+
}
|
|
103
|
+
export interface IncidentSlaAlternativeDto {
|
|
104
|
+
responseUnitId: number;
|
|
105
|
+
responseUnitName: string | null;
|
|
106
|
+
distanceMetres: number | null;
|
|
107
|
+
etaSeconds: number | null;
|
|
108
|
+
trigger: SlaEscalationTrigger;
|
|
109
|
+
forDispatchId: number | null;
|
|
110
|
+
recommendedAt: string;
|
|
111
|
+
}
|
|
112
|
+
export interface IncidentSlaAllowedActionsDto {
|
|
113
|
+
acknowledge: boolean;
|
|
114
|
+
triage: boolean;
|
|
115
|
+
recordAssessment: boolean;
|
|
116
|
+
requestPause: boolean;
|
|
117
|
+
approvePause: boolean;
|
|
118
|
+
endPause: boolean;
|
|
119
|
+
requestException: boolean;
|
|
120
|
+
approveException: boolean;
|
|
121
|
+
waive: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface IncidentSlaClosureDto {
|
|
124
|
+
resolvedAt: string | null;
|
|
125
|
+
closedAt: string | null;
|
|
126
|
+
closureReason: IncidentClosureReason | null;
|
|
127
|
+
closedBy: number | null;
|
|
128
|
+
autoCloseEnabled: boolean;
|
|
129
|
+
autoCloseAt: string | null;
|
|
130
|
+
}
|
|
131
|
+
export interface IncidentSlaContributingPolicyDto {
|
|
132
|
+
policyId: number;
|
|
133
|
+
policyKey: string;
|
|
134
|
+
version: number;
|
|
135
|
+
name: string;
|
|
136
|
+
scope: SlaPolicyScope;
|
|
137
|
+
}
|
|
138
|
+
export interface IncidentSlaPolicyReferenceDto {
|
|
139
|
+
id: number | null;
|
|
140
|
+
key: string | null;
|
|
141
|
+
version: number | null;
|
|
142
|
+
name: string;
|
|
143
|
+
scope: SlaPolicyScope;
|
|
144
|
+
contributingPolicies: IncidentSlaContributingPolicyDto[];
|
|
145
|
+
}
|
|
146
|
+
/** `GET /api/incidents/:id/sla`. */
|
|
147
|
+
export interface IncidentSlaSummaryDto {
|
|
148
|
+
incidentId: number;
|
|
149
|
+
tracked: boolean;
|
|
150
|
+
notTrackedReason: string | null;
|
|
151
|
+
serverTime: string;
|
|
152
|
+
priority: IncidentPriority | null;
|
|
153
|
+
priorityLevel: SlaPriorityLevel | null;
|
|
154
|
+
policy: IncidentSlaPolicyReferenceDto | null;
|
|
155
|
+
overall: SlaOverallState;
|
|
156
|
+
currentStage: EmergencyIncidentStage | null;
|
|
157
|
+
currentInstance: IncidentSlaInstanceDto | null;
|
|
158
|
+
instances: IncidentSlaInstanceDto[];
|
|
159
|
+
timeline: IncidentSlaTimelineItemDto[];
|
|
160
|
+
stats: IncidentSlaStatsDto;
|
|
161
|
+
etas: IncidentEtaDto[];
|
|
162
|
+
primaryEta: IncidentEtaDto | null;
|
|
163
|
+
pauses: IncidentSlaPauseDto[];
|
|
164
|
+
alternative: IncidentSlaAlternativeDto | null;
|
|
165
|
+
closure: IncidentSlaClosureDto;
|
|
166
|
+
allowedActions: IncidentSlaAllowedActionsDto;
|
|
167
|
+
workflowId: string | null;
|
|
168
|
+
}
|
|
169
|
+
/** One row of `GET /api/incidents/:id/sla/events`. */
|
|
170
|
+
export interface IncidentSlaEventDto {
|
|
171
|
+
id: number;
|
|
172
|
+
eventType: IncidentSlaEventType;
|
|
173
|
+
stage: IncidentSlaStage | null;
|
|
174
|
+
cycle: number | null;
|
|
175
|
+
instanceId: number | null;
|
|
176
|
+
milestone: EmergencyIncidentStage | null;
|
|
177
|
+
fromStatus: IncidentSlaStatus | null;
|
|
178
|
+
toStatus: IncidentSlaStatus | null;
|
|
179
|
+
actorUserId: number | null;
|
|
180
|
+
actorType: IncidentActorType;
|
|
181
|
+
source: IncidentSlaEventSource;
|
|
182
|
+
reason: string | null;
|
|
183
|
+
note: string | null;
|
|
184
|
+
metadata: Record<string, unknown> | null;
|
|
185
|
+
correlationId: string | null;
|
|
186
|
+
workflowId: string | null;
|
|
187
|
+
occurredAt: string;
|
|
188
|
+
recordedAt: string;
|
|
189
|
+
}
|
|
190
|
+
export interface IncidentSlaEventPageDto {
|
|
191
|
+
data: IncidentSlaEventDto[];
|
|
192
|
+
total: number;
|
|
193
|
+
page: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
}
|
|
196
|
+
/** Bodies of the SLA write routes. */
|
|
197
|
+
export interface TriageEmergencyIncidentRequest {
|
|
198
|
+
priority?: IncidentPriority;
|
|
199
|
+
note?: string;
|
|
200
|
+
}
|
|
201
|
+
export interface RequestSlaPauseRequest {
|
|
202
|
+
reason: SlaPauseReason;
|
|
203
|
+
note?: string;
|
|
204
|
+
instanceIds?: number[];
|
|
205
|
+
}
|
|
206
|
+
export interface RequestSlaExceptionRequest {
|
|
207
|
+
reason: SlaExceptionReason;
|
|
208
|
+
note: string;
|
|
209
|
+
}
|
|
210
|
+
/** A stored SLA policy version (`GET /api/incident-sla/policies`). */
|
|
211
|
+
export interface IncidentSlaPolicyDto {
|
|
212
|
+
id: number;
|
|
213
|
+
policyKey: string;
|
|
214
|
+
version: number;
|
|
215
|
+
name: string;
|
|
216
|
+
description: string | null;
|
|
217
|
+
scope: SlaPolicyScope;
|
|
218
|
+
organizationId: number | null;
|
|
219
|
+
controlCentreId: number | null;
|
|
220
|
+
categoryId: number | null;
|
|
221
|
+
typeId: number | null;
|
|
222
|
+
priority: IncidentPriority | null;
|
|
223
|
+
zoneId: number | null;
|
|
224
|
+
incidentClass: string;
|
|
225
|
+
effectiveFrom: string;
|
|
226
|
+
effectiveTo: string | null;
|
|
227
|
+
active: boolean;
|
|
228
|
+
settings: Record<string, number | boolean>;
|
|
229
|
+
priorityFloors: Partial<Record<IncidentEmergencyType, IncidentPriority>> | null;
|
|
230
|
+
startAnchors: Partial<Record<IncidentSlaStage, EmergencyIncidentStage>> | null;
|
|
231
|
+
targets: {
|
|
232
|
+
stage: IncidentSlaStage;
|
|
233
|
+
priority: IncidentPriority;
|
|
234
|
+
targetSeconds: number | null;
|
|
235
|
+
}[];
|
|
236
|
+
escalationRules: {
|
|
237
|
+
key: string;
|
|
238
|
+
trigger: SlaEscalationTrigger;
|
|
239
|
+
stages: IncidentSlaStage[];
|
|
240
|
+
priorities: IncidentPriority[];
|
|
241
|
+
level: SlaEscalationLevel;
|
|
242
|
+
channels: string[];
|
|
243
|
+
actions: string[];
|
|
244
|
+
delaySeconds: number;
|
|
245
|
+
recipientRoles: string[];
|
|
246
|
+
contacts: {
|
|
247
|
+
name?: string | null;
|
|
248
|
+
phoneNumber?: string | null;
|
|
249
|
+
email?: string | null;
|
|
250
|
+
}[];
|
|
251
|
+
}[] | null;
|
|
252
|
+
usageCount?: number;
|
|
253
|
+
createdBy: number | null;
|
|
254
|
+
updatedBy: number | null;
|
|
255
|
+
createdAt: string;
|
|
256
|
+
updatedAt: string;
|
|
257
|
+
}
|
|
258
|
+
export interface IncidentSlaDurationPercentilesDto {
|
|
259
|
+
p50: number | null;
|
|
260
|
+
p75: number | null;
|
|
261
|
+
p90: number | null;
|
|
262
|
+
p95: number | null;
|
|
263
|
+
p99: number | null;
|
|
264
|
+
average: number | null;
|
|
265
|
+
}
|
|
266
|
+
export interface IncidentSlaStageAnalyticsDto {
|
|
267
|
+
stage: IncidentSlaStage;
|
|
268
|
+
instances: number;
|
|
269
|
+
met: number;
|
|
270
|
+
breached: number;
|
|
271
|
+
breachedWithApprovedException: number;
|
|
272
|
+
compliancePercent: number | null;
|
|
273
|
+
complianceWithExceptionsPercent: number | null;
|
|
274
|
+
duration: IncidentSlaDurationPercentilesDto;
|
|
275
|
+
}
|
|
276
|
+
/** `GET /api/incident-sla/analytics`. */
|
|
277
|
+
export interface IncidentSlaAnalyticsDto {
|
|
278
|
+
from: string;
|
|
279
|
+
to: string;
|
|
280
|
+
organizationId: number | null;
|
|
281
|
+
controlCentreId: number | null;
|
|
282
|
+
incidents: number;
|
|
283
|
+
breachedIncidents: number;
|
|
284
|
+
stages: IncidentSlaStageAnalyticsDto[];
|
|
285
|
+
generatedAt: string;
|
|
286
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EmergencyIncidentStage, EtaStatus, IncidentActorType, IncidentArrivalSource, IncidentSlaEventType, IncidentSlaStage, IncidentSlaStatus, SlaExceptionReason, SlaExceptionStatus, SlaOverallState, SlaPauseReason } from '../enums/incident-sla-enums';
|
|
2
|
+
import { IncidentSlaInstanceDto } from '../interfaces/incident-sla.dto';
|
|
3
|
+
/** A Clarion colour family: bg-light-{tone} text-{tone}. */
|
|
4
|
+
export type SlaTone = 'success' | 'info' | 'warning' | 'error' | 'grey' | 'primary' | 'accent';
|
|
5
|
+
export declare const INCIDENT_SLA_STAGE_LABELS: Readonly<Record<IncidentSlaStage, string>>;
|
|
6
|
+
export declare const INCIDENT_SLA_STATUS_LABELS: Readonly<Record<IncidentSlaStatus, string>>;
|
|
7
|
+
export declare const SLA_OVERALL_STATE_LABELS: Readonly<Record<SlaOverallState, string>>;
|
|
8
|
+
export declare const EMERGENCY_INCIDENT_STAGE_LABELS: Readonly<Record<EmergencyIncidentStage, string>>;
|
|
9
|
+
export declare const SLA_PAUSE_REASON_LABELS: Readonly<Record<SlaPauseReason, string>>;
|
|
10
|
+
export declare const SLA_EXCEPTION_REASON_LABELS: Readonly<Record<SlaExceptionReason, string>>;
|
|
11
|
+
export declare const SLA_EXCEPTION_STATUS_LABELS: Readonly<Record<SlaExceptionStatus, string>>;
|
|
12
|
+
export declare const ETA_STATUS_LABELS: Readonly<Record<EtaStatus, string>>;
|
|
13
|
+
export declare const INCIDENT_ARRIVAL_SOURCE_LABELS: Readonly<Record<IncidentArrivalSource, string>>;
|
|
14
|
+
export declare const INCIDENT_ACTOR_TYPE_LABELS: Readonly<Record<IncidentActorType, string>>;
|
|
15
|
+
export declare const INCIDENT_SLA_EVENT_TYPE_LABELS: Readonly<Record<IncidentSlaEventType, string>>;
|
|
16
|
+
/** The colour of an instance's status chip. */
|
|
17
|
+
export declare function incidentSlaStatusTone(status: IncidentSlaStatus | string | null | undefined, exceptionStatus?: SlaExceptionStatus | string | null): SlaTone;
|
|
18
|
+
export declare function slaOverallStateTone(state: SlaOverallState | string | null | undefined): SlaTone;
|
|
19
|
+
export declare function etaStatusTone(status: EtaStatus | string | null | undefined): SlaTone;
|
|
20
|
+
/** "01:12", "12:05", "1:05:00", and overdue as "+00:45". */
|
|
21
|
+
export declare function formatSlaClock(seconds: number | null | undefined): string;
|
|
22
|
+
/** "15 sec", "2 min", "1 h 30 min", "1 d 2 h". */
|
|
23
|
+
export declare function formatSlaTarget(seconds: number | null | undefined): string;
|
|
24
|
+
/**
|
|
25
|
+
* Seconds left on an instance at the browser's `nowMs`, corrected for the
|
|
26
|
+
* difference between the server's clock and the browser's (`skewMs` = server -
|
|
27
|
+
* browser, measured when the summary arrived). Null when its clock is not
|
|
28
|
+
* running. Display only - the server decides every transition.
|
|
29
|
+
*/
|
|
30
|
+
export declare function liveRemainingSeconds(instance: Pick<IncidentSlaInstanceDto, 'status' | 'deadlineAt'>, nowMs: number, skewMs?: number): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* The status an open instance shows at `nowMs`: what the server said, or the
|
|
33
|
+
* next threshold if the clock has passed it since (the server's own event
|
|
34
|
+
* follows within seconds). Never goes backwards.
|
|
35
|
+
*/
|
|
36
|
+
export declare function liveIncidentSlaStatus(instance: Pick<IncidentSlaInstanceDto, 'status' | 'warningAt' | 'atRiskAt' | 'deadlineAt' | 'completedAt'>, nowMs: number, skewMs?: number): IncidentSlaStatus;
|
|
37
|
+
/** Statuses whose clock is running (or paused). */
|
|
38
|
+
export declare function isOpenIncidentSlaStatus(status: IncidentSlaStatus | string | null | undefined): boolean;
|
|
@@ -193,6 +193,12 @@ export declare enum PermissionActions {
|
|
|
193
193
|
READ_FOLLOW_ME = "read:follow-me",
|
|
194
194
|
TRACK_FOLLOW_ME = "track:follow-me",
|
|
195
195
|
MANAGE_SAVED_PLACE = "manage:saved-place",
|
|
196
|
+
READ_INCIDENT_SLA = "read:incident-sla",
|
|
197
|
+
UPDATE_INCIDENT_SLA = "update:incident-sla",
|
|
198
|
+
APPROVE_INCIDENT_SLA = "approve:incident-sla",
|
|
199
|
+
READ_INCIDENT_SLA_POLICY = "read:incident-sla-policy",
|
|
200
|
+
MANAGE_INCIDENT_SLA_POLICY = "manage:incident-sla-policy",
|
|
201
|
+
READ_INCIDENT_SLA_ANALYTICS = "read:incident-sla-analytics",
|
|
196
202
|
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
197
203
|
READ_ALERT_INTAKE = "read:alert-intake",
|
|
198
204
|
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "clarion-shared-types",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/cjs/index.js",
|
|
5
|
-
"module": "dist/esm/index.js",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/types/index.d.ts",
|
|
10
|
-
"import": "./dist/esm/index.js",
|
|
11
|
-
"require": "./dist/cjs/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./dist/modules/*": {
|
|
14
|
-
"types": "./dist/types/modules/*.d.ts",
|
|
15
|
-
"import": "./dist/esm/modules/*.js",
|
|
16
|
-
"require": "./dist/cjs/modules/*.js"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist/**/*"
|
|
21
|
-
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"clean": "rimraf dist dist-test",
|
|
24
|
-
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
25
|
-
"build:esm": "tsc -p tsconfig.esm.json",
|
|
26
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
27
|
-
"build": "npm run clean && npm run build:types && npm run build:cjs && npm run build:esm",
|
|
28
|
-
"prepublishOnly": "npm run build",
|
|
29
|
-
"pretest": "rimraf dist-test",
|
|
30
|
-
"test": "tsc -p tsconfig.spec.json && node --test \"dist-test/**/*.spec.js\""
|
|
31
|
-
},
|
|
32
|
-
"keywords": [],
|
|
33
|
-
"author": "vince_lawino",
|
|
34
|
-
"license": "ISC",
|
|
35
|
-
"description": "",
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@types/geojson": "^7946.0.16",
|
|
41
|
-
"@types/node": "^20.11.2",
|
|
42
|
-
"rimraf": "^5.0.5",
|
|
43
|
-
"typescript": "^5.7.3"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "clarion-shared-types",
|
|
3
|
+
"version": "1.0.117",
|
|
4
|
+
"main": "dist/cjs/index.js",
|
|
5
|
+
"module": "dist/esm/index.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"import": "./dist/esm/index.js",
|
|
11
|
+
"require": "./dist/cjs/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./dist/modules/*": {
|
|
14
|
+
"types": "./dist/types/modules/*.d.ts",
|
|
15
|
+
"import": "./dist/esm/modules/*.js",
|
|
16
|
+
"require": "./dist/cjs/modules/*.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/**/*"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "rimraf dist dist-test",
|
|
24
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
25
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
26
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
27
|
+
"build": "npm run clean && npm run build:types && npm run build:cjs && npm run build:esm",
|
|
28
|
+
"prepublishOnly": "npm run build",
|
|
29
|
+
"pretest": "rimraf dist-test",
|
|
30
|
+
"test": "tsc -p tsconfig.spec.json && node --test \"dist-test/**/*.spec.js\""
|
|
31
|
+
},
|
|
32
|
+
"keywords": [],
|
|
33
|
+
"author": "vince_lawino",
|
|
34
|
+
"license": "ISC",
|
|
35
|
+
"description": "",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/geojson": "^7946.0.16",
|
|
41
|
+
"@types/node": "^20.11.2",
|
|
42
|
+
"rimraf": "^5.0.5",
|
|
43
|
+
"typescript": "^5.7.3"
|
|
44
|
+
}
|
|
45
|
+
}
|