clarion-shared-types 1.0.84 → 1.0.86
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/alert-dispatch/enums/incident-dispatch-scope.enum.js +15 -7
- package/dist/cjs/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -1
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js +50 -15
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -1
- package/dist/cjs/modules/entitlement/enums/incident-entitlement-scope.enum.js +16 -5
- package/dist/cjs/modules/entitlement/enums/incident-entitlement-scope.enum.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-enums.js +128 -0
- package/dist/cjs/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/cjs/modules/partner/index.js +27 -0
- package/dist/cjs/modules/partner/index.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/incident-partner-routing.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/incident-partner-routing.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-coverage-rule.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-coverage-rule.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-integration.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-integration.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-provider.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-provider.dto.js.map +1 -0
- package/dist/cjs/modules/partner/utils/partner-display.util.js +116 -0
- package/dist/cjs/modules/partner/utils/partner-display.util.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js +15 -7
- package/dist/esm/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -1
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js +48 -15
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -1
- package/dist/esm/modules/entitlement/enums/incident-entitlement-scope.enum.js +16 -5
- package/dist/esm/modules/entitlement/enums/incident-entitlement-scope.enum.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-enums.js +125 -0
- package/dist/esm/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/esm/modules/partner/index.js +11 -0
- package/dist/esm/modules/partner/index.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/incident-partner-routing.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/incident-partner-routing.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-coverage-rule.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-coverage-rule.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-integration.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-integration.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-provider.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-provider.dto.js.map +1 -0
- package/dist/esm/modules/partner/utils/partner-display.util.js +110 -0
- package/dist/esm/modules/partner/utils/partner-display.util.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/alert-dispatch/enums/incident-dispatch-scope.enum.d.ts +15 -7
- package/dist/types/modules/alert-dispatch/interfaces/alert-dispatch.d.ts +13 -0
- package/dist/types/modules/alert-dispatch/utils/alert-dispatch.util.d.ts +43 -15
- package/dist/types/modules/entitlement/enums/incident-entitlement-scope.enum.d.ts +17 -6
- package/dist/types/modules/incident/intefaces/incident.d.ts +15 -0
- package/dist/types/modules/partner/enums/partner-enums.d.ts +112 -0
- package/dist/types/modules/partner/index.d.ts +7 -0
- package/dist/types/modules/partner/interfaces/incident-partner-routing.dto.d.ts +30 -0
- package/dist/types/modules/partner/interfaces/partner-coverage-rule.dto.d.ts +42 -0
- package/dist/types/modules/partner/interfaces/partner-dispatch.dto.d.ts +126 -0
- package/dist/types/modules/partner/interfaces/partner-integration.dto.d.ts +86 -0
- package/dist/types/modules/partner/interfaces/partner-provider.dto.d.ts +53 -0
- package/dist/types/modules/partner/utils/partner-display.util.d.ts +37 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __exportStar(require("./modules/country/index"), exports);
|
|
|
36
36
|
__exportStar(require("./modules/tracking/index"), exports);
|
|
37
37
|
__exportStar(require("./modules/entitlement/index"), exports);
|
|
38
38
|
__exportStar(require("./modules/alert-dispatch/index"), exports);
|
|
39
|
+
__exportStar(require("./modules/partner/index"), exports);
|
|
39
40
|
// Interfaces
|
|
40
41
|
__exportStar(require("./modules/common/interfaces/server-message"), exports);
|
|
41
42
|
__exportStar(require("./modules/common/interfaces/pagination"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;AAC/C,0DAAwC;AAExC,aAAa;AACb,6EAA2D;AAC3D,yEAAuD"}
|
|
@@ -6,17 +6,25 @@ exports.IncidentDispatchScope = void 0;
|
|
|
6
6
|
* whether the reporter asked for the service provider to be alerted at all.
|
|
7
7
|
*
|
|
8
8
|
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
9
|
-
* DISPATCHED - only incidents the
|
|
10
|
-
* primary admin incident list, map and kanban views.
|
|
9
|
+
* DISPATCHED - only incidents the reporter asked the provider to receive.
|
|
10
|
+
* Used by the primary admin incident list, map and kanban views.
|
|
11
11
|
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
12
|
-
* provider. Backs the "
|
|
13
|
-
*
|
|
12
|
+
* provider. Backs the "Marked Ignore" admin views.
|
|
13
|
+
*
|
|
14
|
+
* Both read what the reporter ASKED FOR, not what they got. Entitlement can
|
|
15
|
+
* close the provider channel on its own, and an operator looking at a
|
|
16
|
+
* "Marked Ignore" list wants the alerts somebody chose to withhold - not the
|
|
17
|
+
* ones billing withheld for them.
|
|
14
18
|
*
|
|
15
19
|
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
16
20
|
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
17
|
-
* this one alert. The two compose
|
|
18
|
-
*
|
|
19
|
-
*
|
|
21
|
+
* this one alert. The two compose into the admin's operator views:
|
|
22
|
+
*
|
|
23
|
+
* Incidents (list/map/kanban) ENTITLED + DISPATCHED
|
|
24
|
+
* Incident List - Marked Ignore ENTITLED + SUPPRESSED
|
|
25
|
+
* Incident List - Uncovered Types UNCOVERED_TYPE + DISPATCHED
|
|
26
|
+
* Uncovered Types - Marked Ignore UNCOVERED_TYPE + SUPPRESSED
|
|
27
|
+
* Incident List - Free Users FREE
|
|
20
28
|
*/
|
|
21
29
|
var IncidentDispatchScope;
|
|
22
30
|
(function (IncidentDispatchScope) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,kDAAyB,CAAA;IACzB,kDAAyB,CAAA;AAC7B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC"}
|
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reachesControlRoom = reachesControlRoom;
|
|
4
4
|
exports.reachesGuardians = reachesGuardians;
|
|
5
5
|
exports.isMarkedIgnore = isMarkedIgnore;
|
|
6
|
+
exports.isUncoveredIncidentType = isUncoveredIncidentType;
|
|
7
|
+
exports.isUnentitledReporter = isUnentitledReporter;
|
|
6
8
|
exports.resolveIncidentAlertDispatch = resolveIncidentAlertDispatch;
|
|
7
9
|
exports.reachesNobody = reachesNobody;
|
|
8
10
|
exports.parseIncidentDispatchScope = parseIncidentDispatchScope;
|
|
11
|
+
const entitlement_decision_reason_enum_1 = require("../../entitlement/enums/entitlement-decision-reason.enum");
|
|
9
12
|
const entitlement_util_1 = require("../../entitlement/utils/entitlement.util");
|
|
10
13
|
const incident_dispatch_scope_enum_1 = require("../enums/incident-dispatch-scope.enum");
|
|
11
14
|
/**
|
|
@@ -15,9 +18,11 @@ const incident_dispatch_scope_enum_1 = require("../enums/incident-dispatch-scope
|
|
|
15
18
|
* Two independent reasons keep an alert out, and this is the single place both
|
|
16
19
|
* are expressed so no consumer can honour one and forget the other:
|
|
17
20
|
*
|
|
18
|
-
* 1. the reporter
|
|
19
|
-
*
|
|
21
|
+
* 1. the reporter was not entitled to send it (no subscription, or one that
|
|
22
|
+
* does not cover this incident type), so the provider was never asked;
|
|
23
|
+
* 2. the reporter explicitly unchecked the provider option.
|
|
20
24
|
*
|
|
25
|
+
* Reads `notifyServiceProvider`, the resolved OUTCOME - never the request.
|
|
21
26
|
* A missing flag counts as dispatched: incidents written before this feature
|
|
22
27
|
* existed, and every operator-created record, keep their original behaviour.
|
|
23
28
|
*/
|
|
@@ -33,15 +38,36 @@ function reachesGuardians(incident) {
|
|
|
33
38
|
return !incident || incident.notifyGuardians !== false;
|
|
34
39
|
}
|
|
35
40
|
/**
|
|
36
|
-
* Whether the reporter deliberately withheld this alert from the provider
|
|
37
|
-
*
|
|
38
|
-
* the
|
|
39
|
-
*
|
|
41
|
+
* Whether the reporter deliberately withheld this alert from the provider.
|
|
42
|
+
*
|
|
43
|
+
* Reads the REQUEST, not the outcome. An alert entitlement withheld is not an
|
|
44
|
+
* alert somebody chose to withhold, and only the second belongs in a
|
|
45
|
+
* "Marked Ignore" view - a free user never had the option to decline, so their
|
|
46
|
+
* alert is not "marked ignore" however the resolved flag ended up.
|
|
47
|
+
*
|
|
48
|
+
* Independent of entitlement, so it holds equally for a subscriber who declined
|
|
49
|
+
* on a covered type and one who declined on a type their package excludes.
|
|
50
|
+
* Which of the two Marked Ignore lists they land in is decided by pairing this
|
|
51
|
+
* with the entitlement scope.
|
|
40
52
|
*/
|
|
41
53
|
function isMarkedIgnore(incident) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
return (incident === null || incident === void 0 ? void 0 : incident.notifyServiceProviderRequested) === false;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether the reporter pays for cover, but not for the incident type they
|
|
58
|
+
* raised. Distinct from having no entitlement at all: this is a paying customer
|
|
59
|
+
* finding a gap in their package, not someone to upsell from scratch.
|
|
60
|
+
*/
|
|
61
|
+
function isUncoveredIncidentType(incident) {
|
|
62
|
+
return (incident === null || incident === void 0 ? void 0 : incident.entitlementReason) === entitlement_decision_reason_enum_1.EntitlementDecisionReason.INCIDENT_TYPE_NOT_COVERED;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Whether the reporter had no entitlement whatsoever - never subscribed,
|
|
66
|
+
* lapsed, or a spent/expired trial. Deliberately excludes the uncovered-type
|
|
67
|
+
* case, which carries the same FREE tier but is a different conversation.
|
|
68
|
+
*/
|
|
69
|
+
function isUnentitledReporter(incident) {
|
|
70
|
+
return (0, entitlement_util_1.isFreeUserTier)(incident === null || incident === void 0 ? void 0 : incident.entitlementTier) && !isUncoveredIncidentType(incident);
|
|
45
71
|
}
|
|
46
72
|
/**
|
|
47
73
|
* Applies dispatch policy to what the client asked for.
|
|
@@ -52,20 +78,29 @@ function isMarkedIgnore(incident) {
|
|
|
52
78
|
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
53
79
|
* unaffected.
|
|
54
80
|
*
|
|
55
|
-
* Returns
|
|
56
|
-
*
|
|
57
|
-
*
|
|
81
|
+
* Returns both what was asked for and what will happen, because the two diverge
|
|
82
|
+
* exactly when entitlement overrides the reporter - and that difference is what
|
|
83
|
+
* the admin's Marked Ignore views are built on.
|
|
84
|
+
*
|
|
85
|
+
* It deliberately does not reject the both-off combination, so callers can
|
|
86
|
+
* decide whether that is a validation error (the SOS path) or simply nobody to
|
|
87
|
+
* notify.
|
|
58
88
|
*/
|
|
59
89
|
function resolveIncidentAlertDispatch(request) {
|
|
60
90
|
const applies = request.applies !== false;
|
|
61
91
|
if (!applies) {
|
|
62
|
-
return {
|
|
92
|
+
return {
|
|
93
|
+
notifyServiceProvider: true,
|
|
94
|
+
notifyGuardians: true,
|
|
95
|
+
notifyServiceProviderRequested: true,
|
|
96
|
+
};
|
|
63
97
|
}
|
|
64
98
|
const notifyGuardians = request.notifyGuardians !== false;
|
|
99
|
+
const notifyServiceProviderRequested = request.notifyServiceProvider !== false;
|
|
65
100
|
const notifyServiceProvider = (0, entitlement_util_1.isFreeUserTier)(request.tier)
|
|
66
101
|
? false
|
|
67
|
-
:
|
|
68
|
-
return { notifyServiceProvider, notifyGuardians };
|
|
102
|
+
: notifyServiceProviderRequested;
|
|
103
|
+
return { notifyServiceProvider, notifyGuardians, notifyServiceProviderRequested };
|
|
69
104
|
}
|
|
70
105
|
/** True when an alert would reach nobody at all. */
|
|
71
106
|
function reachesNobody(dispatch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings":";;AA4BA,gDAMC;AAGD,4CAEC;AAeD,wCAIC;AAOD,0DAEC;AAOD,oDAEC;AAmBD,oEAoBC;AAGD,sCAEC;AAMD,gEAMC;AApID,+GAAqG;AAErG,+EAA0E;AAC1E,wFAA8E;AAU9E;;;;;;;;;;;;;;GAcG;AACH,SAAgB,kBAAkB,CAC9B,QAA0D;IAE1D,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,IAAA,iCAAc,EAAC,QAAQ,CAAC,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,QAAQ,CAAC,qBAAqB,KAAK,KAAK,CAAC;AACpD,CAAC;AAED,yEAAy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;AAED,oDAAoD;AACpD,SAAgB,aAAa,CAAC,QAA+B;IACzD,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,MAAK,KAAK,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,MAAK,KAAK,CAAC;AAC5F,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,KAAqB;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,oDAAqB,CAAC,GAAG,CAAC;IAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAQ,MAAM,CAAC,MAAM,CAAC,oDAAqB,CAAc,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC1E,CAAC,CAAE,UAAoC;QACvC,CAAC,CAAC,oDAAqB,CAAC,GAAG,CAAC;AACpC,CAAC"}
|
|
@@ -4,16 +4,27 @@ exports.IncidentEntitlementScope = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* List filter applied to incident queries.
|
|
6
6
|
*
|
|
7
|
-
* ALL
|
|
8
|
-
* ENTITLED
|
|
9
|
-
*
|
|
10
|
-
* FREE
|
|
11
|
-
*
|
|
7
|
+
* ALL — no entitlement filter (default; preserves legacy behaviour).
|
|
8
|
+
* ENTITLED — everything except incidents the reporter was not entitled
|
|
9
|
+
* to send. Used by the primary admin list, map and kanban.
|
|
10
|
+
* FREE — reporters with no entitlement at all: never subscribed,
|
|
11
|
+
* lapsed, or a spent/expired trial. Backs
|
|
12
|
+
* "Incident List - Free Users".
|
|
13
|
+
* UNCOVERED_TYPE — reporters who DO pay, but whose package excludes the
|
|
14
|
+
* incident type they raised. Backs
|
|
15
|
+
* "Incident List - Uncovered Types".
|
|
16
|
+
*
|
|
17
|
+
* The last two both carry tier FREE, because that is what billing stamps in
|
|
18
|
+
* either case, but they are very different situations for an operator: one is
|
|
19
|
+
* an upsell, the other is a paying customer discovering a gap in their cover.
|
|
20
|
+
* `FREE` therefore excludes uncovered-type incidents rather than absorbing
|
|
21
|
+
* them, so the three scopes partition the data with no overlap and no gaps.
|
|
12
22
|
*/
|
|
13
23
|
var IncidentEntitlementScope;
|
|
14
24
|
(function (IncidentEntitlementScope) {
|
|
15
25
|
IncidentEntitlementScope["ALL"] = "ALL";
|
|
16
26
|
IncidentEntitlementScope["ENTITLED"] = "ENTITLED";
|
|
17
27
|
IncidentEntitlementScope["FREE"] = "FREE";
|
|
28
|
+
IncidentEntitlementScope["UNCOVERED_TYPE"] = "UNCOVERED_TYPE";
|
|
18
29
|
})(IncidentEntitlementScope || (exports.IncidentEntitlementScope = IncidentEntitlementScope = {}));
|
|
19
30
|
//# sourceMappingURL=incident-entitlement-scope.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident-entitlement-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/entitlement/enums/incident-entitlement-scope.enum.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"incident-entitlement-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/entitlement/enums/incident-entitlement-scope.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,uCAAW,CAAA;IACX,iDAAqB,CAAA;IACrB,yCAAa,CAAA;IACb,6DAAiC,CAAA;AACrC,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Frontend mirrors of the partner enums in grm-shared-library.
|
|
4
|
+
*
|
|
5
|
+
* Kept in ONE file rather than one per enum: the admin's partner screens import
|
|
6
|
+
* most of them together, and the set only means anything as a whole. The values
|
|
7
|
+
* are byte-identical to the backend's, because they travel over the wire as
|
|
8
|
+
* strings and any drift would show up as a silently unstyled chip rather than a
|
|
9
|
+
* compile error.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PartnerDispatchScope = exports.IncidentPartnerRoutingStatus = exports.PartnerAdapterOperation = exports.PartnerLocationProvider = exports.PartnerDispatchFailureReason = exports.PartnerDispatchStatus = exports.PartnerCoverageMatchType = exports.PartnerIntegrationStatus = exports.PartnerIntegrationEnvironment = exports.PartnerRoutingMode = exports.PartnerServiceCapability = exports.PartnerProviderCode = void 0;
|
|
13
|
+
/** The third-party partner behind a partnership. */
|
|
14
|
+
var PartnerProviderCode;
|
|
15
|
+
(function (PartnerProviderCode) {
|
|
16
|
+
PartnerProviderCode["RESCUE_CO"] = "RESCUE_CO";
|
|
17
|
+
PartnerProviderCode["AAR"] = "AAR";
|
|
18
|
+
PartnerProviderCode["ST_JOHN"] = "ST_JOHN";
|
|
19
|
+
PartnerProviderCode["GENERIC_REST"] = "GENERIC_REST";
|
|
20
|
+
})(PartnerProviderCode || (exports.PartnerProviderCode = PartnerProviderCode = {}));
|
|
21
|
+
/** A class of emergency service a partner can be asked to provide. */
|
|
22
|
+
var PartnerServiceCapability;
|
|
23
|
+
(function (PartnerServiceCapability) {
|
|
24
|
+
PartnerServiceCapability["AMBULANCE"] = "AMBULANCE";
|
|
25
|
+
PartnerServiceCapability["MEDICAL_EVACUATION"] = "MEDICAL_EVACUATION";
|
|
26
|
+
PartnerServiceCapability["FIRE_RESPONSE"] = "FIRE_RESPONSE";
|
|
27
|
+
PartnerServiceCapability["SECURITY_RESPONSE"] = "SECURITY_RESPONSE";
|
|
28
|
+
PartnerServiceCapability["ROADSIDE_ASSISTANCE"] = "ROADSIDE_ASSISTANCE";
|
|
29
|
+
PartnerServiceCapability["TOWING"] = "TOWING";
|
|
30
|
+
PartnerServiceCapability["OTHER"] = "OTHER";
|
|
31
|
+
})(PartnerServiceCapability || (exports.PartnerServiceCapability = PartnerServiceCapability = {}));
|
|
32
|
+
/** How an incident a partnership covers reaches the partner. */
|
|
33
|
+
var PartnerRoutingMode;
|
|
34
|
+
(function (PartnerRoutingMode) {
|
|
35
|
+
/** Sent as soon as the incident is created. */
|
|
36
|
+
PartnerRoutingMode["AUTO"] = "AUTO";
|
|
37
|
+
/** Held until an operator confirms it. */
|
|
38
|
+
PartnerRoutingMode["MANUAL"] = "MANUAL";
|
|
39
|
+
/** Configuration kept, nothing routed. */
|
|
40
|
+
PartnerRoutingMode["DISABLED"] = "DISABLED";
|
|
41
|
+
})(PartnerRoutingMode || (exports.PartnerRoutingMode = PartnerRoutingMode = {}));
|
|
42
|
+
/** Which of a partner's environments a partnership points at. */
|
|
43
|
+
var PartnerIntegrationEnvironment;
|
|
44
|
+
(function (PartnerIntegrationEnvironment) {
|
|
45
|
+
PartnerIntegrationEnvironment["SANDBOX"] = "SANDBOX";
|
|
46
|
+
PartnerIntegrationEnvironment["PRODUCTION"] = "PRODUCTION";
|
|
47
|
+
})(PartnerIntegrationEnvironment || (exports.PartnerIntegrationEnvironment = PartnerIntegrationEnvironment = {}));
|
|
48
|
+
/** Last known health of a partnership's connection. Advisory only. */
|
|
49
|
+
var PartnerIntegrationStatus;
|
|
50
|
+
(function (PartnerIntegrationStatus) {
|
|
51
|
+
PartnerIntegrationStatus["UNKNOWN"] = "UNKNOWN";
|
|
52
|
+
PartnerIntegrationStatus["HEALTHY"] = "HEALTHY";
|
|
53
|
+
PartnerIntegrationStatus["DEGRADED"] = "DEGRADED";
|
|
54
|
+
PartnerIntegrationStatus["UNREACHABLE"] = "UNREACHABLE";
|
|
55
|
+
})(PartnerIntegrationStatus || (exports.PartnerIntegrationStatus = PartnerIntegrationStatus = {}));
|
|
56
|
+
/** What a coverage rule matches an incident on. */
|
|
57
|
+
var PartnerCoverageMatchType;
|
|
58
|
+
(function (PartnerCoverageMatchType) {
|
|
59
|
+
PartnerCoverageMatchType["ALL"] = "ALL";
|
|
60
|
+
PartnerCoverageMatchType["INCIDENT_TYPE"] = "INCIDENT_TYPE";
|
|
61
|
+
PartnerCoverageMatchType["INCIDENT_CATEGORY"] = "INCIDENT_CATEGORY";
|
|
62
|
+
PartnerCoverageMatchType["EMERGENCY_TYPE"] = "EMERGENCY_TYPE";
|
|
63
|
+
})(PartnerCoverageMatchType || (exports.PartnerCoverageMatchType = PartnerCoverageMatchType = {}));
|
|
64
|
+
/** Lifecycle of one incident's routing to one partner. */
|
|
65
|
+
var PartnerDispatchStatus;
|
|
66
|
+
(function (PartnerDispatchStatus) {
|
|
67
|
+
PartnerDispatchStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
68
|
+
PartnerDispatchStatus["QUEUED"] = "QUEUED";
|
|
69
|
+
PartnerDispatchStatus["SENDING"] = "SENDING";
|
|
70
|
+
PartnerDispatchStatus["SENT"] = "SENT";
|
|
71
|
+
PartnerDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
|
|
72
|
+
PartnerDispatchStatus["FAILED"] = "FAILED";
|
|
73
|
+
PartnerDispatchStatus["REJECTED"] = "REJECTED";
|
|
74
|
+
PartnerDispatchStatus["CANCELLED"] = "CANCELLED";
|
|
75
|
+
PartnerDispatchStatus["EXPIRED"] = "EXPIRED";
|
|
76
|
+
})(PartnerDispatchStatus || (exports.PartnerDispatchStatus = PartnerDispatchStatus = {}));
|
|
77
|
+
/** Why a dispatch did not reach its partner. */
|
|
78
|
+
var PartnerDispatchFailureReason;
|
|
79
|
+
(function (PartnerDispatchFailureReason) {
|
|
80
|
+
PartnerDispatchFailureReason["INVALID_PAYLOAD"] = "INVALID_PAYLOAD";
|
|
81
|
+
PartnerDispatchFailureReason["MISSING_REQUIRED_FIELD"] = "MISSING_REQUIRED_FIELD";
|
|
82
|
+
PartnerDispatchFailureReason["AUTHENTICATION_FAILED"] = "AUTHENTICATION_FAILED";
|
|
83
|
+
PartnerDispatchFailureReason["FEATURE_NOT_ENABLED"] = "FEATURE_NOT_ENABLED";
|
|
84
|
+
PartnerDispatchFailureReason["PROVIDER_REJECTED"] = "PROVIDER_REJECTED";
|
|
85
|
+
PartnerDispatchFailureReason["ADAPTER_NOT_SUPPORTED"] = "ADAPTER_NOT_SUPPORTED";
|
|
86
|
+
PartnerDispatchFailureReason["INTEGRATION_DISABLED"] = "INTEGRATION_DISABLED";
|
|
87
|
+
PartnerDispatchFailureReason["CREDENTIAL_UNAVAILABLE"] = "CREDENTIAL_UNAVAILABLE";
|
|
88
|
+
PartnerDispatchFailureReason["RATE_LIMITED"] = "RATE_LIMITED";
|
|
89
|
+
PartnerDispatchFailureReason["PROVIDER_UNAVAILABLE"] = "PROVIDER_UNAVAILABLE";
|
|
90
|
+
PartnerDispatchFailureReason["TIMEOUT"] = "TIMEOUT";
|
|
91
|
+
PartnerDispatchFailureReason["MAX_ATTEMPTS_EXCEEDED"] = "MAX_ATTEMPTS_EXCEEDED";
|
|
92
|
+
PartnerDispatchFailureReason["UNKNOWN"] = "UNKNOWN";
|
|
93
|
+
})(PartnerDispatchFailureReason || (exports.PartnerDispatchFailureReason = PartnerDispatchFailureReason = {}));
|
|
94
|
+
/** How the location attached to a dispatch was obtained. */
|
|
95
|
+
var PartnerLocationProvider;
|
|
96
|
+
(function (PartnerLocationProvider) {
|
|
97
|
+
PartnerLocationProvider["GPS"] = "GPS";
|
|
98
|
+
PartnerLocationProvider["NETWORK"] = "NETWORK";
|
|
99
|
+
PartnerLocationProvider["FUSED"] = "FUSED";
|
|
100
|
+
})(PartnerLocationProvider || (exports.PartnerLocationProvider = PartnerLocationProvider = {}));
|
|
101
|
+
/** The outbound partner call an attempt record describes. */
|
|
102
|
+
var PartnerAdapterOperation;
|
|
103
|
+
(function (PartnerAdapterOperation) {
|
|
104
|
+
PartnerAdapterOperation["AUTHENTICATE"] = "AUTHENTICATE";
|
|
105
|
+
PartnerAdapterOperation["HEALTH_CHECK"] = "HEALTH_CHECK";
|
|
106
|
+
PartnerAdapterOperation["DISPATCH"] = "DISPATCH";
|
|
107
|
+
})(PartnerAdapterOperation || (exports.PartnerAdapterOperation = PartnerAdapterOperation = {}));
|
|
108
|
+
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
109
|
+
var IncidentPartnerRoutingStatus;
|
|
110
|
+
(function (IncidentPartnerRoutingStatus) {
|
|
111
|
+
IncidentPartnerRoutingStatus["NOT_ROUTED"] = "NOT_ROUTED";
|
|
112
|
+
IncidentPartnerRoutingStatus["PENDING"] = "PENDING";
|
|
113
|
+
IncidentPartnerRoutingStatus["AWAITING_APPROVAL"] = "AWAITING_APPROVAL";
|
|
114
|
+
IncidentPartnerRoutingStatus["ROUTED"] = "ROUTED";
|
|
115
|
+
IncidentPartnerRoutingStatus["PARTIALLY_ROUTED"] = "PARTIALLY_ROUTED";
|
|
116
|
+
IncidentPartnerRoutingStatus["FAILED"] = "FAILED";
|
|
117
|
+
IncidentPartnerRoutingStatus["DECLINED"] = "DECLINED";
|
|
118
|
+
})(IncidentPartnerRoutingStatus || (exports.IncidentPartnerRoutingStatus = IncidentPartnerRoutingStatus = {}));
|
|
119
|
+
/** List filter for the admin's partner-routing incident views. */
|
|
120
|
+
var PartnerDispatchScope;
|
|
121
|
+
(function (PartnerDispatchScope) {
|
|
122
|
+
PartnerDispatchScope["ALL"] = "ALL";
|
|
123
|
+
PartnerDispatchScope["ROUTED"] = "ROUTED";
|
|
124
|
+
PartnerDispatchScope["AWAITING_APPROVAL"] = "AWAITING_APPROVAL";
|
|
125
|
+
PartnerDispatchScope["FAILED"] = "FAILED";
|
|
126
|
+
PartnerDispatchScope["NOT_ROUTED"] = "NOT_ROUTED";
|
|
127
|
+
})(PartnerDispatchScope || (exports.PartnerDispatchScope = PartnerDispatchScope = {}));
|
|
128
|
+
//# sourceMappingURL=partner-enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-enums.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oDAAoD;AACpD,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B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A;IACjB,iDAAyB,CAAA;AAC7B,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums
|
|
18
|
+
__exportStar(require("./enums/partner-enums"), exports);
|
|
19
|
+
// Interfaces / DTOs
|
|
20
|
+
__exportStar(require("./interfaces/partner-provider.dto"), exports);
|
|
21
|
+
__exportStar(require("./interfaces/partner-integration.dto"), exports);
|
|
22
|
+
__exportStar(require("./interfaces/partner-coverage-rule.dto"), exports);
|
|
23
|
+
__exportStar(require("./interfaces/partner-dispatch.dto"), exports);
|
|
24
|
+
__exportStar(require("./interfaces/incident-partner-routing.dto"), exports);
|
|
25
|
+
// Utilities
|
|
26
|
+
__exportStar(require("./utils/partner-display.util"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wDAAsC;AAEtC,oBAAoB;AACpB,oEAAkD;AAClD,uEAAqD;AACrD,yEAAuD;AACvD,oEAAkD;AAClD,4EAA0D;AAE1D,YAAY;AACZ,+DAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incident-partner-routing.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/incident-partner-routing.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-coverage-rule.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-coverage-rule.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-dispatch.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-integration.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-integration.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-provider.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-provider.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PARTNER_COVERAGE_MATCH_TYPE_LABELS = exports.PARTNER_CAPABILITY_LABELS = exports.PARTNER_INTEGRATION_STATUS_LABELS = exports.PARTNER_ROUTING_MODE_LABELS = exports.INCIDENT_PARTNER_ROUTING_STATUS_LABELS = exports.PARTNER_DISPATCH_STATUS_LABELS = void 0;
|
|
4
|
+
exports.partnerDispatchStatusTone = partnerDispatchStatusTone;
|
|
5
|
+
exports.incidentPartnerRoutingTone = incidentPartnerRoutingTone;
|
|
6
|
+
exports.partnerDispatchActions = partnerDispatchActions;
|
|
7
|
+
const partner_enums_1 = require("../enums/partner-enums");
|
|
8
|
+
/**
|
|
9
|
+
* Human labels for the partner enums.
|
|
10
|
+
*
|
|
11
|
+
* Kept in the shared package rather than in the admin app so every screen that
|
|
12
|
+
* shows a dispatch - the list, the detail drawer, the incident view - names the
|
|
13
|
+
* same state the same way. An operator reading "Waiting for confirmation" in one
|
|
14
|
+
* place and "Pending approval" in another would reasonably assume they were
|
|
15
|
+
* different things.
|
|
16
|
+
*/
|
|
17
|
+
exports.PARTNER_DISPATCH_STATUS_LABELS = {
|
|
18
|
+
[partner_enums_1.PartnerDispatchStatus.PENDING_APPROVAL]: 'Waiting for confirmation',
|
|
19
|
+
[partner_enums_1.PartnerDispatchStatus.QUEUED]: 'Queued',
|
|
20
|
+
[partner_enums_1.PartnerDispatchStatus.SENDING]: 'Sending',
|
|
21
|
+
[partner_enums_1.PartnerDispatchStatus.SENT]: 'Sent to partner',
|
|
22
|
+
[partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED]: 'Acknowledged by partner',
|
|
23
|
+
[partner_enums_1.PartnerDispatchStatus.FAILED]: 'Failed',
|
|
24
|
+
[partner_enums_1.PartnerDispatchStatus.REJECTED]: 'Declined',
|
|
25
|
+
[partner_enums_1.PartnerDispatchStatus.CANCELLED]: 'Withdrawn',
|
|
26
|
+
[partner_enums_1.PartnerDispatchStatus.EXPIRED]: 'Expired',
|
|
27
|
+
};
|
|
28
|
+
exports.INCIDENT_PARTNER_ROUTING_STATUS_LABELS = {
|
|
29
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.NOT_ROUTED]: 'No partner',
|
|
30
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.PENDING]: 'Contacting partner',
|
|
31
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.AWAITING_APPROVAL]: 'Waiting for confirmation',
|
|
32
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.ROUTED]: 'Partner notified',
|
|
33
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.PARTIALLY_ROUTED]: 'Partly notified',
|
|
34
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.FAILED]: 'Partner not reached',
|
|
35
|
+
[partner_enums_1.IncidentPartnerRoutingStatus.DECLINED]: 'Declined',
|
|
36
|
+
};
|
|
37
|
+
exports.PARTNER_ROUTING_MODE_LABELS = {
|
|
38
|
+
[partner_enums_1.PartnerRoutingMode.AUTO]: 'Automatic',
|
|
39
|
+
[partner_enums_1.PartnerRoutingMode.MANUAL]: 'Needs confirmation',
|
|
40
|
+
[partner_enums_1.PartnerRoutingMode.DISABLED]: 'Routing off',
|
|
41
|
+
};
|
|
42
|
+
exports.PARTNER_INTEGRATION_STATUS_LABELS = {
|
|
43
|
+
[partner_enums_1.PartnerIntegrationStatus.UNKNOWN]: 'Not tested',
|
|
44
|
+
[partner_enums_1.PartnerIntegrationStatus.HEALTHY]: 'Healthy',
|
|
45
|
+
[partner_enums_1.PartnerIntegrationStatus.DEGRADED]: 'Degraded',
|
|
46
|
+
[partner_enums_1.PartnerIntegrationStatus.UNREACHABLE]: 'Unreachable',
|
|
47
|
+
};
|
|
48
|
+
exports.PARTNER_CAPABILITY_LABELS = {
|
|
49
|
+
[partner_enums_1.PartnerServiceCapability.AMBULANCE]: 'Ambulance',
|
|
50
|
+
[partner_enums_1.PartnerServiceCapability.MEDICAL_EVACUATION]: 'Medical evacuation',
|
|
51
|
+
[partner_enums_1.PartnerServiceCapability.FIRE_RESPONSE]: 'Fire response',
|
|
52
|
+
[partner_enums_1.PartnerServiceCapability.SECURITY_RESPONSE]: 'Security response',
|
|
53
|
+
[partner_enums_1.PartnerServiceCapability.ROADSIDE_ASSISTANCE]: 'Roadside assistance',
|
|
54
|
+
[partner_enums_1.PartnerServiceCapability.TOWING]: 'Towing',
|
|
55
|
+
[partner_enums_1.PartnerServiceCapability.OTHER]: 'Other',
|
|
56
|
+
};
|
|
57
|
+
exports.PARTNER_COVERAGE_MATCH_TYPE_LABELS = {
|
|
58
|
+
[partner_enums_1.PartnerCoverageMatchType.ALL]: 'Every incident',
|
|
59
|
+
[partner_enums_1.PartnerCoverageMatchType.INCIDENT_TYPE]: 'Incident type',
|
|
60
|
+
[partner_enums_1.PartnerCoverageMatchType.INCIDENT_CATEGORY]: 'Incident category',
|
|
61
|
+
[partner_enums_1.PartnerCoverageMatchType.EMERGENCY_TYPE]: 'Emergency classification',
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Chip family for a dispatch status, matching the admin's existing chip
|
|
65
|
+
* vocabulary: `success` for anything the partner has, `warn` for anything still
|
|
66
|
+
* needing a human, `danger` for a failure, `neutral` for a settled non-event.
|
|
67
|
+
*/
|
|
68
|
+
function partnerDispatchStatusTone(status) {
|
|
69
|
+
switch (status) {
|
|
70
|
+
case partner_enums_1.PartnerDispatchStatus.SENT:
|
|
71
|
+
case partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED:
|
|
72
|
+
return 'success';
|
|
73
|
+
case partner_enums_1.PartnerDispatchStatus.PENDING_APPROVAL:
|
|
74
|
+
case partner_enums_1.PartnerDispatchStatus.QUEUED:
|
|
75
|
+
case partner_enums_1.PartnerDispatchStatus.SENDING:
|
|
76
|
+
return 'warn';
|
|
77
|
+
case partner_enums_1.PartnerDispatchStatus.FAILED:
|
|
78
|
+
case partner_enums_1.PartnerDispatchStatus.EXPIRED:
|
|
79
|
+
return 'danger';
|
|
80
|
+
default:
|
|
81
|
+
return 'neutral';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** The same tone mapping for the incident-level rolled-up status. */
|
|
85
|
+
function incidentPartnerRoutingTone(status) {
|
|
86
|
+
switch (status) {
|
|
87
|
+
case partner_enums_1.IncidentPartnerRoutingStatus.ROUTED:
|
|
88
|
+
return 'success';
|
|
89
|
+
case partner_enums_1.IncidentPartnerRoutingStatus.PENDING:
|
|
90
|
+
case partner_enums_1.IncidentPartnerRoutingStatus.AWAITING_APPROVAL:
|
|
91
|
+
case partner_enums_1.IncidentPartnerRoutingStatus.PARTIALLY_ROUTED:
|
|
92
|
+
return 'warn';
|
|
93
|
+
case partner_enums_1.IncidentPartnerRoutingStatus.FAILED:
|
|
94
|
+
return 'danger';
|
|
95
|
+
default:
|
|
96
|
+
return 'neutral';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
101
|
+
* buttons without duplicating the backend's transition rules.
|
|
102
|
+
*
|
|
103
|
+
* Withdrawing is deliberately impossible once the partner has the emergency:
|
|
104
|
+
* standing an ambulance down is a phone call to the partner, not a button here.
|
|
105
|
+
*/
|
|
106
|
+
function partnerDispatchActions(status) {
|
|
107
|
+
const pending = status === partner_enums_1.PartnerDispatchStatus.PENDING_APPROVAL;
|
|
108
|
+
return {
|
|
109
|
+
canApprove: pending,
|
|
110
|
+
canReject: pending,
|
|
111
|
+
canCancel: pending || status === partner_enums_1.PartnerDispatchStatus.QUEUED,
|
|
112
|
+
canResend: status === partner_enums_1.PartnerDispatchStatus.FAILED ||
|
|
113
|
+
status === partner_enums_1.PartnerDispatchStatus.EXPIRED,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=partner-display.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-display.util.js","sourceRoot":"","sources":["../../../../../src/modules/partner/utils/partner-display.util.ts"],"names":[],"mappings":";;;AAiFA,8DAiBC;AAGD,gEAeC;AASD,wDAeC;AA5ID,0DAOgC;AAEhC;;;;;;;;GAQG;AACU,QAAA,8BAA8B,GAAoD;IAC3F,CAAC,qCAAqB,CAAC,gBAAgB,CAAC,EAAE,0BAA0B;IACpE,CAAC,qCAAqB,CAAC,MAAM,CAAC,EAAE,QAAQ;IACxC,CAAC,qCAAqB,CAAC,OAAO,CAAC,EAAE,SAAS;IAC1C,CAAC,qCAAqB,CAAC,IAAI,CAAC,EAAE,iBAAiB;IAC/C,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QACpD,KAAK,4CAA4B,CAAC,gBAAgB;YAC9C,OAAO,MAAM,CAAC;QAClB,KAAK,4CAA4B,CAAC,MAAM;YACpC,OAAO,QAAQ,CAAC;QACpB;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAC,MAA6B;IAMhE,MAAM,OAAO,GAAG,MAAM,KAAK,qCAAqB,CAAC,gBAAgB,CAAC;IAClE,OAAO;QACH,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,OAAO,IAAI,MAAM,KAAK,qCAAqB,CAAC,MAAM;QAC7D,SAAS,EACL,MAAM,KAAK,qCAAqB,CAAC,MAAM;YACvC,MAAM,KAAK,qCAAqB,CAAC,OAAO;KAC/C,CAAC;AACN,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export * from './modules/country/index';
|
|
|
20
20
|
export * from './modules/tracking/index';
|
|
21
21
|
export * from './modules/entitlement/index';
|
|
22
22
|
export * from './modules/alert-dispatch/index';
|
|
23
|
+
export * from './modules/partner/index';
|
|
23
24
|
// Interfaces
|
|
24
25
|
export * from './modules/common/interfaces/server-message';
|
|
25
26
|
export * from './modules/common/interfaces/pagination';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AAExC,aAAa;AACb,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
* whether the reporter asked for the service provider to be alerted at all.
|
|
4
4
|
*
|
|
5
5
|
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
6
|
-
* DISPATCHED - only incidents the
|
|
7
|
-
* primary admin incident list, map and kanban views.
|
|
6
|
+
* DISPATCHED - only incidents the reporter asked the provider to receive.
|
|
7
|
+
* Used by the primary admin incident list, map and kanban views.
|
|
8
8
|
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
9
|
-
* provider. Backs the "
|
|
10
|
-
*
|
|
9
|
+
* provider. Backs the "Marked Ignore" admin views.
|
|
10
|
+
*
|
|
11
|
+
* Both read what the reporter ASKED FOR, not what they got. Entitlement can
|
|
12
|
+
* close the provider channel on its own, and an operator looking at a
|
|
13
|
+
* "Marked Ignore" list wants the alerts somebody chose to withhold - not the
|
|
14
|
+
* ones billing withheld for them.
|
|
11
15
|
*
|
|
12
16
|
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
13
17
|
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
14
|
-
* this one alert. The two compose
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* this one alert. The two compose into the admin's operator views:
|
|
19
|
+
*
|
|
20
|
+
* Incidents (list/map/kanban) ENTITLED + DISPATCHED
|
|
21
|
+
* Incident List - Marked Ignore ENTITLED + SUPPRESSED
|
|
22
|
+
* Incident List - Uncovered Types UNCOVERED_TYPE + DISPATCHED
|
|
23
|
+
* Uncovered Types - Marked Ignore UNCOVERED_TYPE + SUPPRESSED
|
|
24
|
+
* Incident List - Free Users FREE
|
|
17
25
|
*/
|
|
18
26
|
export var IncidentDispatchScope;
|
|
19
27
|
(function (IncidentDispatchScope) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,kDAAyB,CAAA;IACzB,kDAAyB,CAAA;AAC7B,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC"}
|