clarion-shared-types 1.0.114 → 1.0.115

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.
@@ -31,4 +31,6 @@ __exportStar(require("./interfaces/notification-dispatch-result"), exports);
31
31
  __exportStar(require("./interfaces/organization-notification-settings.dto"), exports);
32
32
  // Utilities
33
33
  __exportStar(require("./utils/notification-sender.util"), exports);
34
+ // Notification Analytics (GET /notifications/admin/analytics)
35
+ __exportStar(require("./interfaces/notification-analytics"), exports);
34
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,oEAAkD;AAClD,iEAA+C;AAC/C,mEAAiD;AACjD,2EAAyD;AACzD,uEAAqD;AACrD,sEAAoD;AAEpD,4CAA4C;AAC5C,gEAA8C;AAC9C,kEAAgD;AAChD,+DAA6C;AAC7C,iEAA+C;AAC/C,4EAA0D;AAE1D,kEAAkE;AAClE,sFAAoE;AAEpE,YAAY;AACZ,mEAAiD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,oEAAkD;AAClD,iEAA+C;AAC/C,mEAAiD;AACjD,2EAAyD;AACzD,uEAAqD;AACrD,sEAAoD;AAEpD,4CAA4C;AAC5C,gEAA8C;AAC9C,kEAAgD;AAChD,+DAA6C;AAC7C,iEAA+C;AAC/C,4EAA0D;AAE1D,kEAAkE;AAClE,sFAAoE;AAEpE,YAAY;AACZ,mEAAiD;AAEjD,8DAA8D;AAC9D,sEAAoD"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * Notification analytics (the admin's Notification Analytics): what Clarion sent people
4
+ * over a period, on every channel - push to the app, the console's in-app notifications,
5
+ * SMS and email - whether it got through, whether it was opened, and how many people a
6
+ * push can reach at all.
7
+ *
8
+ * One read, computed by clarion-notification from one consistent snapshot, with who each
9
+ * recipient is from clarion-authentication. Counts, rates and durations only: never a
10
+ * title, a message, a phone number or an address.
11
+ *
12
+ * DURATIONS ARE IN SECONDS, like every analytics contract.
13
+ *
14
+ * How it is counted:
15
+ * - Everything by when it was CREATED - the moment Clarion decided to tell somebody.
16
+ * - Whose it is: the organization recorded on it; for a push, the organization of the
17
+ * post it announces, then the recipient's; for an SMS, the recipient's. Older SMS and
18
+ * email (before 21 September 2026) recorded no organization and often no recipient:
19
+ * those are counted only in the platform view (`unattributed`).
20
+ * - Got through: accepted by the provider - Firebase for a push, the SMS gateway, the
21
+ * mail service - or, in the console, delivered. Nothing reports whether an SMS or an
22
+ * email was read, so only push (tapped) and in-app (read) have an open rate.
23
+ * - A country narrows push, in-app and devices by the recipient's country and SMS by
24
+ * the number's; email has no country and is never narrowed.
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ //# sourceMappingURL=notification-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-analytics.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
@@ -128,6 +128,9 @@ var PermissionActions;
128
128
  // emails are branded, the address they are sent from, and the sender ID its
129
129
  // SMS arrive under - one family per thing configured. Mirrors grm-shared-library.
130
130
  PermissionActions["READ_NOTIFICATION_BRANDING"] = "read:notification-branding";
131
+ // Notification Analytics: what went out on every channel and whether it got
132
+ // through - totals only. Held by exactly the roles that read the notification settings.
133
+ PermissionActions["READ_NOTIFICATION_ANALYTICS"] = "read:notification-analytics";
131
134
  PermissionActions["UPDATE_NOTIFICATION_BRANDING"] = "update:notification-branding";
132
135
  PermissionActions["CREATE_NOTIFICATION_EMAIL_SENDER"] = "create:notification-email-sender";
133
136
  PermissionActions["READ_NOTIFICATION_EMAIL_SENDER"] = "read:notification-email-sender";
@@ -1 +1 @@
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;IAC/B,wDAAmC,CAAA;IACnC,wDAAmC,CAAA;IACnC,oFAAoF;IACpF,gEAAgE;IAChE,gEAA2C,CAAA;IAC3C,oFAA+D,CAAA;IAC/D,gFAA2D,CAAA;IAC3D,oFAA+D,CAAA;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AA+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"}
1
+ {"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAsSX;AAtSD,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;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;IAC3D,gFAAgF;IAChF,sFAAsF;IACtF,kFAA6D,CAAA;IAE7D,gFAAgF;IAChF,0EAA0E;IAC1E,gDAAgD;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,EAtSW,iBAAiB,iCAAjB,iBAAiB,QAsS5B"}
@@ -15,4 +15,6 @@ export * from './interfaces/notification-dispatch-result';
15
15
  export * from './interfaces/organization-notification-settings.dto';
16
16
  // Utilities
17
17
  export * from './utils/notification-sender.util';
18
+ // Notification Analytics (GET /notifications/admin/analytics)
19
+ export * from './interfaces/notification-analytics';
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AAEpD,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAE1D,kEAAkE;AAClE,cAAc,qDAAqD,CAAC;AAEpE,YAAY;AACZ,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AAEpD,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAE1D,kEAAkE;AAClE,cAAc,qDAAqD,CAAC;AAEpE,YAAY;AACZ,cAAc,kCAAkC,CAAC;AAEjD,8DAA8D;AAC9D,cAAc,qCAAqC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Notification analytics (the admin's Notification Analytics): what Clarion sent people
3
+ * over a period, on every channel - push to the app, the console's in-app notifications,
4
+ * SMS and email - whether it got through, whether it was opened, and how many people a
5
+ * push can reach at all.
6
+ *
7
+ * One read, computed by clarion-notification from one consistent snapshot, with who each
8
+ * recipient is from clarion-authentication. Counts, rates and durations only: never a
9
+ * title, a message, a phone number or an address.
10
+ *
11
+ * DURATIONS ARE IN SECONDS, like every analytics contract.
12
+ *
13
+ * How it is counted:
14
+ * - Everything by when it was CREATED - the moment Clarion decided to tell somebody.
15
+ * - Whose it is: the organization recorded on it; for a push, the organization of the
16
+ * post it announces, then the recipient's; for an SMS, the recipient's. Older SMS and
17
+ * email (before 21 September 2026) recorded no organization and often no recipient:
18
+ * those are counted only in the platform view (`unattributed`).
19
+ * - Got through: accepted by the provider - Firebase for a push, the SMS gateway, the
20
+ * mail service - or, in the console, delivered. Nothing reports whether an SMS or an
21
+ * email was read, so only push (tapped) and in-app (read) have an open rate.
22
+ * - A country narrows push, in-app and devices by the recipient's country and SMS by
23
+ * the number's; email has no country and is never narrowed.
24
+ */
25
+ export {};
26
+ //# sourceMappingURL=notification-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
@@ -125,6 +125,9 @@ export var PermissionActions;
125
125
  // emails are branded, the address they are sent from, and the sender ID its
126
126
  // SMS arrive under - one family per thing configured. Mirrors grm-shared-library.
127
127
  PermissionActions["READ_NOTIFICATION_BRANDING"] = "read:notification-branding";
128
+ // Notification Analytics: what went out on every channel and whether it got
129
+ // through - totals only. Held by exactly the roles that read the notification settings.
130
+ PermissionActions["READ_NOTIFICATION_ANALYTICS"] = "read:notification-analytics";
128
131
  PermissionActions["UPDATE_NOTIFICATION_BRANDING"] = "update:notification-branding";
129
132
  PermissionActions["CREATE_NOTIFICATION_EMAIL_SENDER"] = "create:notification-email-sender";
130
133
  PermissionActions["READ_NOTIFICATION_EMAIL_SENDER"] = "read:notification-email-sender";
@@ -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,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;IAC9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uD,CAAA;IACvD,gFAAgF;IAChF,gFAAgF;IAChF,wEAAmD,CAAA;IAEnD,uBAAuB;IACvB,+EAA+E;IAC/E,mFAAmF;IACnF,4DAA4D;IAC5D,sFAAiE,CAAA;IACjE,kFAA6D,CAAA;IAC7D,sFAAiE,CAAA;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;IAE7D,gFAAgF;IAChF,0EAA0E;IAC1E,gDAAgD;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,KAAjB,iBAAiB,QAmS5B"}
1
+ {"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAsSX;AAtSD,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;IAC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,CAAA;IAC3C,kEAA6C,CAAA;IAE7C,iFAAiF;IACjF,2EAA2E;IAC3E,2EAA2E;IAC3E,kEAA6C,CAAA;IAC7C,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAC/C,kEAA6C,CAAA;IAC7C,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,4EAAuD,CAAA;IACvD,gFAAgF;IAChF,gFAAgF;IAChF,wEAAmD,CAAA;IAEnD,uBAAuB;IACvB,+EAA+E;IAC/E,mFAAmF;IACnF,4DAA4D;IAC5D,sFAAiE,CAAA;IACjE,kFAA6D,CAAA;IAC7D,sFAAiE,CAAA;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;IAE7D,gFAAgF;IAChF,0EAA0E;IAC1E,gDAAgD;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,EAtSW,iBAAiB,KAAjB,iBAAiB,QAsS5B"}
@@ -11,3 +11,4 @@ export * from './interfaces/email-send-result';
11
11
  export * from './interfaces/notification-dispatch-result';
12
12
  export * from './interfaces/organization-notification-settings.dto';
13
13
  export * from './utils/notification-sender.util';
14
+ export * from './interfaces/notification-analytics';
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Notification analytics (the admin's Notification Analytics): what Clarion sent people
3
+ * over a period, on every channel - push to the app, the console's in-app notifications,
4
+ * SMS and email - whether it got through, whether it was opened, and how many people a
5
+ * push can reach at all.
6
+ *
7
+ * One read, computed by clarion-notification from one consistent snapshot, with who each
8
+ * recipient is from clarion-authentication. Counts, rates and durations only: never a
9
+ * title, a message, a phone number or an address.
10
+ *
11
+ * DURATIONS ARE IN SECONDS, like every analytics contract.
12
+ *
13
+ * How it is counted:
14
+ * - Everything by when it was CREATED - the moment Clarion decided to tell somebody.
15
+ * - Whose it is: the organization recorded on it; for a push, the organization of the
16
+ * post it announces, then the recipient's; for an SMS, the recipient's. Older SMS and
17
+ * email (before 21 September 2026) recorded no organization and often no recipient:
18
+ * those are counted only in the platform view (`unattributed`).
19
+ * - Got through: accepted by the provider - Firebase for a push, the SMS gateway, the
20
+ * mail service - or, in the console, delivered. Nothing reports whether an SMS or an
21
+ * email was read, so only push (tapped) and in-app (read) have an open rate.
22
+ * - A country narrows push, in-app and devices by the recipient's country and SMS by
23
+ * the number's; email has no country and is never narrowed.
24
+ */
25
+ /** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
26
+ export type NotificationAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
27
+ /** The four ways Clarion tells somebody something. */
28
+ export type NotificationAnalyticsChannel = 'PUSH' | 'IN_APP' | 'SMS' | 'EMAIL';
29
+ export interface NotificationAnalyticsRange {
30
+ /** Inclusive, ISO 8601. The first notification when the period asked for was "forever". */
31
+ from: string;
32
+ /** Exclusive, ISO 8601. */
33
+ to: string;
34
+ bucket: NotificationAnalyticsBucket;
35
+ /** IANA time zone the buckets and the hour-of-week grid are cut in. */
36
+ timeZone: string;
37
+ }
38
+ /** A count by a key (a kind, a provider, a reason), largest first unless the section says otherwise. */
39
+ export interface NotificationAnalyticsCount<K extends string = string> {
40
+ key: K;
41
+ count: number;
42
+ }
43
+ /** Median and 90th percentile of one duration, in seconds; null when nothing was measured. */
44
+ export interface NotificationAnalyticsDuration {
45
+ median: number | null;
46
+ p90: number | null;
47
+ /** How many were measured. */
48
+ count: number;
49
+ }
50
+ /** One channel over the period. */
51
+ export interface NotificationAnalyticsChannelRow {
52
+ channel: NotificationAnalyticsChannel;
53
+ /** Created in the period. */
54
+ total: number;
55
+ /** Got through: accepted by the provider, or delivered to the console. */
56
+ succeeded: number;
57
+ failed: number;
58
+ /** No outcome yet: waiting, or cancelled before it was sent. */
59
+ pending: number;
60
+ /** succeeded / (succeeded + failed), as a percentage. */
61
+ successRate: number | null;
62
+ /** Push tapped, in-app read; null for SMS and email - nothing reports it. */
63
+ opened: number | null;
64
+ /** opened / succeeded, as a percentage. */
65
+ openRate: number | null;
66
+ }
67
+ /** One kind of push - what it announced - and how it went. */
68
+ export interface NotificationAnalyticsPushKindRow {
69
+ /** The event it announced (NEWSFEED_POST_PUBLISHED, GUARDIAN_INCIDENT_ALERT...), else its category (INCIDENT, ALERT...). */
70
+ kind: string;
71
+ total: number;
72
+ failed: number;
73
+ opened: number;
74
+ /** opened / those that got through, as a percentage. */
75
+ openRate: number | null;
76
+ medianSecondsToOpen: number | null;
77
+ }
78
+ /** Push notifications to the app. */
79
+ export interface NotificationAnalyticsPush {
80
+ /** One per device: a notification to somebody with two phones is two. */
81
+ total: number;
82
+ succeeded: number;
83
+ failed: number;
84
+ pending: number;
85
+ opened: number;
86
+ successRate: number | null;
87
+ openRate: number | null;
88
+ /** Different people pushed to. */
89
+ recipients: number;
90
+ /** Notifications as Clarion decided them, each fanned out to its recipients' devices. */
91
+ sends: number;
92
+ /** Created to accepted by Firebase - seconds, with decimals. */
93
+ toSend: NotificationAnalyticsDuration;
94
+ /** Created to tapped. */
95
+ toOpen: NotificationAnalyticsDuration;
96
+ byKind: NotificationAnalyticsPushKindRow[];
97
+ /** Critical, High, Normal, Low - in that order, zeros included. */
98
+ byPriority: NotificationAnalyticsCount[];
99
+ /** The Android channel it rang on (urgent, incidents...); DEFAULT when none. */
100
+ byChannel: NotificationAnalyticsCount[];
101
+ /** Why pushes failed, as the provider said it - ids, numbers and addresses masked. The eight commonest. */
102
+ failureReasons: NotificationAnalyticsCount[];
103
+ }
104
+ /** The phones and browsers a push can reach - NOW, whatever the period, apart from `registered`. */
105
+ export interface NotificationAnalyticsDevices {
106
+ activeNow: number;
107
+ /** Switched off: signed out, replaced by a newer registration, or refused by the provider. */
108
+ inactiveNow: number;
109
+ /** People with at least one active device: who a push can reach. */
110
+ reachableNow: number;
111
+ /** Registered in the period. */
112
+ registered: number;
113
+ /** Active devices by kind (android, ios, web). */
114
+ byType: NotificationAnalyticsCount[];
115
+ /** Active devices by app version; NONE when not recorded. */
116
+ byAppVersion: NotificationAnalyticsCount[];
117
+ byLanguage: NotificationAnalyticsCount[];
118
+ }
119
+ /** The console's own notifications, to the staff using it. */
120
+ export interface NotificationAnalyticsInApp {
121
+ total: number;
122
+ succeeded: number;
123
+ failed: number;
124
+ pending: number;
125
+ read: number;
126
+ /** read / total, as a percentage. */
127
+ readRate: number | null;
128
+ /** Different people notified. */
129
+ recipients: number;
130
+ /** INCIDENT, ALERT, MESSAGE... */
131
+ byType: NotificationAnalyticsCount[];
132
+ /** What happened (Created, Auto-Stopped, CHAT_MESSAGE...). */
133
+ byAction: NotificationAnalyticsCount[];
134
+ /** NOW: notifications nobody has read yet, whenever created. */
135
+ unreadNow: number;
136
+ }
137
+ /** Cost recorded on SMS, per currency. */
138
+ export interface NotificationAnalyticsSmsCost {
139
+ currency: string;
140
+ amount: number;
141
+ /** Messages with a cost recorded. */
142
+ messages: number;
143
+ }
144
+ /** SMS. */
145
+ export interface NotificationAnalyticsSms {
146
+ total: number;
147
+ succeeded: number;
148
+ failed: number;
149
+ pending: number;
150
+ successRate: number | null;
151
+ /** Created to accepted by the gateway. */
152
+ toSend: NotificationAnalyticsDuration;
153
+ /** What it was for: otp:verify_phone, otp:reset_password, guardian_incident_notification...; NOT_RECORDED for the oldest. */
154
+ byPurpose: NotificationAnalyticsCount[];
155
+ /** The gateway that took it (uwazii, twilio, africastalking); NOT_RECORDED for the oldest. */
156
+ byProvider: NotificationAnalyticsCount[];
157
+ /** Whose sender ID it went out under (PLATFORM_DEFAULT, ORGANIZATION); NOT_RECORDED for the oldest. */
158
+ bySenderSource: NotificationAnalyticsCount[];
159
+ /** The number's country; UNKNOWN when not recorded. */
160
+ byCountry: NotificationAnalyticsCount[];
161
+ /** Why messages failed - ids, numbers and addresses masked. The eight commonest. */
162
+ failureReasons: NotificationAnalyticsCount[];
163
+ cost: NotificationAnalyticsSmsCost[];
164
+ }
165
+ /** Email. */
166
+ export interface NotificationAnalyticsEmail {
167
+ total: number;
168
+ succeeded: number;
169
+ failed: number;
170
+ successRate: number | null;
171
+ /** Verification, Password Reset, Notification, Acknowledgement... */
172
+ byType: NotificationAnalyticsCount[];
173
+ /** The mail service that took it; NOT_RECORDED for the oldest. */
174
+ byProvider: NotificationAnalyticsCount[];
175
+ bySenderSource: NotificationAnalyticsCount[];
176
+ }
177
+ /** One point on the charts: a bucket of the period. */
178
+ export interface NotificationAnalyticsPoint {
179
+ /** Local wall-clock start of the bucket, in `range.timeZone` (no offset). */
180
+ bucket: string;
181
+ push: number;
182
+ pushFailed: number;
183
+ /** Of the pushes created in the bucket, those tapped (whenever). */
184
+ pushOpened: number;
185
+ inApp: number;
186
+ inAppRead: number;
187
+ sms: number;
188
+ smsFailed: number;
189
+ email: number;
190
+ emailFailed: number;
191
+ }
192
+ /** One hour of the week. Weekday 1 is Monday. */
193
+ export interface NotificationAnalyticsHeatCell {
194
+ weekday: number;
195
+ hour: number;
196
+ /** Notifications created in it, every channel. */
197
+ sent: number;
198
+ /** Pushes tapped in it - when people look. */
199
+ opened: number;
200
+ }
201
+ /** The previous period of the same length, for the change on each headline figure. */
202
+ export interface NotificationAnalyticsPrevious {
203
+ from: string;
204
+ to: string;
205
+ total: number;
206
+ push: number;
207
+ pushFailed: number;
208
+ pushOpened: number;
209
+ pushOpenRate: number | null;
210
+ pushSuccessRate: number | null;
211
+ inApp: number;
212
+ inAppRead: number;
213
+ sms: number;
214
+ smsFailed: number;
215
+ smsSuccessRate: number | null;
216
+ email: number;
217
+ emailFailed: number;
218
+ devicesRegistered: number;
219
+ }
220
+ /** A Super-Admin's view of every organization: one row each, busiest first. */
221
+ export interface NotificationAnalyticsOrganizationRow {
222
+ organizationId: number;
223
+ total: number;
224
+ push: number;
225
+ pushFailed: number;
226
+ pushOpenRate: number | null;
227
+ inApp: number;
228
+ inAppReadRate: number | null;
229
+ sms: number;
230
+ smsFailed: number;
231
+ email: number;
232
+ /** NOW. */
233
+ activeDevices: number;
234
+ }
235
+ /** Notifications of the period no organization could be found for - the platform view only. */
236
+ export interface NotificationAnalyticsUnattributed {
237
+ push: number;
238
+ sms: number;
239
+ email: number;
240
+ }
241
+ export interface NotificationAnalytics {
242
+ /** Whose figures: one organization, or null for every organization. */
243
+ organizationId: number | null;
244
+ /** The one country the figures are narrowed to, or null for every country. */
245
+ countryCode: string | null;
246
+ range: NotificationAnalyticsRange;
247
+ generatedAt: string;
248
+ previous: NotificationAnalyticsPrevious | null;
249
+ /** Countries with notifications or devices in scope, whatever country is chosen - for narrowing to one. */
250
+ countryOptions: NotificationAnalyticsCount[];
251
+ /** PUSH, IN_APP, SMS, EMAIL - in that order. */
252
+ channels: NotificationAnalyticsChannelRow[];
253
+ push: NotificationAnalyticsPush;
254
+ devices: NotificationAnalyticsDevices;
255
+ inApp: NotificationAnalyticsInApp;
256
+ sms: NotificationAnalyticsSms;
257
+ email: NotificationAnalyticsEmail;
258
+ timeline: NotificationAnalyticsPoint[];
259
+ /** All 168 hours of the week, Monday first, zeros included. */
260
+ heatmap: NotificationAnalyticsHeatCell[];
261
+ /** A Super-Admin looking at every organization only. */
262
+ byOrganization?: NotificationAnalyticsOrganizationRow[];
263
+ /** A Super-Admin looking at every organization only. */
264
+ unattributed?: NotificationAnalyticsUnattributed;
265
+ }
266
+ /** What a dashboard asks: the period, one country - and, for a Super-Admin, whose figures. */
267
+ export interface NotificationAnalyticsQuery {
268
+ from?: string;
269
+ to?: string;
270
+ timeZone?: string;
271
+ organizationId?: number;
272
+ countryCode?: string;
273
+ }
@@ -87,6 +87,7 @@ export declare enum PermissionActions {
87
87
  READ_SUPPORT_SYNC = "read:support-sync",
88
88
  MANAGE_SUPPORT_SYNC = "manage:support-sync",
89
89
  READ_NOTIFICATION_BRANDING = "read:notification-branding",
90
+ READ_NOTIFICATION_ANALYTICS = "read:notification-analytics",
90
91
  UPDATE_NOTIFICATION_BRANDING = "update:notification-branding",
91
92
  CREATE_NOTIFICATION_EMAIL_SENDER = "create:notification-email-sender",
92
93
  READ_NOTIFICATION_EMAIL_SENDER = "read:notification-email-sender",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarion-shared-types",
3
- "version": "1.0.114",
3
+ "version": "1.0.115",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",