clarion-shared-types 1.0.113 → 1.0.114
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/chat/index.js +1 -0
- package/dist/cjs/modules/chat/index.js.map +1 -1
- package/dist/cjs/modules/chat/interfaces/chat-analytics.js +35 -0
- package/dist/cjs/modules/chat/interfaces/chat-analytics.js.map +1 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +3 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/chat/index.js +1 -0
- package/dist/esm/modules/chat/index.js.map +1 -1
- package/dist/esm/modules/chat/interfaces/chat-analytics.js +34 -0
- package/dist/esm/modules/chat/interfaces/chat-analytics.js.map +1 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +3 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/types/modules/chat/index.d.ts +1 -0
- package/dist/types/modules/chat/interfaces/chat-analytics.d.ts +275 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +1 -0
- package/package.json +45 -45
|
@@ -25,6 +25,7 @@ __exportStar(require("./interfaces/chat-conversation-with-participants"), export
|
|
|
25
25
|
__exportStar(require("./interfaces/chat-message"), exports);
|
|
26
26
|
__exportStar(require("./interfaces/chat-participant"), exports);
|
|
27
27
|
__exportStar(require("./interfaces/chat-presence-info"), exports);
|
|
28
|
+
__exportStar(require("./interfaces/chat-analytics"), exports);
|
|
28
29
|
// constants
|
|
29
30
|
__exportStar(require("./constants/chat-ws-events"), exports);
|
|
30
31
|
__exportStar(require("./constants/chat-room-names"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/chat/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wEAAsD;AACtD,sEAAoD;AACpD,iEAA+C;AAC/C,qEAAmD;AAEnD,aAAa;AACb,iEAA+C;AAC/C,mFAAiE;AACjE,4DAA0C;AAC1C,gEAA8C;AAC9C,kEAAgD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/chat/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wEAAsD;AACtD,sEAAoD;AACpD,iEAA+C;AAC/C,qEAAmD;AAEnD,aAAa;AACb,iEAA+C;AAC/C,mFAAiE;AACjE,4DAA0C;AAC1C,gEAA8C;AAC9C,kEAAgD;AAChD,8DAA4C;AAE5C,YAAY;AACZ,6DAA2C;AAC3C,8DAA4C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Chat analytics (the admin's Chat Analytics): how the conversations on Clarion went over
|
|
4
|
+
* a period - incident chats, Follow Me chats and direct chats - how much was written and
|
|
5
|
+
* by whom, and above all how quickly a member who wrote was answered.
|
|
6
|
+
*
|
|
7
|
+
* One read, computed by clarion-chat from one consistent snapshot, with who each person
|
|
8
|
+
* is from clarion-authentication. Counts, rates and durations only: never a message, a
|
|
9
|
+
* member's name or a trip's label. The only people named are STAFF - the control room,
|
|
10
|
+
* responders and administrators - as agents are on the support analytics.
|
|
11
|
+
*
|
|
12
|
+
* DURATIONS ARE IN SECONDS, like every analytics contract.
|
|
13
|
+
*
|
|
14
|
+
* How it is counted:
|
|
15
|
+
* - A conversation belongs to the organization, control centre and country of the
|
|
16
|
+
* person who STARTED it: the member who raised the SOS, the traveller on a Follow Me
|
|
17
|
+
* trip, the administrator who opened a direct chat. clarion-chat keeps no organization
|
|
18
|
+
* of its own. Everything written in a conversation is its organization's, whoever
|
|
19
|
+
* wrote it - a guardian, or a responder from another organization.
|
|
20
|
+
* - What a conversation is for (`ChatAnalyticsContext`): INCIDENT is an incident's chat,
|
|
21
|
+
* including a Follow Me chat that an SOS adopted; FOLLOW_ME a trip's; DIRECT one person
|
|
22
|
+
* to another; GROUP any other group.
|
|
23
|
+
* - Who writes (`ChatAnalyticsSenderKind`), from the roles a person holds NOW: anybody
|
|
24
|
+
* with a control-centre role is the CONTROL_ROOM, then RESPONDER, then ADMINISTRATOR
|
|
25
|
+
* (organization roles, Super-Admin) - together, STAFF. Everybody else is a MEMBER: the
|
|
26
|
+
* people the service is for, their guardians included. UNKNOWN is an account that no
|
|
27
|
+
* longer exists. Whoever started an incident's or a Follow Me chat from the app is its
|
|
28
|
+
* MEMBER there, whatever else they hold - staff raise SOSes too.
|
|
29
|
+
* - A member's TURN starts with a member's message that opens a conversation or follows
|
|
30
|
+
* a staff message. It is ANSWERED by the first staff message after it, and the wait is
|
|
31
|
+
* the time between. Turns started in the period, answered whenever.
|
|
32
|
+
* - System messages are counted on their own and never take part in a turn.
|
|
33
|
+
*/
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
//# sourceMappingURL=chat-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/chat/interfaces/chat-analytics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
|
|
@@ -54,6 +54,9 @@ var PermissionActions;
|
|
|
54
54
|
PermissionActions["READ_INCIDENT"] = "read:incident";
|
|
55
55
|
PermissionActions["UPDATE_INCIDENT"] = "update:incident";
|
|
56
56
|
PermissionActions["DELETE_INCIDENT"] = "delete:incident";
|
|
57
|
+
// Chat Analytics: how the chats went and how quickly members were answered - totals
|
|
58
|
+
// only. Held by exactly the roles that read the user analytics.
|
|
59
|
+
PermissionActions["READ_CHAT_ANALYTICS"] = "read:chat-analytics";
|
|
57
60
|
PermissionActions["CREATE_INCIDENT_CATEGORY_TYPE"] = "create:incident-category-type";
|
|
58
61
|
PermissionActions["READ_INCIDENT_CATEGORY_TYPE"] = "read:incident-category-type";
|
|
59
62
|
PermissionActions["UPDATE_INCIDENT_CATEGORY_TYPE"] = "update:incident-category-type";
|
|
@@ -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,iBAmSX;AAnSD,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;IACvD,+EAA+E;IAC/E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,2EAA2E;IAC3E,sEAAiD,CAAA;IAEjD,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,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAC3B,4GAA4G;IAC5G,gEAA2C,CAAA;IAE3C,mBAAmB;IACnB,wDAAmC,CAAA;IACnC,oDAA+B,CAAA;I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gD;IAChD,0DAAqC,CAAA;IACrC,4DAAuC,CAAA;IACvC,8EAAyD,CAAA;IACzD,2EAA2E;IAC3E,oEAA+C,CAAA;IAC/C,iFAAiF;IACjF,4EAA4E;IAC5E,mEAAmE;IACnE,oDAA+B,CAAA;IAC/B,sDAAiC,CAAA;IACjC,wDAAmC,CAAA;IAEnC,4DAA4D;IAC5D,8DAAyC,CAAA;IACzC,wGAAwG;IACxG,4DAAuC,CAAA;IACvC,wGAAwG;IACxG,gEAA2C,CAAA;AAC/C,CAAC,EAnSW,iBAAiB,iCAAjB,iBAAiB,QAmS5B"}
|
|
@@ -9,6 +9,7 @@ export * from './interfaces/chat-conversation-with-participants';
|
|
|
9
9
|
export * from './interfaces/chat-message';
|
|
10
10
|
export * from './interfaces/chat-participant';
|
|
11
11
|
export * from './interfaces/chat-presence-info';
|
|
12
|
+
export * from './interfaces/chat-analytics';
|
|
12
13
|
// constants
|
|
13
14
|
export * from './constants/chat-ws-events';
|
|
14
15
|
export * from './constants/chat-room-names';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/chat/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kDAAkD,CAAC;AACjE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/chat/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kDAAkD,CAAC;AACjE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAE5C,YAAY;AACZ,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat analytics (the admin's Chat Analytics): how the conversations on Clarion went over
|
|
3
|
+
* a period - incident chats, Follow Me chats and direct chats - how much was written and
|
|
4
|
+
* by whom, and above all how quickly a member who wrote was answered.
|
|
5
|
+
*
|
|
6
|
+
* One read, computed by clarion-chat from one consistent snapshot, with who each person
|
|
7
|
+
* is from clarion-authentication. Counts, rates and durations only: never a message, a
|
|
8
|
+
* member's name or a trip's label. The only people named are STAFF - the control room,
|
|
9
|
+
* responders and administrators - as agents are on the support analytics.
|
|
10
|
+
*
|
|
11
|
+
* DURATIONS ARE IN SECONDS, like every analytics contract.
|
|
12
|
+
*
|
|
13
|
+
* How it is counted:
|
|
14
|
+
* - A conversation belongs to the organization, control centre and country of the
|
|
15
|
+
* person who STARTED it: the member who raised the SOS, the traveller on a Follow Me
|
|
16
|
+
* trip, the administrator who opened a direct chat. clarion-chat keeps no organization
|
|
17
|
+
* of its own. Everything written in a conversation is its organization's, whoever
|
|
18
|
+
* wrote it - a guardian, or a responder from another organization.
|
|
19
|
+
* - What a conversation is for (`ChatAnalyticsContext`): INCIDENT is an incident's chat,
|
|
20
|
+
* including a Follow Me chat that an SOS adopted; FOLLOW_ME a trip's; DIRECT one person
|
|
21
|
+
* to another; GROUP any other group.
|
|
22
|
+
* - Who writes (`ChatAnalyticsSenderKind`), from the roles a person holds NOW: anybody
|
|
23
|
+
* with a control-centre role is the CONTROL_ROOM, then RESPONDER, then ADMINISTRATOR
|
|
24
|
+
* (organization roles, Super-Admin) - together, STAFF. Everybody else is a MEMBER: the
|
|
25
|
+
* people the service is for, their guardians included. UNKNOWN is an account that no
|
|
26
|
+
* longer exists. Whoever started an incident's or a Follow Me chat from the app is its
|
|
27
|
+
* MEMBER there, whatever else they hold - staff raise SOSes too.
|
|
28
|
+
* - A member's TURN starts with a member's message that opens a conversation or follows
|
|
29
|
+
* a staff message. It is ANSWERED by the first staff message after it, and the wait is
|
|
30
|
+
* the time between. Turns started in the period, answered whenever.
|
|
31
|
+
* - System messages are counted on their own and never take part in a turn.
|
|
32
|
+
*/
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=chat-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/chat/interfaces/chat-analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
|
|
@@ -51,6 +51,9 @@ export var PermissionActions;
|
|
|
51
51
|
PermissionActions["READ_INCIDENT"] = "read:incident";
|
|
52
52
|
PermissionActions["UPDATE_INCIDENT"] = "update:incident";
|
|
53
53
|
PermissionActions["DELETE_INCIDENT"] = "delete:incident";
|
|
54
|
+
// Chat Analytics: how the chats went and how quickly members were answered - totals
|
|
55
|
+
// only. Held by exactly the roles that read the user analytics.
|
|
56
|
+
PermissionActions["READ_CHAT_ANALYTICS"] = "read:chat-analytics";
|
|
54
57
|
PermissionActions["CREATE_INCIDENT_CATEGORY_TYPE"] = "create:incident-category-type";
|
|
55
58
|
PermissionActions["READ_INCIDENT_CATEGORY_TYPE"] = "read:incident-category-type";
|
|
56
59
|
PermissionActions["UPDATE_INCIDENT_CATEGORY_TYPE"] = "update:incident-category-type";
|
|
@@ -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":["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EnC,4DAA4D;IAC5D,8DAAyC,CAAA;IACzC,wGAAwG;IACxG,4DAAuC,CAAA;IACvC,wGAAwG;IACxG,gEAA2C,CAAA;AAC/C,CAAC,EAnSW,iBAAiB,KAAjB,iBAAiB,QAmS5B"}
|
|
@@ -7,5 +7,6 @@ export * from './interfaces/chat-conversation-with-participants';
|
|
|
7
7
|
export * from './interfaces/chat-message';
|
|
8
8
|
export * from './interfaces/chat-participant';
|
|
9
9
|
export * from './interfaces/chat-presence-info';
|
|
10
|
+
export * from './interfaces/chat-analytics';
|
|
10
11
|
export * from './constants/chat-ws-events';
|
|
11
12
|
export * from './constants/chat-room-names';
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat analytics (the admin's Chat Analytics): how the conversations on Clarion went over
|
|
3
|
+
* a period - incident chats, Follow Me chats and direct chats - how much was written and
|
|
4
|
+
* by whom, and above all how quickly a member who wrote was answered.
|
|
5
|
+
*
|
|
6
|
+
* One read, computed by clarion-chat from one consistent snapshot, with who each person
|
|
7
|
+
* is from clarion-authentication. Counts, rates and durations only: never a message, a
|
|
8
|
+
* member's name or a trip's label. The only people named are STAFF - the control room,
|
|
9
|
+
* responders and administrators - as agents are on the support analytics.
|
|
10
|
+
*
|
|
11
|
+
* DURATIONS ARE IN SECONDS, like every analytics contract.
|
|
12
|
+
*
|
|
13
|
+
* How it is counted:
|
|
14
|
+
* - A conversation belongs to the organization, control centre and country of the
|
|
15
|
+
* person who STARTED it: the member who raised the SOS, the traveller on a Follow Me
|
|
16
|
+
* trip, the administrator who opened a direct chat. clarion-chat keeps no organization
|
|
17
|
+
* of its own. Everything written in a conversation is its organization's, whoever
|
|
18
|
+
* wrote it - a guardian, or a responder from another organization.
|
|
19
|
+
* - What a conversation is for (`ChatAnalyticsContext`): INCIDENT is an incident's chat,
|
|
20
|
+
* including a Follow Me chat that an SOS adopted; FOLLOW_ME a trip's; DIRECT one person
|
|
21
|
+
* to another; GROUP any other group.
|
|
22
|
+
* - Who writes (`ChatAnalyticsSenderKind`), from the roles a person holds NOW: anybody
|
|
23
|
+
* with a control-centre role is the CONTROL_ROOM, then RESPONDER, then ADMINISTRATOR
|
|
24
|
+
* (organization roles, Super-Admin) - together, STAFF. Everybody else is a MEMBER: the
|
|
25
|
+
* people the service is for, their guardians included. UNKNOWN is an account that no
|
|
26
|
+
* longer exists. Whoever started an incident's or a Follow Me chat from the app is its
|
|
27
|
+
* MEMBER there, whatever else they hold - staff raise SOSes too.
|
|
28
|
+
* - A member's TURN starts with a member's message that opens a conversation or follows
|
|
29
|
+
* a staff message. It is ANSWERED by the first staff message after it, and the wait is
|
|
30
|
+
* the time between. Turns started in the period, answered whenever.
|
|
31
|
+
* - System messages are counted on their own and never take part in a turn.
|
|
32
|
+
*/
|
|
33
|
+
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
34
|
+
export type ChatAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
35
|
+
/** What a conversation is for. */
|
|
36
|
+
export type ChatAnalyticsContext = 'INCIDENT' | 'FOLLOW_ME' | 'DIRECT' | 'GROUP';
|
|
37
|
+
/** Who wrote a message: the three kinds of staff, a member, or an account that no longer exists. */
|
|
38
|
+
export type ChatAnalyticsSenderKind = 'CONTROL_ROOM' | 'RESPONDER' | 'ADMINISTRATOR' | 'MEMBER' | 'UNKNOWN';
|
|
39
|
+
export interface ChatAnalyticsRange {
|
|
40
|
+
/** Inclusive, ISO 8601. The first conversation when the period asked for was "forever". */
|
|
41
|
+
from: string;
|
|
42
|
+
/** Exclusive, ISO 8601. */
|
|
43
|
+
to: string;
|
|
44
|
+
bucket: ChatAnalyticsBucket;
|
|
45
|
+
/** IANA time zone the buckets and the hour-of-week grid are cut in. */
|
|
46
|
+
timeZone: string;
|
|
47
|
+
}
|
|
48
|
+
/** A count by a key (a context, a kind, a band), largest first unless the section says otherwise. */
|
|
49
|
+
export interface ChatAnalyticsCount<K extends string = string> {
|
|
50
|
+
key: K;
|
|
51
|
+
count: number;
|
|
52
|
+
}
|
|
53
|
+
/** Median and 90th percentile of one duration, in seconds; null when nothing was measured. */
|
|
54
|
+
export interface ChatAnalyticsDuration {
|
|
55
|
+
median: number | null;
|
|
56
|
+
p90: number | null;
|
|
57
|
+
/** How many were measured. */
|
|
58
|
+
count: number;
|
|
59
|
+
}
|
|
60
|
+
/** One kind of conversation and how it went in the period. */
|
|
61
|
+
export interface ChatAnalyticsContextRow {
|
|
62
|
+
context: ChatAnalyticsContext;
|
|
63
|
+
/** Started in the period. */
|
|
64
|
+
started: number;
|
|
65
|
+
/** Of those, written in at least once (whenever). */
|
|
66
|
+
used: number;
|
|
67
|
+
/** Written in during the period, whenever started. */
|
|
68
|
+
active: number;
|
|
69
|
+
/** Messages written in the period, not counting system messages. */
|
|
70
|
+
messages: number;
|
|
71
|
+
memberMessages: number;
|
|
72
|
+
staffMessages: number;
|
|
73
|
+
/** Members' turns started in the period, and of those answered. */
|
|
74
|
+
turns: number;
|
|
75
|
+
answered: number;
|
|
76
|
+
/** answered / turns, as a percentage. */
|
|
77
|
+
replyRate: number | null;
|
|
78
|
+
medianSecondsToReply: number | null;
|
|
79
|
+
}
|
|
80
|
+
/** The conversations: what was started, what was used, and who was in them. */
|
|
81
|
+
export interface ChatAnalyticsConversations {
|
|
82
|
+
/** Started in the period. */
|
|
83
|
+
started: number;
|
|
84
|
+
/** Of those, written in at least once (whenever) - and as a percentage. */
|
|
85
|
+
used: number;
|
|
86
|
+
usedRate: number | null;
|
|
87
|
+
/** Of those, a member AND staff both wrote in - a conversation rather than a notice. */
|
|
88
|
+
twoWay: number;
|
|
89
|
+
/** Written in during the period, whenever started. */
|
|
90
|
+
active: number;
|
|
91
|
+
/** People seated in the conversations started in the period, each counted once. */
|
|
92
|
+
people: number;
|
|
93
|
+
/** People per conversation started in the period. */
|
|
94
|
+
averageParticipants: number | null;
|
|
95
|
+
/**
|
|
96
|
+
* In the period, in any conversation in scope: people added AFTER it started (a
|
|
97
|
+
* responder assigned, a guardian added - not the people it started with), and seats
|
|
98
|
+
* given up (removed, or left).
|
|
99
|
+
*/
|
|
100
|
+
joined: number;
|
|
101
|
+
left: number;
|
|
102
|
+
/** Start to the first message - conversations started in the period that were used. */
|
|
103
|
+
toFirstMessage: ChatAnalyticsDuration;
|
|
104
|
+
/** Start to the first staff message - conversations started in the period that staff wrote in. */
|
|
105
|
+
toFirstStaffMessage: ChatAnalyticsDuration;
|
|
106
|
+
/** INCIDENT, FOLLOW_ME, DIRECT, GROUP - in that order, zeros included. */
|
|
107
|
+
byContext: ChatAnalyticsContextRow[];
|
|
108
|
+
/** Conversations started in the period by how many people are in them now: 1, 2, 3, 4, 5, 6+ - in that order. */
|
|
109
|
+
bySize: ChatAnalyticsCount[];
|
|
110
|
+
/** Conversations started in the period, by the country of whoever started them. */
|
|
111
|
+
byCountry: ChatAnalyticsCount[];
|
|
112
|
+
}
|
|
113
|
+
/** The messages written in the period. */
|
|
114
|
+
export interface ChatAnalyticsMessages {
|
|
115
|
+
/** Written by people (system messages are `system`). */
|
|
116
|
+
sent: number;
|
|
117
|
+
fromMembers: number;
|
|
118
|
+
fromStaff: number;
|
|
119
|
+
/** By accounts that no longer exist. */
|
|
120
|
+
fromUnknown: number;
|
|
121
|
+
system: number;
|
|
122
|
+
/** Removed in the period, whenever written. */
|
|
123
|
+
removed: number;
|
|
124
|
+
/** Different people who wrote. */
|
|
125
|
+
senders: number;
|
|
126
|
+
memberSenders: number;
|
|
127
|
+
staffSenders: number;
|
|
128
|
+
/** sent / active conversations. */
|
|
129
|
+
perActiveConversation: number | null;
|
|
130
|
+
/** CONTROL_ROOM, RESPONDER, ADMINISTRATOR, MEMBER, UNKNOWN - in that order, zeros included. */
|
|
131
|
+
bySenderKind: ChatAnalyticsCount<ChatAnalyticsSenderKind>[];
|
|
132
|
+
/** Characters, never the words. */
|
|
133
|
+
medianLength: number | null;
|
|
134
|
+
/** SHORT (under 20 characters), MEDIUM (20-79), LONG (80-279), VERY_LONG (280+) - in that order. */
|
|
135
|
+
byLength: ChatAnalyticsCount[];
|
|
136
|
+
}
|
|
137
|
+
/** How quickly members were answered. */
|
|
138
|
+
export interface ChatAnalyticsReplies {
|
|
139
|
+
/** Members' turns started in the period. */
|
|
140
|
+
turns: number;
|
|
141
|
+
answered: number;
|
|
142
|
+
/** Never answered - the last word in that conversation is still the member's. */
|
|
143
|
+
unanswered: number;
|
|
144
|
+
/** answered / turns, as a percentage. */
|
|
145
|
+
replyRate: number | null;
|
|
146
|
+
/** The member's message to the first staff message after it - turns answered. */
|
|
147
|
+
toReply: ChatAnalyticsDuration;
|
|
148
|
+
/** Answered within a minute, 5 minutes, 15 minutes, an hour, later: UNDER_1M, 1-5M, 5-15M, 15-60M, OVER_1H - in that order. */
|
|
149
|
+
byWait: ChatAnalyticsCount[];
|
|
150
|
+
/** Answered within 5 minutes, as a percentage of turns. */
|
|
151
|
+
withinFiveMinutes: number | null;
|
|
152
|
+
}
|
|
153
|
+
/** One member of staff who wrote in the period. Staff are named; members never are. */
|
|
154
|
+
export interface ChatAnalyticsStaffRow {
|
|
155
|
+
userId: number;
|
|
156
|
+
name: string | null;
|
|
157
|
+
kind: ChatAnalyticsSenderKind;
|
|
158
|
+
/** Messages they wrote in the period. */
|
|
159
|
+
messages: number;
|
|
160
|
+
/** Conversations they wrote in, in the period. */
|
|
161
|
+
conversations: number;
|
|
162
|
+
/** Members' turns started in the period that they were first to answer. */
|
|
163
|
+
replies: number;
|
|
164
|
+
medianSecondsToReply: number | null;
|
|
165
|
+
}
|
|
166
|
+
/** One conversation, for a table - never its messages, its members or its label. */
|
|
167
|
+
export interface ChatAnalyticsConversationRow {
|
|
168
|
+
id: string;
|
|
169
|
+
context: ChatAnalyticsContext;
|
|
170
|
+
/** The incident it belongs to, for an incident's chat. */
|
|
171
|
+
incidentId: number | null;
|
|
172
|
+
organizationId: number | null;
|
|
173
|
+
startedAt: string;
|
|
174
|
+
/** People in it now. */
|
|
175
|
+
participants: number;
|
|
176
|
+
/** Written in the period. */
|
|
177
|
+
messages: number;
|
|
178
|
+
memberMessages: number;
|
|
179
|
+
staffMessages: number;
|
|
180
|
+
/** Its latest message, whenever. */
|
|
181
|
+
lastMessageAt: string | null;
|
|
182
|
+
/** Its members' turns started in the period, answered. */
|
|
183
|
+
medianSecondsToReply: number | null;
|
|
184
|
+
/** The last word is a member's, and nobody from staff has answered it. */
|
|
185
|
+
awaitingReply: boolean;
|
|
186
|
+
/** When that unanswered member's turn began; null when nothing is waiting. */
|
|
187
|
+
waitingSince: string | null;
|
|
188
|
+
}
|
|
189
|
+
/** One point on the charts: a bucket of the period. */
|
|
190
|
+
export interface ChatAnalyticsPoint {
|
|
191
|
+
/** Local wall-clock start of the bucket, in `range.timeZone` (no offset). */
|
|
192
|
+
bucket: string;
|
|
193
|
+
/** Conversations started in the bucket, and of those incident chats. */
|
|
194
|
+
started: number;
|
|
195
|
+
incidentChats: number;
|
|
196
|
+
memberMessages: number;
|
|
197
|
+
staffMessages: number;
|
|
198
|
+
/** Conversations written in during the bucket. */
|
|
199
|
+
active: number;
|
|
200
|
+
/** Members' turns started in the bucket, and of those answered. */
|
|
201
|
+
turns: number;
|
|
202
|
+
answered: number;
|
|
203
|
+
medianSecondsToReply: number | null;
|
|
204
|
+
}
|
|
205
|
+
/** One hour of the week. Weekday 1 is Monday. */
|
|
206
|
+
export interface ChatAnalyticsHeatCell {
|
|
207
|
+
weekday: number;
|
|
208
|
+
hour: number;
|
|
209
|
+
/** When members write. */
|
|
210
|
+
memberMessages: number;
|
|
211
|
+
/** When staff write. */
|
|
212
|
+
staffMessages: number;
|
|
213
|
+
}
|
|
214
|
+
/** The previous period of the same length, for the change on each headline figure. */
|
|
215
|
+
export interface ChatAnalyticsPrevious {
|
|
216
|
+
from: string;
|
|
217
|
+
to: string;
|
|
218
|
+
started: number;
|
|
219
|
+
used: number;
|
|
220
|
+
active: number;
|
|
221
|
+
sent: number;
|
|
222
|
+
memberMessages: number;
|
|
223
|
+
staffMessages: number;
|
|
224
|
+
senders: number;
|
|
225
|
+
turns: number;
|
|
226
|
+
answered: number;
|
|
227
|
+
replyRate: number | null;
|
|
228
|
+
medianSecondsToReply: number | null;
|
|
229
|
+
}
|
|
230
|
+
/** A Super-Admin's view of every organization: one row each, busiest first. */
|
|
231
|
+
export interface ChatAnalyticsOrganizationRow {
|
|
232
|
+
organizationId: number;
|
|
233
|
+
started: number;
|
|
234
|
+
active: number;
|
|
235
|
+
sent: number;
|
|
236
|
+
memberMessages: number;
|
|
237
|
+
staffMessages: number;
|
|
238
|
+
turns: number;
|
|
239
|
+
replyRate: number | null;
|
|
240
|
+
medianSecondsToReply: number | null;
|
|
241
|
+
}
|
|
242
|
+
export interface ChatAnalytics {
|
|
243
|
+
/** Whose figures: one organization (and one control centre in it), or null for every organization. */
|
|
244
|
+
organizationId: number | null;
|
|
245
|
+
controlCentreId: number | null;
|
|
246
|
+
/** The one country the figures are narrowed to, or null for every country. */
|
|
247
|
+
countryCode: string | null;
|
|
248
|
+
range: ChatAnalyticsRange;
|
|
249
|
+
generatedAt: string;
|
|
250
|
+
previous: ChatAnalyticsPrevious | null;
|
|
251
|
+
/** Countries with conversations in scope, whatever country is chosen - for narrowing to one. */
|
|
252
|
+
countryOptions: ChatAnalyticsCount[];
|
|
253
|
+
conversations: ChatAnalyticsConversations;
|
|
254
|
+
messages: ChatAnalyticsMessages;
|
|
255
|
+
replies: ChatAnalyticsReplies;
|
|
256
|
+
/** Staff who wrote in the period, busiest first - at most 25. */
|
|
257
|
+
staff: ChatAnalyticsStaffRow[];
|
|
258
|
+
/** The 15 conversations most written in during the period. */
|
|
259
|
+
busiest: ChatAnalyticsConversationRow[];
|
|
260
|
+
/** Conversations written in during the period whose member is still waiting for an answer, latest first - at most 25. */
|
|
261
|
+
waiting: ChatAnalyticsConversationRow[];
|
|
262
|
+
timeline: ChatAnalyticsPoint[];
|
|
263
|
+
/** All 168 hours of the week, Monday first, zeros included. */
|
|
264
|
+
heatmap: ChatAnalyticsHeatCell[];
|
|
265
|
+
/** A Super-Admin looking at every organization only. */
|
|
266
|
+
byOrganization?: ChatAnalyticsOrganizationRow[];
|
|
267
|
+
}
|
|
268
|
+
/** What a dashboard asks: the period, one country - and, for a Super-Admin, whose figures. */
|
|
269
|
+
export interface ChatAnalyticsQuery {
|
|
270
|
+
from?: string;
|
|
271
|
+
to?: string;
|
|
272
|
+
timeZone?: string;
|
|
273
|
+
organizationId?: number;
|
|
274
|
+
countryCode?: string;
|
|
275
|
+
}
|
|
@@ -32,6 +32,7 @@ export declare enum PermissionActions {
|
|
|
32
32
|
READ_INCIDENT = "read:incident",
|
|
33
33
|
UPDATE_INCIDENT = "update:incident",
|
|
34
34
|
DELETE_INCIDENT = "delete:incident",
|
|
35
|
+
READ_CHAT_ANALYTICS = "read:chat-analytics",
|
|
35
36
|
CREATE_INCIDENT_CATEGORY_TYPE = "create:incident-category-type",
|
|
36
37
|
READ_INCIDENT_CATEGORY_TYPE = "read:incident-category-type",
|
|
37
38
|
UPDATE_INCIDENT_CATEGORY_TYPE = "update:incident-category-type",
|
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.114",
|
|
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
|
+
}
|