clarion-shared-types 1.0.101 → 1.0.103
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/modules/alert-intake/index.js +1 -0
- package/dist/cjs/modules/alert-intake/index.js.map +1 -1
- package/dist/cjs/modules/alert-intake/interfaces/alert-intake-analytics.js +3 -0
- package/dist/cjs/modules/alert-intake/interfaces/alert-intake-analytics.js.map +1 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +31 -6
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/role/constants/roles-by-scope.js +2 -1
- package/dist/cjs/modules/role/constants/roles-by-scope.js.map +1 -1
- package/dist/cjs/modules/role/enums/role.enum.js +6 -0
- package/dist/cjs/modules/role/enums/role.enum.js.map +1 -1
- package/dist/esm/modules/alert-intake/index.js +1 -0
- package/dist/esm/modules/alert-intake/index.js.map +1 -1
- package/dist/esm/modules/alert-intake/interfaces/alert-intake-analytics.js +2 -0
- package/dist/esm/modules/alert-intake/interfaces/alert-intake-analytics.js.map +1 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +31 -6
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/role/constants/roles-by-scope.js +2 -1
- package/dist/esm/modules/role/constants/roles-by-scope.js.map +1 -1
- package/dist/esm/modules/role/enums/role.enum.js +6 -0
- package/dist/esm/modules/role/enums/role.enum.js.map +1 -1
- package/dist/types/modules/alert-intake/index.d.ts +1 -0
- package/dist/types/modules/alert-intake/interfaces/alert-intake-analytics.d.ts +254 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +27 -3
- package/dist/types/modules/role/enums/role.enum.d.ts +6 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
__exportStar(require("./enums/alert-intake.enum"), exports);
|
|
19
19
|
// Response shapes + plain request interfaces
|
|
20
20
|
__exportStar(require("./interfaces/alert-intake"), exports);
|
|
21
|
+
__exportStar(require("./interfaces/alert-intake-analytics"), exports);
|
|
21
22
|
// Utilities
|
|
22
23
|
__exportStar(require("./utils/alert-intake.util"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-intake/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,4DAA0C;AAE1C,6CAA6C;AAC7C,4DAA0C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-intake/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,4DAA0C;AAE1C,6CAA6C;AAC7C,4DAA0C;AAC1C,sEAAoD;AAEpD,YAAY;AACZ,4DAA0C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-intake-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/alert-intake/interfaces/alert-intake-analytics.ts"],"names":[],"mappings":""}
|
|
@@ -112,19 +112,44 @@ var PermissionActions;
|
|
|
112
112
|
// Module: Notification
|
|
113
113
|
// An organization's notification settings (clarion-notification): how its
|
|
114
114
|
// emails are branded, the address they are sent from, and the sender ID its
|
|
115
|
-
// SMS arrive under. Mirrors grm-shared-library.
|
|
116
|
-
PermissionActions["
|
|
117
|
-
PermissionActions["
|
|
115
|
+
// SMS arrive under - one family per thing configured. Mirrors grm-shared-library.
|
|
116
|
+
PermissionActions["READ_NOTIFICATION_BRANDING"] = "read:notification-branding";
|
|
117
|
+
PermissionActions["UPDATE_NOTIFICATION_BRANDING"] = "update:notification-branding";
|
|
118
|
+
PermissionActions["CREATE_NOTIFICATION_EMAIL_SENDER"] = "create:notification-email-sender";
|
|
119
|
+
PermissionActions["READ_NOTIFICATION_EMAIL_SENDER"] = "read:notification-email-sender";
|
|
120
|
+
PermissionActions["UPDATE_NOTIFICATION_EMAIL_SENDER"] = "update:notification-email-sender";
|
|
121
|
+
PermissionActions["DELETE_NOTIFICATION_EMAIL_SENDER"] = "delete:notification-email-sender";
|
|
122
|
+
PermissionActions["CREATE_NOTIFICATION_SMS_SENDER"] = "create:notification-sms-sender";
|
|
123
|
+
PermissionActions["READ_NOTIFICATION_SMS_SENDER"] = "read:notification-sms-sender";
|
|
124
|
+
PermissionActions["UPDATE_NOTIFICATION_SMS_SENDER"] = "update:notification-sms-sender";
|
|
125
|
+
PermissionActions["DELETE_NOTIFICATION_SMS_SENDER"] = "delete:notification-sms-sender";
|
|
118
126
|
// Confirming that an SMS sender ID really is registered with the provider.
|
|
119
127
|
// Granted to NO role on the backend: only Super-Admin ('*') passes it.
|
|
120
128
|
PermissionActions["APPROVE_NOTIFICATION_SENDER"] = "approve:notification-sender";
|
|
129
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
130
|
+
PermissionActions["READ_NOTIFICATION_SETTINGS"] = "read:notification-settings";
|
|
131
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
132
|
+
PermissionActions["MANAGE_NOTIFICATION_SETTINGS"] = "manage:notification-settings";
|
|
121
133
|
// Module: Alert Intake
|
|
122
134
|
// The channels the PUBLIC reaches an organization on without the app - its SMS
|
|
123
|
-
// short code, WhatsApp number and mailbox (clarion-alerts)
|
|
124
|
-
|
|
125
|
-
PermissionActions["
|
|
135
|
+
// short code, WhatsApp number and mailbox (clarion-alerts) - configuring them, and
|
|
136
|
+
// working what arrives on them. Mirrors grm-shared-library.
|
|
137
|
+
PermissionActions["CREATE_ALERT_INTAKE_CONNECTION"] = "create:alert-intake-connection";
|
|
138
|
+
PermissionActions["READ_ALERT_INTAKE_CONNECTION"] = "read:alert-intake-connection";
|
|
139
|
+
PermissionActions["UPDATE_ALERT_INTAKE_CONNECTION"] = "update:alert-intake-connection";
|
|
140
|
+
PermissionActions["DELETE_ALERT_INTAKE_CONNECTION"] = "delete:alert-intake-connection";
|
|
141
|
+
PermissionActions["TEST_ALERT_INTAKE_CONNECTION"] = "test:alert-intake-connection";
|
|
142
|
+
PermissionActions["READ_ALERT_INTAKE_MESSAGE"] = "read:alert-intake-message";
|
|
143
|
+
PermissionActions["RETRY_ALERT_INTAKE_MESSAGE"] = "retry:alert-intake-message";
|
|
144
|
+
PermissionActions["READ_ALERT_INTAKE_SCREENED_MESSAGE"] = "read:alert-intake-screened-message";
|
|
145
|
+
PermissionActions["REVIEW_ALERT_INTAKE_SCREENED_MESSAGE"] = "review:alert-intake-screened-message";
|
|
146
|
+
PermissionActions["READ_ALERT_INTAKE_ANALYTICS"] = "read:alert-intake-analytics";
|
|
126
147
|
// PLATFORM connections and their routes (which keyword sends a message to which
|
|
127
148
|
// organization). Granted to NO role on the backend: only Super-Admin ('*') passes it.
|
|
128
149
|
PermissionActions["MANAGE_ALERT_INTAKE_PLATFORM"] = "manage:alert-intake-platform";
|
|
150
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
151
|
+
PermissionActions["READ_ALERT_INTAKE"] = "read:alert-intake";
|
|
152
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
153
|
+
PermissionActions["MANAGE_ALERT_INTAKE"] = "manage:alert-intake";
|
|
129
154
|
})(PermissionActions || (exports.PermissionActions = PermissionActions = {}));
|
|
130
155
|
//# sourceMappingURL=permission-actions.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBA+JX;AA/JD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,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A;IACjE,sFAAiE,CAAA;IACjE,kFAA6D,CAAA;IAC7D,4EAAuD,CAAA;IACvD,8EAAyD,CAAA;IACzD,8FAAyE,CAAA;IACzE,kGAA6E,CAAA;IAC7E,gFAA2D,CAAA;IAC3D,gFAAgF;IAChF,sFAAsF;IACtF,kFAA6D,CAAA;IAC7D,wGAAwG;IACxG,4DAAuC,CAAA;IACvC,wGAAwG;IACxG,gEAA2C,CAAA;AAC/C,CAAC,EA/JW,iBAAiB,iCAAjB,iBAAiB,QA+J5B"}
|
|
@@ -10,7 +10,8 @@ exports.ORGANIZATION_ROLES = [
|
|
|
10
10
|
role_enum_1.Roles.ORGANIZATION_NEWSFEED_ADMIN,
|
|
11
11
|
role_enum_1.Roles.ORGANIZATION_PARTNERSHIPS_ADMIN,
|
|
12
12
|
role_enum_1.Roles.ORGANIZATION_RESPONSE_UNITS_ADMIN,
|
|
13
|
-
role_enum_1.Roles.ORGANIZATION_SUPPORT_ADMIN
|
|
13
|
+
role_enum_1.Roles.ORGANIZATION_SUPPORT_ADMIN,
|
|
14
|
+
role_enum_1.Roles.ORGANIZATION_ALERT_CHANNELS_ADMIN
|
|
14
15
|
];
|
|
15
16
|
exports.CONTROL_CENTRE_ROLES = [
|
|
16
17
|
role_enum_1.Roles.CONTROL_CENTRE_ADMIN,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":";;;AAAA,kDAA2C;AAE9B,QAAA,kBAAkB,GAAa;IACxC,iBAAK,CAAC,kBAAkB;IACxB,iBAAK,CAAC,kBAAkB;IACxB,iBAAK,CAAC,iBAAiB;IACvB,iBAAK,CAAC,0BAA0B;IAChC,iBAAK,CAAC,2BAA2B;IACjC,iBAAK,CAAC,+BAA+B;IACrC,iBAAK,CAAC,iCAAiC;IACvC,iBAAK,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":";;;AAAA,kDAA2C;AAE9B,QAAA,kBAAkB,GAAa;IACxC,iBAAK,CAAC,kBAAkB;IACxB,iBAAK,CAAC,kBAAkB;IACxB,iBAAK,CAAC,iBAAiB;IACvB,iBAAK,CAAC,0BAA0B;IAChC,iBAAK,CAAC,2BAA2B;IACjC,iBAAK,CAAC,+BAA+B;IACrC,iBAAK,CAAC,iCAAiC;IACvC,iBAAK,CAAC,0BAA0B;IAChC,iBAAK,CAAC,iCAAiC;CAC1C,CAAC;AAEW,QAAA,oBAAoB,GAAa;IAC1C,iBAAK,CAAC,oBAAoB;IAC1B,iBAAK,CAAC,mBAAmB;IACzB,iBAAK,CAAC,SAAS;IACf,iBAAK,CAAC,mCAAmC;CAC5C,CAAC;AAEW,QAAA,YAAY,GAAa;IAClC,iBAAK,CAAC,WAAW;CACpB,CAAC"}
|
|
@@ -19,6 +19,12 @@ var Roles;
|
|
|
19
19
|
* concerns, so the role is scoped there rather than to a control centre.
|
|
20
20
|
*/
|
|
21
21
|
Roles["ORGANIZATION_SUPPORT_ADMIN"] = "Organization:Support-Admin";
|
|
22
|
+
/**
|
|
23
|
+
* Sets up and runs the organization's alert channels (SMS, WhatsApp, email) and
|
|
24
|
+
* works what arrives on them. Organization-scoped: configuring a channel decides
|
|
25
|
+
* whose emergencies arrive where.
|
|
26
|
+
*/
|
|
27
|
+
Roles["ORGANIZATION_ALERT_CHANNELS_ADMIN"] = "Organization:Alert-Channels-Admin";
|
|
22
28
|
Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
|
|
23
29
|
Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
|
|
24
30
|
/** The same job, confined to one control centre. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,KA6BX;AA7BD,WAAY,KAAK;IACb,oCAA2B,CAAA;IAC3B,kDAAyC,CAAA;IACzC,kDAAyC,CAAA;IACzC,gDAAuC,CAAA;IACvC,kEAAyD,CAAA;IACzD,oEAA2D,CAAA;IAC3D,0EAA0E;IAC1E,4EAAmE,CAAA;IACnE,gFAAgF;IAChF,gFAAuE,CAAA;IACvE;;;;OAIG;IACH,kEAAyD,CAAA;IACzD;;;;OAIG;IACH,gFAAuE,CAAA;IACvE,sDAA6C,CAAA;IAC7C,oDAA2C,CAAA;IAC3C,oDAAoD;IACpD,oFAA2E,CAAA;IAC3E,gCAAuB,CAAA;IACvB,oCAA2B,CAAA;AAC/B,CAAC,EA7BW,KAAK,qBAAL,KAAK,QA6BhB;AAED;;;;;;;;GAQG"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export * from './enums/alert-intake.enum';
|
|
3
3
|
// Response shapes + plain request interfaces
|
|
4
4
|
export * from './interfaces/alert-intake';
|
|
5
|
+
export * from './interfaces/alert-intake-analytics';
|
|
5
6
|
// Utilities
|
|
6
7
|
export * from './utils/alert-intake.util';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-intake/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAE1C,6CAA6C;AAC7C,cAAc,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-intake/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAE1C,6CAA6C;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AAEpD,YAAY;AACZ,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-intake-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/alert-intake/interfaces/alert-intake-analytics.ts"],"names":[],"mappings":""}
|
|
@@ -109,19 +109,44 @@ export var PermissionActions;
|
|
|
109
109
|
// Module: Notification
|
|
110
110
|
// An organization's notification settings (clarion-notification): how its
|
|
111
111
|
// emails are branded, the address they are sent from, and the sender ID its
|
|
112
|
-
// SMS arrive under. Mirrors grm-shared-library.
|
|
113
|
-
PermissionActions["
|
|
114
|
-
PermissionActions["
|
|
112
|
+
// SMS arrive under - one family per thing configured. Mirrors grm-shared-library.
|
|
113
|
+
PermissionActions["READ_NOTIFICATION_BRANDING"] = "read:notification-branding";
|
|
114
|
+
PermissionActions["UPDATE_NOTIFICATION_BRANDING"] = "update:notification-branding";
|
|
115
|
+
PermissionActions["CREATE_NOTIFICATION_EMAIL_SENDER"] = "create:notification-email-sender";
|
|
116
|
+
PermissionActions["READ_NOTIFICATION_EMAIL_SENDER"] = "read:notification-email-sender";
|
|
117
|
+
PermissionActions["UPDATE_NOTIFICATION_EMAIL_SENDER"] = "update:notification-email-sender";
|
|
118
|
+
PermissionActions["DELETE_NOTIFICATION_EMAIL_SENDER"] = "delete:notification-email-sender";
|
|
119
|
+
PermissionActions["CREATE_NOTIFICATION_SMS_SENDER"] = "create:notification-sms-sender";
|
|
120
|
+
PermissionActions["READ_NOTIFICATION_SMS_SENDER"] = "read:notification-sms-sender";
|
|
121
|
+
PermissionActions["UPDATE_NOTIFICATION_SMS_SENDER"] = "update:notification-sms-sender";
|
|
122
|
+
PermissionActions["DELETE_NOTIFICATION_SMS_SENDER"] = "delete:notification-sms-sender";
|
|
115
123
|
// Confirming that an SMS sender ID really is registered with the provider.
|
|
116
124
|
// Granted to NO role on the backend: only Super-Admin ('*') passes it.
|
|
117
125
|
PermissionActions["APPROVE_NOTIFICATION_SENDER"] = "approve:notification-sender";
|
|
126
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
127
|
+
PermissionActions["READ_NOTIFICATION_SETTINGS"] = "read:notification-settings";
|
|
128
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
129
|
+
PermissionActions["MANAGE_NOTIFICATION_SETTINGS"] = "manage:notification-settings";
|
|
118
130
|
// Module: Alert Intake
|
|
119
131
|
// The channels the PUBLIC reaches an organization on without the app - its SMS
|
|
120
|
-
// short code, WhatsApp number and mailbox (clarion-alerts)
|
|
121
|
-
|
|
122
|
-
PermissionActions["
|
|
132
|
+
// short code, WhatsApp number and mailbox (clarion-alerts) - configuring them, and
|
|
133
|
+
// working what arrives on them. Mirrors grm-shared-library.
|
|
134
|
+
PermissionActions["CREATE_ALERT_INTAKE_CONNECTION"] = "create:alert-intake-connection";
|
|
135
|
+
PermissionActions["READ_ALERT_INTAKE_CONNECTION"] = "read:alert-intake-connection";
|
|
136
|
+
PermissionActions["UPDATE_ALERT_INTAKE_CONNECTION"] = "update:alert-intake-connection";
|
|
137
|
+
PermissionActions["DELETE_ALERT_INTAKE_CONNECTION"] = "delete:alert-intake-connection";
|
|
138
|
+
PermissionActions["TEST_ALERT_INTAKE_CONNECTION"] = "test:alert-intake-connection";
|
|
139
|
+
PermissionActions["READ_ALERT_INTAKE_MESSAGE"] = "read:alert-intake-message";
|
|
140
|
+
PermissionActions["RETRY_ALERT_INTAKE_MESSAGE"] = "retry:alert-intake-message";
|
|
141
|
+
PermissionActions["READ_ALERT_INTAKE_SCREENED_MESSAGE"] = "read:alert-intake-screened-message";
|
|
142
|
+
PermissionActions["REVIEW_ALERT_INTAKE_SCREENED_MESSAGE"] = "review:alert-intake-screened-message";
|
|
143
|
+
PermissionActions["READ_ALERT_INTAKE_ANALYTICS"] = "read:alert-intake-analytics";
|
|
123
144
|
// PLATFORM connections and their routes (which keyword sends a message to which
|
|
124
145
|
// organization). Granted to NO role on the backend: only Super-Admin ('*') passes it.
|
|
125
146
|
PermissionActions["MANAGE_ALERT_INTAKE_PLATFORM"] = "manage:alert-intake-platform";
|
|
147
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
148
|
+
PermissionActions["READ_ALERT_INTAKE"] = "read:alert-intake";
|
|
149
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
150
|
+
PermissionActions["MANAGE_ALERT_INTAKE"] = "manage:alert-intake";
|
|
126
151
|
})(PermissionActions || (PermissionActions = {}));
|
|
127
152
|
//# sourceMappingURL=permission-actions.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBA+JX;AA/JD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAE3C,kBAAkB;IAClB,sDAAiC,CAAA;IACjC,kDAA6B,CAAA;IAC7B,sDAAiC,CAAA;IACjC,sDAAiC,CAAA;IACjC,wEAAwE;IACxE,mEAAmE;IACnE,oEAA+C,CAAA;IAC/C,0EAAqD,CAAA;IACrD,wEAAmD,CAAA;IACnD,wEAAmD,CAAA;IACnD,wEAAmD,CAAA;IACnD,2EAA2E;IAC3E,4EAA4E;IAC5E,qEAAqE;IACrE,uDAAuD;IACvD,wEAAmD,CAAA;IACnD,4EAAuD,CAAA;IAEvD,wBAAwB;IACxB,oEAA+C,CAAA;IAC/C,gEAA2C,CAAA;IAC3C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAE/C,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA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ADMIN
|
|
10
|
+
Roles.ORGANIZATION_SUPPORT_ADMIN,
|
|
11
|
+
Roles.ORGANIZATION_ALERT_CHANNELS_ADMIN
|
|
11
12
|
];
|
|
12
13
|
export const CONTROL_CENTRE_ROLES = [
|
|
13
14
|
Roles.CONTROL_CENTRE_ADMIN,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAa;IACxC,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,iBAAiB;IACvB,KAAK,CAAC,0BAA0B;IAChC,KAAK,CAAC,2BAA2B;IACjC,KAAK,CAAC,+BAA+B;IACrC,KAAK,CAAC,iCAAiC;IACvC,KAAK,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAa;IACxC,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,iBAAiB;IACvB,KAAK,CAAC,0BAA0B;IAChC,KAAK,CAAC,2BAA2B;IACjC,KAAK,CAAC,+BAA+B;IACrC,KAAK,CAAC,iCAAiC;IACvC,KAAK,CAAC,0BAA0B;IAChC,KAAK,CAAC,iCAAiC;CAC1C,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAa;IAC1C,KAAK,CAAC,oBAAoB;IAC1B,KAAK,CAAC,mBAAmB;IACzB,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,mCAAmC;CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,KAAK,CAAC,WAAW;CACpB,CAAC"}
|
|
@@ -16,6 +16,12 @@ export var Roles;
|
|
|
16
16
|
* concerns, so the role is scoped there rather than to a control centre.
|
|
17
17
|
*/
|
|
18
18
|
Roles["ORGANIZATION_SUPPORT_ADMIN"] = "Organization:Support-Admin";
|
|
19
|
+
/**
|
|
20
|
+
* Sets up and runs the organization's alert channels (SMS, WhatsApp, email) and
|
|
21
|
+
* works what arrives on them. Organization-scoped: configuring a channel decides
|
|
22
|
+
* whose emergencies arrive where.
|
|
23
|
+
*/
|
|
24
|
+
Roles["ORGANIZATION_ALERT_CHANNELS_ADMIN"] = "Organization:Alert-Channels-Admin";
|
|
19
25
|
Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
|
|
20
26
|
Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
|
|
21
27
|
/** The same job, confined to one control centre. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KA6BX;AA7BD,WAAY,KAAK;IACb,oCAA2B,CAAA;IAC3B,kDAAyC,CAAA;IACzC,kDAAyC,CAAA;IACzC,gDAAuC,CAAA;IACvC,kEAAyD,CAAA;IACzD,oEAA2D,CAAA;IAC3D,0EAA0E;IAC1E,4EAAmE,CAAA;IACnE,gFAAgF;IAChF,gFAAuE,CAAA;IACvE;;;;OAIG;IACH,kEAAyD,CAAA;IACzD;;;;OAIG;IACH,gFAAuE,CAAA;IACvE,sDAA6C,CAAA;IAC7C,oDAA2C,CAAA;IAC3C,oDAAoD;IACpD,oFAA2E,CAAA;IAC3E,gCAAuB,CAAA;IACvB,oCAA2B,CAAA;AAC/B,CAAC,EA7BW,KAAK,KAAL,KAAK,QA6BhB;AAED;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { AlertIntakeChannel, AlertIntakeMessageState, AlertIntakeScreeningReason, AlertIntakeScreeningSource, AlertIntakeScreeningStatus } from '../enums/alert-intake.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Alert intake analytics: what arrived on an organization's channels over a period, what
|
|
4
|
+
* became of it, what the AI made of it and what that cost. One read, computed by
|
|
5
|
+
* clarion-alerts from one consistent snapshot, so every number on a dashboard agrees with
|
|
6
|
+
* every other.
|
|
7
|
+
*
|
|
8
|
+
* Counts only: no message text, sender or credential is ever part of it.
|
|
9
|
+
*/
|
|
10
|
+
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
11
|
+
export type AlertIntakeAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
12
|
+
/** The AI tasks whose calls are metered. */
|
|
13
|
+
export type AlertIntakeAiTask = 'triage' | 'analysis' | 'transcription';
|
|
14
|
+
export interface AlertIntakeAnalyticsRange {
|
|
15
|
+
/** Inclusive, ISO 8601. The first message received when the period asked for was "forever". */
|
|
16
|
+
from: string;
|
|
17
|
+
/** Exclusive, ISO 8601. */
|
|
18
|
+
to: string;
|
|
19
|
+
bucket: AlertIntakeAnalyticsBucket;
|
|
20
|
+
/** IANA time zone the buckets and the hour-of-week grid are cut in. */
|
|
21
|
+
timeZone: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The headline counts. Messages are counted by when they arrived.
|
|
25
|
+
*
|
|
26
|
+
* received = raised + screenedOut + duplicates + retrying + parked + queued: every message
|
|
27
|
+
* is in exactly one of those, as it stands now.
|
|
28
|
+
*/
|
|
29
|
+
export interface AlertIntakeAnalyticsTotals {
|
|
30
|
+
received: number;
|
|
31
|
+
/** Became incidents (grievances, for a grievance desk) - including screened messages a reviewer raised. */
|
|
32
|
+
raised: number;
|
|
33
|
+
/** Screened out as not a report and not raised since (waiting for review, or dismissed). */
|
|
34
|
+
screenedOut: number;
|
|
35
|
+
duplicates: number;
|
|
36
|
+
retrying: number;
|
|
37
|
+
parked: number;
|
|
38
|
+
/** Waiting for, or being worked on by, the pipeline. */
|
|
39
|
+
queued: number;
|
|
40
|
+
/** Distinct phone numbers, WhatsApp numbers and email addresses. Never the values themselves. */
|
|
41
|
+
uniqueSenders: number;
|
|
42
|
+
withAttachments: number;
|
|
43
|
+
sharedLocations: number;
|
|
44
|
+
/** Written in a language other than English, and translated. */
|
|
45
|
+
translated: number;
|
|
46
|
+
voiceNotes: number;
|
|
47
|
+
emergencies: number;
|
|
48
|
+
sensitive: number;
|
|
49
|
+
anonymous: number;
|
|
50
|
+
acknowledged: number;
|
|
51
|
+
acknowledgementFailed: number;
|
|
52
|
+
/** Median seconds from arrival to the incident being raised; null when nothing was raised. */
|
|
53
|
+
medianSecondsToIncident: number | null;
|
|
54
|
+
p90SecondsToIncident: number | null;
|
|
55
|
+
/** AI spend in the period, US dollars. */
|
|
56
|
+
aiCostUsd: number;
|
|
57
|
+
}
|
|
58
|
+
/** The previous period of the same length, for the change shown on each headline figure. Null for "forever". */
|
|
59
|
+
export interface AlertIntakeAnalyticsComparison {
|
|
60
|
+
from: string;
|
|
61
|
+
to: string;
|
|
62
|
+
received: number;
|
|
63
|
+
raised: number;
|
|
64
|
+
screenedOut: number;
|
|
65
|
+
uniqueSenders: number;
|
|
66
|
+
medianSecondsToIncident: number | null;
|
|
67
|
+
aiCostUsd: number;
|
|
68
|
+
}
|
|
69
|
+
/** One point on the message timeline. `bucket` is the start of the point, local to `timeZone`, ISO 8601 without an offset. */
|
|
70
|
+
export interface AlertIntakeAnalyticsTimelinePoint {
|
|
71
|
+
bucket: string;
|
|
72
|
+
received: number;
|
|
73
|
+
raised: number;
|
|
74
|
+
screenedOut: number;
|
|
75
|
+
duplicates: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
}
|
|
78
|
+
/** Where messages stand now; the parts add up to `received`. `failed` is retrying and parked together. */
|
|
79
|
+
export interface AlertIntakeAnalyticsOutcomes {
|
|
80
|
+
received: number;
|
|
81
|
+
raised: number;
|
|
82
|
+
screenedOut: number;
|
|
83
|
+
duplicates: number;
|
|
84
|
+
failed: number;
|
|
85
|
+
queued: number;
|
|
86
|
+
}
|
|
87
|
+
export interface AlertIntakeAnalyticsChannelRow extends AlertIntakeAnalyticsOutcomes {
|
|
88
|
+
channel: AlertIntakeChannel;
|
|
89
|
+
medianSecondsToIncident: number | null;
|
|
90
|
+
}
|
|
91
|
+
export interface AlertIntakeAnalyticsConnectionRow extends AlertIntakeAnalyticsOutcomes {
|
|
92
|
+
/** Null for messages received before connections existed. */
|
|
93
|
+
connectionId: string | null;
|
|
94
|
+
name: string;
|
|
95
|
+
channel: AlertIntakeChannel | null;
|
|
96
|
+
provider: string | null;
|
|
97
|
+
enabled: boolean | null;
|
|
98
|
+
lastReceivedAt: string | null;
|
|
99
|
+
/** The connection's current error, if it is failing. */
|
|
100
|
+
lastError: string | null;
|
|
101
|
+
}
|
|
102
|
+
export interface AlertIntakeAnalyticsCount<K extends string | number | null = string> {
|
|
103
|
+
key: K;
|
|
104
|
+
count: number;
|
|
105
|
+
}
|
|
106
|
+
/** Every screening decision on messages received in the period - including those a reviewer later raised. */
|
|
107
|
+
export interface AlertIntakeAnalyticsScreening {
|
|
108
|
+
byReason: AlertIntakeAnalyticsCount<AlertIntakeScreeningReason>[];
|
|
109
|
+
byDecider: AlertIntakeAnalyticsCount<AlertIntakeScreeningSource>[];
|
|
110
|
+
byStatus: AlertIntakeAnalyticsCount<AlertIntakeScreeningStatus>[];
|
|
111
|
+
/** Mean confidence of the model's screening decisions (0-1); null without any. */
|
|
112
|
+
averageAiConfidence: number | null;
|
|
113
|
+
/** Median hours from being screened out to a person's decision; null without reviews. */
|
|
114
|
+
medianHoursToReview: number | null;
|
|
115
|
+
/** Screened messages still waiting for a person - now, whatever the period. */
|
|
116
|
+
awaitingReview: number;
|
|
117
|
+
}
|
|
118
|
+
export interface AlertIntakeAnalyticsLanguageRow {
|
|
119
|
+
/** ISO 639-1, or `und` when it could not be told. */
|
|
120
|
+
language: string;
|
|
121
|
+
count: number;
|
|
122
|
+
translated: number;
|
|
123
|
+
}
|
|
124
|
+
export interface AlertIntakeAnalyticsCategoryRow {
|
|
125
|
+
categoryId: number | null;
|
|
126
|
+
/** The organization's category name; "Uncategorised" for reports filed without one. */
|
|
127
|
+
name: string;
|
|
128
|
+
count: number;
|
|
129
|
+
}
|
|
130
|
+
export interface AlertIntakeAnalyticsLocations {
|
|
131
|
+
/** Reports placed on the map, by how: the sender's shared pin, or a place named in the message. */
|
|
132
|
+
shared: number;
|
|
133
|
+
geocoded: number;
|
|
134
|
+
unresolved: number;
|
|
135
|
+
byCountry: AlertIntakeAnalyticsCount[];
|
|
136
|
+
}
|
|
137
|
+
export interface AlertIntakeAnalyticsAttachments {
|
|
138
|
+
files: number;
|
|
139
|
+
attached: number;
|
|
140
|
+
failed: number;
|
|
141
|
+
/** `image`, `audio`, `video`, `document`. */
|
|
142
|
+
byKind: Array<{
|
|
143
|
+
kind: string;
|
|
144
|
+
files: number;
|
|
145
|
+
attached: number;
|
|
146
|
+
failed: number;
|
|
147
|
+
}>;
|
|
148
|
+
}
|
|
149
|
+
/** Arrivals by weekday (1 = Monday ... 7 = Sunday) and hour (0-23), in `timeZone`. All 168 cells, zeros included. */
|
|
150
|
+
export interface AlertIntakeAnalyticsHeatCell {
|
|
151
|
+
weekday: number;
|
|
152
|
+
hour: number;
|
|
153
|
+
count: number;
|
|
154
|
+
}
|
|
155
|
+
export interface AlertIntakeAiTaskRow {
|
|
156
|
+
task: AlertIntakeAiTask;
|
|
157
|
+
calls: number;
|
|
158
|
+
failed: number;
|
|
159
|
+
cached: number;
|
|
160
|
+
inputTokens: number;
|
|
161
|
+
cachedInputTokens: number;
|
|
162
|
+
outputTokens: number;
|
|
163
|
+
reasoningTokens: number;
|
|
164
|
+
audioSeconds: number;
|
|
165
|
+
costUsd: number;
|
|
166
|
+
averageLatencyMs: number | null;
|
|
167
|
+
p90LatencyMs: number | null;
|
|
168
|
+
}
|
|
169
|
+
export interface AlertIntakeAiModelRow {
|
|
170
|
+
model: string;
|
|
171
|
+
task: AlertIntakeAiTask;
|
|
172
|
+
calls: number;
|
|
173
|
+
inputTokens: number;
|
|
174
|
+
outputTokens: number;
|
|
175
|
+
costUsd: number;
|
|
176
|
+
/** Calls whose model had no price in the service's price table: their cost is not in `costUsd`. */
|
|
177
|
+
unpricedCalls: number;
|
|
178
|
+
}
|
|
179
|
+
export interface AlertIntakeAiTimelinePoint {
|
|
180
|
+
bucket: string;
|
|
181
|
+
calls: number;
|
|
182
|
+
inputTokens: number;
|
|
183
|
+
outputTokens: number;
|
|
184
|
+
costUsd: number;
|
|
185
|
+
}
|
|
186
|
+
export interface AlertIntakeAnalyticsAi {
|
|
187
|
+
calls: number;
|
|
188
|
+
failed: number;
|
|
189
|
+
cached: number;
|
|
190
|
+
inputTokens: number;
|
|
191
|
+
cachedInputTokens: number;
|
|
192
|
+
outputTokens: number;
|
|
193
|
+
reasoningTokens: number;
|
|
194
|
+
audioSeconds: number;
|
|
195
|
+
costUsd: number;
|
|
196
|
+
/** AI spend divided by messages received / incidents raised in the period; null when there were none. */
|
|
197
|
+
costPerMessageUsd: number | null;
|
|
198
|
+
costPerIncidentUsd: number | null;
|
|
199
|
+
byTask: AlertIntakeAiTaskRow[];
|
|
200
|
+
byModel: AlertIntakeAiModelRow[];
|
|
201
|
+
timeline: AlertIntakeAiTimelinePoint[];
|
|
202
|
+
/** When the prices used were last reviewed (the service's price table), ISO date. */
|
|
203
|
+
pricesAsOf: string;
|
|
204
|
+
}
|
|
205
|
+
/** Platform view only: one row per organization. */
|
|
206
|
+
export interface AlertIntakeAnalyticsOrganizationRow {
|
|
207
|
+
organizationId: number | null;
|
|
208
|
+
name: string;
|
|
209
|
+
received: number;
|
|
210
|
+
raised: number;
|
|
211
|
+
screenedOut: number;
|
|
212
|
+
aiCostUsd: number;
|
|
213
|
+
}
|
|
214
|
+
export interface AlertIntakeAnalytics {
|
|
215
|
+
/** Null for the platform view across every organization. */
|
|
216
|
+
organizationId: number | null;
|
|
217
|
+
range: AlertIntakeAnalyticsRange;
|
|
218
|
+
generatedAt: string;
|
|
219
|
+
totals: AlertIntakeAnalyticsTotals;
|
|
220
|
+
previous: AlertIntakeAnalyticsComparison | null;
|
|
221
|
+
timeline: AlertIntakeAnalyticsTimelinePoint[];
|
|
222
|
+
byState: AlertIntakeAnalyticsCount<AlertIntakeMessageState>[];
|
|
223
|
+
/** Every channel, zeros included. */
|
|
224
|
+
byChannel: AlertIntakeAnalyticsChannelRow[];
|
|
225
|
+
/**
|
|
226
|
+
* The organization's own connections - including those that received nothing - and any
|
|
227
|
+
* platform connection that carried its messages (without that connection's status).
|
|
228
|
+
*/
|
|
229
|
+
byConnection: AlertIntakeAnalyticsConnectionRow[];
|
|
230
|
+
screening: AlertIntakeAnalyticsScreening;
|
|
231
|
+
languages: AlertIntakeAnalyticsLanguageRow[];
|
|
232
|
+
categories: AlertIntakeAnalyticsCategoryRow[];
|
|
233
|
+
/** Low, Medium, High, Critical. */
|
|
234
|
+
priorities: AlertIntakeAnalyticsCount[];
|
|
235
|
+
locations: AlertIntakeAnalyticsLocations;
|
|
236
|
+
attachments: AlertIntakeAnalyticsAttachments;
|
|
237
|
+
heatmap: AlertIntakeAnalyticsHeatCell[];
|
|
238
|
+
ai: AlertIntakeAnalyticsAi;
|
|
239
|
+
/** Platform view only. */
|
|
240
|
+
byOrganization?: AlertIntakeAnalyticsOrganizationRow[];
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The period an analytics read covers (query string). Both ends optional: no `from` is
|
|
244
|
+
* "forever", no `to` is now. ISO 8601 instants; `timeZone` is an IANA name.
|
|
245
|
+
*/
|
|
246
|
+
export interface AlertIntakeAnalyticsQuery {
|
|
247
|
+
from?: string;
|
|
248
|
+
to?: string;
|
|
249
|
+
timeZone?: string;
|
|
250
|
+
}
|
|
251
|
+
/** Platform operators: every organization's analytics, or one organization's. */
|
|
252
|
+
export interface PlatformAlertIntakeAnalyticsQuery extends AlertIntakeAnalyticsQuery {
|
|
253
|
+
organizationId?: number;
|
|
254
|
+
}
|
|
@@ -82,10 +82,34 @@ export declare enum PermissionActions {
|
|
|
82
82
|
READ_SUPPORT_REPORT = "read:support-report",
|
|
83
83
|
READ_SUPPORT_SYNC = "read:support-sync",
|
|
84
84
|
MANAGE_SUPPORT_SYNC = "manage:support-sync",
|
|
85
|
+
READ_NOTIFICATION_BRANDING = "read:notification-branding",
|
|
86
|
+
UPDATE_NOTIFICATION_BRANDING = "update:notification-branding",
|
|
87
|
+
CREATE_NOTIFICATION_EMAIL_SENDER = "create:notification-email-sender",
|
|
88
|
+
READ_NOTIFICATION_EMAIL_SENDER = "read:notification-email-sender",
|
|
89
|
+
UPDATE_NOTIFICATION_EMAIL_SENDER = "update:notification-email-sender",
|
|
90
|
+
DELETE_NOTIFICATION_EMAIL_SENDER = "delete:notification-email-sender",
|
|
91
|
+
CREATE_NOTIFICATION_SMS_SENDER = "create:notification-sms-sender",
|
|
92
|
+
READ_NOTIFICATION_SMS_SENDER = "read:notification-sms-sender",
|
|
93
|
+
UPDATE_NOTIFICATION_SMS_SENDER = "update:notification-sms-sender",
|
|
94
|
+
DELETE_NOTIFICATION_SMS_SENDER = "delete:notification-sms-sender",
|
|
95
|
+
APPROVE_NOTIFICATION_SENDER = "approve:notification-sender",
|
|
96
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
85
97
|
READ_NOTIFICATION_SETTINGS = "read:notification-settings",
|
|
98
|
+
/** @deprecated Retiring: split into the branding / email sender / SMS sender actions. */
|
|
86
99
|
MANAGE_NOTIFICATION_SETTINGS = "manage:notification-settings",
|
|
87
|
-
|
|
100
|
+
CREATE_ALERT_INTAKE_CONNECTION = "create:alert-intake-connection",
|
|
101
|
+
READ_ALERT_INTAKE_CONNECTION = "read:alert-intake-connection",
|
|
102
|
+
UPDATE_ALERT_INTAKE_CONNECTION = "update:alert-intake-connection",
|
|
103
|
+
DELETE_ALERT_INTAKE_CONNECTION = "delete:alert-intake-connection",
|
|
104
|
+
TEST_ALERT_INTAKE_CONNECTION = "test:alert-intake-connection",
|
|
105
|
+
READ_ALERT_INTAKE_MESSAGE = "read:alert-intake-message",
|
|
106
|
+
RETRY_ALERT_INTAKE_MESSAGE = "retry:alert-intake-message",
|
|
107
|
+
READ_ALERT_INTAKE_SCREENED_MESSAGE = "read:alert-intake-screened-message",
|
|
108
|
+
REVIEW_ALERT_INTAKE_SCREENED_MESSAGE = "review:alert-intake-screened-message",
|
|
109
|
+
READ_ALERT_INTAKE_ANALYTICS = "read:alert-intake-analytics",
|
|
110
|
+
MANAGE_ALERT_INTAKE_PLATFORM = "manage:alert-intake-platform",
|
|
111
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
88
112
|
READ_ALERT_INTAKE = "read:alert-intake",
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
/** @deprecated Retiring: split into the connection / message / screened-message / analytics actions. */
|
|
114
|
+
MANAGE_ALERT_INTAKE = "manage:alert-intake"
|
|
91
115
|
}
|
|
@@ -15,6 +15,12 @@ export declare enum Roles {
|
|
|
15
15
|
* concerns, so the role is scoped there rather than to a control centre.
|
|
16
16
|
*/
|
|
17
17
|
ORGANIZATION_SUPPORT_ADMIN = "Organization:Support-Admin",
|
|
18
|
+
/**
|
|
19
|
+
* Sets up and runs the organization's alert channels (SMS, WhatsApp, email) and
|
|
20
|
+
* works what arrives on them. Organization-scoped: configuring a channel decides
|
|
21
|
+
* whose emergencies arrive where.
|
|
22
|
+
*/
|
|
23
|
+
ORGANIZATION_ALERT_CHANNELS_ADMIN = "Organization:Alert-Channels-Admin",
|
|
18
24
|
CONTROL_CENTRE_ADMIN = "Control-Centre:Admin",
|
|
19
25
|
CONTROL_CENTRE_USER = "Control-Centre:User",
|
|
20
26
|
/** The same job, confined to one control centre. */
|