clarion-shared-types 1.0.74 → 1.0.76

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.
Files changed (62) hide show
  1. package/dist/cjs/index.js +1 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/modules/notification/enums/email-provider-name.enum.js +15 -0
  4. package/dist/cjs/modules/notification/enums/email-provider-name.enum.js.map +1 -0
  5. package/dist/cjs/modules/notification/enums/notification-channel.enum.js +15 -0
  6. package/dist/cjs/modules/notification/enums/notification-channel.enum.js.map +1 -0
  7. package/dist/cjs/modules/notification/enums/notification-overall-status.enum.js +16 -0
  8. package/dist/cjs/modules/notification/enums/notification-overall-status.enum.js.map +1 -0
  9. package/dist/cjs/modules/notification/enums/provider-failure-reason.enum.js +28 -0
  10. package/dist/cjs/modules/notification/enums/provider-failure-reason.enum.js.map +1 -0
  11. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js +14 -0
  12. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js.map +1 -0
  13. package/dist/cjs/modules/notification/index.js +29 -0
  14. package/dist/cjs/modules/notification/index.js.map +1 -0
  15. package/dist/cjs/modules/notification/interfaces/email-send-result.js +3 -0
  16. package/dist/cjs/modules/notification/interfaces/email-send-result.js.map +1 -0
  17. package/dist/cjs/modules/notification/interfaces/notification-dispatch-result.js +3 -0
  18. package/dist/cjs/modules/notification/interfaces/notification-dispatch-result.js.map +1 -0
  19. package/dist/cjs/modules/notification/interfaces/per-channel-result.js +3 -0
  20. package/dist/cjs/modules/notification/interfaces/per-channel-result.js.map +1 -0
  21. package/dist/cjs/modules/notification/interfaces/provider-attempt.js +3 -0
  22. package/dist/cjs/modules/notification/interfaces/provider-attempt.js.map +1 -0
  23. package/dist/cjs/modules/notification/interfaces/sms-send-result.js +3 -0
  24. package/dist/cjs/modules/notification/interfaces/sms-send-result.js.map +1 -0
  25. package/dist/esm/index.js +1 -0
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/modules/notification/enums/email-provider-name.enum.js +12 -0
  28. package/dist/esm/modules/notification/enums/email-provider-name.enum.js.map +1 -0
  29. package/dist/esm/modules/notification/enums/notification-channel.enum.js +12 -0
  30. package/dist/esm/modules/notification/enums/notification-channel.enum.js.map +1 -0
  31. package/dist/esm/modules/notification/enums/notification-overall-status.enum.js +13 -0
  32. package/dist/esm/modules/notification/enums/notification-overall-status.enum.js.map +1 -0
  33. package/dist/esm/modules/notification/enums/provider-failure-reason.enum.js +25 -0
  34. package/dist/esm/modules/notification/enums/provider-failure-reason.enum.js.map +1 -0
  35. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js +11 -0
  36. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js.map +1 -0
  37. package/dist/esm/modules/notification/index.js +13 -0
  38. package/dist/esm/modules/notification/index.js.map +1 -0
  39. package/dist/esm/modules/notification/interfaces/email-send-result.js +2 -0
  40. package/dist/esm/modules/notification/interfaces/email-send-result.js.map +1 -0
  41. package/dist/esm/modules/notification/interfaces/notification-dispatch-result.js +2 -0
  42. package/dist/esm/modules/notification/interfaces/notification-dispatch-result.js.map +1 -0
  43. package/dist/esm/modules/notification/interfaces/per-channel-result.js +2 -0
  44. package/dist/esm/modules/notification/interfaces/per-channel-result.js.map +1 -0
  45. package/dist/esm/modules/notification/interfaces/provider-attempt.js +2 -0
  46. package/dist/esm/modules/notification/interfaces/provider-attempt.js.map +1 -0
  47. package/dist/esm/modules/notification/interfaces/sms-send-result.js +2 -0
  48. package/dist/esm/modules/notification/interfaces/sms-send-result.js.map +1 -0
  49. package/dist/types/index.d.ts +1 -0
  50. package/dist/types/modules/incident/intefaces/incident.d.ts +1 -0
  51. package/dist/types/modules/notification/enums/email-provider-name.enum.d.ts +10 -0
  52. package/dist/types/modules/notification/enums/notification-channel.enum.d.ts +10 -0
  53. package/dist/types/modules/notification/enums/notification-overall-status.enum.d.ts +11 -0
  54. package/dist/types/modules/notification/enums/provider-failure-reason.enum.d.ts +23 -0
  55. package/dist/types/modules/notification/enums/sms-provider-name.enum.d.ts +9 -0
  56. package/dist/types/modules/notification/index.d.ts +10 -0
  57. package/dist/types/modules/notification/interfaces/email-send-result.d.ts +22 -0
  58. package/dist/types/modules/notification/interfaces/notification-dispatch-result.d.ts +26 -0
  59. package/dist/types/modules/notification/interfaces/per-channel-result.d.ts +22 -0
  60. package/dist/types/modules/notification/interfaces/provider-attempt.d.ts +25 -0
  61. package/dist/types/modules/notification/interfaces/sms-send-result.d.ts +22 -0
  62. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -30,6 +30,7 @@ __exportStar(require("./modules/sms/index"), exports);
30
30
  __exportStar(require("./modules/gis/index"), exports);
31
31
  __exportStar(require("./modules/socket/index"), exports);
32
32
  __exportStar(require("./modules/web-notification/index"), exports);
33
+ __exportStar(require("./modules/notification/index"), exports);
33
34
  __exportStar(require("./modules/chat/index"), exports);
34
35
  // Interfaces
35
36
  __exportStar(require("./modules/common/interfaces/server-message"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,uDAAqC;AAErC,aAAa;AACb,6EAA2D;AAC3D,yEAAuD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AAErC,aAAa;AACb,6EAA2D;AAC3D,yEAAuD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailProviderName = void 0;
4
+ /**
5
+ * Identifiers for the email providers the notification service can dispatch through.
6
+ * TWILIO_SENDGRID is the Twilio email provider (SendGrid API).
7
+ * Provider order/fallback is configuration-driven; new providers can be appended.
8
+ */
9
+ var EmailProviderName;
10
+ (function (EmailProviderName) {
11
+ EmailProviderName["TWILIO_SENDGRID"] = "twilio_sendgrid";
12
+ EmailProviderName["MAILGUN"] = "mailgun";
13
+ EmailProviderName["SES"] = "ses";
14
+ })(EmailProviderName || (exports.EmailProviderName = EmailProviderName = {}));
15
+ //# sourceMappingURL=email-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/email-provider-name.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,wCAAmB,CAAA;IACnB,gCAAW,CAAA;AACf,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationChannel = void 0;
4
+ /**
5
+ * Delivery channels supported by the clarion-notification service.
6
+ * Used to key per-channel dispatch results.
7
+ */
8
+ var NotificationChannel;
9
+ (function (NotificationChannel) {
10
+ NotificationChannel["SMS"] = "SMS";
11
+ NotificationChannel["EMAIL"] = "EMAIL";
12
+ NotificationChannel["PUSH"] = "PUSH";
13
+ NotificationChannel["WEB"] = "WEB";
14
+ })(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
15
+ //# sourceMappingURL=notification-channel.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-channel.enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationOverallStatus = void 0;
4
+ /**
5
+ * Aggregate status for a multi-channel notification dispatch.
6
+ * - SUCCESS: every attempted channel succeeded.
7
+ * - PARTIAL_SUCCESS: at least one channel succeeded and at least one failed.
8
+ * - FAILED: no attempted channel succeeded.
9
+ */
10
+ var NotificationOverallStatus;
11
+ (function (NotificationOverallStatus) {
12
+ NotificationOverallStatus["SUCCESS"] = "SUCCESS";
13
+ NotificationOverallStatus["PARTIAL_SUCCESS"] = "PARTIAL_SUCCESS";
14
+ NotificationOverallStatus["FAILED"] = "FAILED";
15
+ })(NotificationOverallStatus || (exports.NotificationOverallStatus = NotificationOverallStatus = {}));
16
+ //# sourceMappingURL=notification-overall-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-overall-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-overall-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACjC,gDAAmB,CAAA;IACnB,gEAAmC,CAAA;IACnC,8CAAiB,CAAA;AACrB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProviderFailureReason = void 0;
4
+ /**
5
+ * Normalized classification of why a provider attempt failed.
6
+ * Drives fallback behaviour: VALIDATION / CONFIG_MISSING are non-retryable
7
+ * (no fallback), the remainder are provider-level failures that trigger fallback.
8
+ */
9
+ var ProviderFailureReason;
10
+ (function (ProviderFailureReason) {
11
+ /** Malformed/invalid request (bad recipient, missing body/subject). Do not fall back. */
12
+ ProviderFailureReason["VALIDATION"] = "VALIDATION";
13
+ /** Provider is not configured/enabled. Skip provider (try next), not a send failure. */
14
+ ProviderFailureReason["CONFIG_MISSING"] = "CONFIG_MISSING";
15
+ /** Authentication/authorization failure with the provider. */
16
+ ProviderFailureReason["AUTH"] = "AUTH";
17
+ /** Provider rate limited the request. */
18
+ ProviderFailureReason["RATE_LIMIT"] = "RATE_LIMIT";
19
+ /** Request timed out. */
20
+ ProviderFailureReason["TIMEOUT"] = "TIMEOUT";
21
+ /** Network/connection error reaching the provider. */
22
+ ProviderFailureReason["NETWORK"] = "NETWORK";
23
+ /** Provider returned a server-side/processing error. */
24
+ ProviderFailureReason["PROVIDER_ERROR"] = "PROVIDER_ERROR";
25
+ /** Unclassified failure. */
26
+ ProviderFailureReason["UNKNOWN"] = "UNKNOWN";
27
+ })(ProviderFailureReason || (exports.ProviderFailureReason = ProviderFailureReason = {}));
28
+ //# sourceMappingURL=provider-failure-reason.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-failure-reason.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/provider-failure-reason.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAC7B,yFAAyF;IACzF,kDAAyB,CAAA;IACzB,wFAAwF;IACxF,0DAAiC,CAAA;IACjC,8DAA8D;IAC9D,sCAAa,CAAA;IACb,yCAAyC;IACzC,kDAAyB,CAAA;IACzB,yBAAyB;IACzB,4CAAmB,CAAA;IACnB,sDAAsD;IACtD,4CAAmB,CAAA;IACnB,wDAAwD;IACxD,0DAAiC,CAAA;IACjC,4BAA4B;IAC5B,4CAAmB,CAAA;AACvB,CAAC,EAjBW,qBAAqB,qCAArB,qBAAqB,QAiBhC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SmsProviderName = void 0;
4
+ /**
5
+ * Identifiers for the SMS providers the notification service can dispatch through.
6
+ * Provider order/fallback is configuration-driven; new providers can be appended.
7
+ */
8
+ var SmsProviderName;
9
+ (function (SmsProviderName) {
10
+ SmsProviderName["TWILIO"] = "twilio";
11
+ SmsProviderName["UWAZII"] = "uwazii";
12
+ SmsProviderName["AFRICASTALKING"] = "africastalking";
13
+ })(SmsProviderName || (exports.SmsProviderName = SmsProviderName = {}));
14
+ //# sourceMappingURL=sms-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-provider-name.enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;AACrC,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Enums
18
+ __exportStar(require("./enums/notification-channel.enum"), exports);
19
+ __exportStar(require("./enums/sms-provider-name.enum"), exports);
20
+ __exportStar(require("./enums/email-provider-name.enum"), exports);
21
+ __exportStar(require("./enums/notification-overall-status.enum"), exports);
22
+ __exportStar(require("./enums/provider-failure-reason.enum"), exports);
23
+ // Result/interface contracts (display-safe)
24
+ __exportStar(require("./interfaces/provider-attempt"), exports);
25
+ __exportStar(require("./interfaces/per-channel-result"), exports);
26
+ __exportStar(require("./interfaces/sms-send-result"), exports);
27
+ __exportStar(require("./interfaces/email-send-result"), exports);
28
+ __exportStar(require("./interfaces/notification-dispatch-result"), exports);
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AAErD,4CAA4C;AAC5C,gEAA8C;AAC9C,kEAAgD;AAChD,+DAA6C;AAC7C,iEAA+C;AAC/C,4EAA0D"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=email-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/email-send-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=notification-dispatch-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-dispatch-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-dispatch-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=per-channel-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-channel-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/per-channel-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=provider-attempt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-attempt.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/provider-attempt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=sms-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/sms-send-result.ts"],"names":[],"mappings":""}
package/dist/esm/index.js CHANGED
@@ -14,6 +14,7 @@ export * from './modules/sms/index';
14
14
  export * from './modules/gis/index';
15
15
  export * from './modules/socket/index';
16
16
  export * from './modules/web-notification/index';
17
+ export * from './modules/notification/index';
17
18
  export * from './modules/chat/index';
18
19
  // Interfaces
19
20
  export * from './modules/common/interfaces/server-message';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AAErC,aAAa;AACb,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AAErC,aAAa;AACb,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Identifiers for the email providers the notification service can dispatch through.
3
+ * TWILIO_SENDGRID is the Twilio email provider (SendGrid API).
4
+ * Provider order/fallback is configuration-driven; new providers can be appended.
5
+ */
6
+ export var EmailProviderName;
7
+ (function (EmailProviderName) {
8
+ EmailProviderName["TWILIO_SENDGRID"] = "twilio_sendgrid";
9
+ EmailProviderName["MAILGUN"] = "mailgun";
10
+ EmailProviderName["SES"] = "ses";
11
+ })(EmailProviderName || (EmailProviderName = {}));
12
+ //# sourceMappingURL=email-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/email-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,wCAAmB,CAAA;IACnB,gCAAW,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Delivery channels supported by the clarion-notification service.
3
+ * Used to key per-channel dispatch results.
4
+ */
5
+ export var NotificationChannel;
6
+ (function (NotificationChannel) {
7
+ NotificationChannel["SMS"] = "SMS";
8
+ NotificationChannel["EMAIL"] = "EMAIL";
9
+ NotificationChannel["PUSH"] = "PUSH";
10
+ NotificationChannel["WEB"] = "WEB";
11
+ })(NotificationChannel || (NotificationChannel = {}));
12
+ //# sourceMappingURL=notification-channel.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-channel.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Aggregate status for a multi-channel notification dispatch.
3
+ * - SUCCESS: every attempted channel succeeded.
4
+ * - PARTIAL_SUCCESS: at least one channel succeeded and at least one failed.
5
+ * - FAILED: no attempted channel succeeded.
6
+ */
7
+ export var NotificationOverallStatus;
8
+ (function (NotificationOverallStatus) {
9
+ NotificationOverallStatus["SUCCESS"] = "SUCCESS";
10
+ NotificationOverallStatus["PARTIAL_SUCCESS"] = "PARTIAL_SUCCESS";
11
+ NotificationOverallStatus["FAILED"] = "FAILED";
12
+ })(NotificationOverallStatus || (NotificationOverallStatus = {}));
13
+ //# sourceMappingURL=notification-overall-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-overall-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-overall-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACjC,gDAAmB,CAAA;IACnB,gEAAmC,CAAA;IACnC,8CAAiB,CAAA;AACrB,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Normalized classification of why a provider attempt failed.
3
+ * Drives fallback behaviour: VALIDATION / CONFIG_MISSING are non-retryable
4
+ * (no fallback), the remainder are provider-level failures that trigger fallback.
5
+ */
6
+ export var ProviderFailureReason;
7
+ (function (ProviderFailureReason) {
8
+ /** Malformed/invalid request (bad recipient, missing body/subject). Do not fall back. */
9
+ ProviderFailureReason["VALIDATION"] = "VALIDATION";
10
+ /** Provider is not configured/enabled. Skip provider (try next), not a send failure. */
11
+ ProviderFailureReason["CONFIG_MISSING"] = "CONFIG_MISSING";
12
+ /** Authentication/authorization failure with the provider. */
13
+ ProviderFailureReason["AUTH"] = "AUTH";
14
+ /** Provider rate limited the request. */
15
+ ProviderFailureReason["RATE_LIMIT"] = "RATE_LIMIT";
16
+ /** Request timed out. */
17
+ ProviderFailureReason["TIMEOUT"] = "TIMEOUT";
18
+ /** Network/connection error reaching the provider. */
19
+ ProviderFailureReason["NETWORK"] = "NETWORK";
20
+ /** Provider returned a server-side/processing error. */
21
+ ProviderFailureReason["PROVIDER_ERROR"] = "PROVIDER_ERROR";
22
+ /** Unclassified failure. */
23
+ ProviderFailureReason["UNKNOWN"] = "UNKNOWN";
24
+ })(ProviderFailureReason || (ProviderFailureReason = {}));
25
+ //# sourceMappingURL=provider-failure-reason.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-failure-reason.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/provider-failure-reason.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAC7B,yFAAyF;IACzF,kDAAyB,CAAA;IACzB,wFAAwF;IACxF,0DAAiC,CAAA;IACjC,8DAA8D;IAC9D,sCAAa,CAAA;IACb,yCAAyC;IACzC,kDAAyB,CAAA;IACzB,yBAAyB;IACzB,4CAAmB,CAAA;IACnB,sDAAsD;IACtD,4CAAmB,CAAA;IACnB,wDAAwD;IACxD,0DAAiC,CAAA;IACjC,4BAA4B;IAC5B,4CAAmB,CAAA;AACvB,CAAC,EAjBW,qBAAqB,KAArB,qBAAqB,QAiBhC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Identifiers for the SMS providers the notification service can dispatch through.
3
+ * Provider order/fallback is configuration-driven; new providers can be appended.
4
+ */
5
+ export var SmsProviderName;
6
+ (function (SmsProviderName) {
7
+ SmsProviderName["TWILIO"] = "twilio";
8
+ SmsProviderName["UWAZII"] = "uwazii";
9
+ SmsProviderName["AFRICASTALKING"] = "africastalking";
10
+ })(SmsProviderName || (SmsProviderName = {}));
11
+ //# sourceMappingURL=sms-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;AACrC,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B"}
@@ -0,0 +1,13 @@
1
+ // Enums
2
+ export * from './enums/notification-channel.enum';
3
+ export * from './enums/sms-provider-name.enum';
4
+ export * from './enums/email-provider-name.enum';
5
+ export * from './enums/notification-overall-status.enum';
6
+ export * from './enums/provider-failure-reason.enum';
7
+ // Result/interface contracts (display-safe)
8
+ export * from './interfaces/provider-attempt';
9
+ export * from './interfaces/per-channel-result';
10
+ export * from './interfaces/sms-send-result';
11
+ export * from './interfaces/email-send-result';
12
+ export * from './interfaces/notification-dispatch-result';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AAErD,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=email-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/email-send-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=notification-dispatch-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-dispatch-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-dispatch-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=per-channel-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-channel-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/per-channel-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=provider-attempt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-attempt.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/provider-attempt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sms-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/sms-send-result.ts"],"names":[],"mappings":""}
@@ -13,6 +13,7 @@ export * from './modules/sms/index';
13
13
  export * from './modules/gis/index';
14
14
  export * from './modules/socket/index';
15
15
  export * from './modules/web-notification/index';
16
+ export * from './modules/notification/index';
16
17
  export * from './modules/chat/index';
17
18
  export * from './modules/common/interfaces/server-message';
18
19
  export * from './modules/common/interfaces/pagination';
@@ -32,6 +32,7 @@ export interface Incident {
32
32
  location?: MapLocation;
33
33
  physicalAddress?: string;
34
34
  audioRecordingUrl?: string;
35
+ audioRecordingId?: number;
35
36
  conversationId?: string;
36
37
  creatorId?: number;
37
38
  assigneeIds?: number[];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Identifiers for the email providers the notification service can dispatch through.
3
+ * TWILIO_SENDGRID is the Twilio email provider (SendGrid API).
4
+ * Provider order/fallback is configuration-driven; new providers can be appended.
5
+ */
6
+ export declare enum EmailProviderName {
7
+ TWILIO_SENDGRID = "twilio_sendgrid",
8
+ MAILGUN = "mailgun",
9
+ SES = "ses"
10
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Delivery channels supported by the clarion-notification service.
3
+ * Used to key per-channel dispatch results.
4
+ */
5
+ export declare enum NotificationChannel {
6
+ SMS = "SMS",
7
+ EMAIL = "EMAIL",
8
+ PUSH = "PUSH",
9
+ WEB = "WEB"
10
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Aggregate status for a multi-channel notification dispatch.
3
+ * - SUCCESS: every attempted channel succeeded.
4
+ * - PARTIAL_SUCCESS: at least one channel succeeded and at least one failed.
5
+ * - FAILED: no attempted channel succeeded.
6
+ */
7
+ export declare enum NotificationOverallStatus {
8
+ SUCCESS = "SUCCESS",
9
+ PARTIAL_SUCCESS = "PARTIAL_SUCCESS",
10
+ FAILED = "FAILED"
11
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Normalized classification of why a provider attempt failed.
3
+ * Drives fallback behaviour: VALIDATION / CONFIG_MISSING are non-retryable
4
+ * (no fallback), the remainder are provider-level failures that trigger fallback.
5
+ */
6
+ export declare enum ProviderFailureReason {
7
+ /** Malformed/invalid request (bad recipient, missing body/subject). Do not fall back. */
8
+ VALIDATION = "VALIDATION",
9
+ /** Provider is not configured/enabled. Skip provider (try next), not a send failure. */
10
+ CONFIG_MISSING = "CONFIG_MISSING",
11
+ /** Authentication/authorization failure with the provider. */
12
+ AUTH = "AUTH",
13
+ /** Provider rate limited the request. */
14
+ RATE_LIMIT = "RATE_LIMIT",
15
+ /** Request timed out. */
16
+ TIMEOUT = "TIMEOUT",
17
+ /** Network/connection error reaching the provider. */
18
+ NETWORK = "NETWORK",
19
+ /** Provider returned a server-side/processing error. */
20
+ PROVIDER_ERROR = "PROVIDER_ERROR",
21
+ /** Unclassified failure. */
22
+ UNKNOWN = "UNKNOWN"
23
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Identifiers for the SMS providers the notification service can dispatch through.
3
+ * Provider order/fallback is configuration-driven; new providers can be appended.
4
+ */
5
+ export declare enum SmsProviderName {
6
+ TWILIO = "twilio",
7
+ UWAZII = "uwazii",
8
+ AFRICASTALKING = "africastalking"
9
+ }
@@ -0,0 +1,10 @@
1
+ export * from './enums/notification-channel.enum';
2
+ export * from './enums/sms-provider-name.enum';
3
+ export * from './enums/email-provider-name.enum';
4
+ export * from './enums/notification-overall-status.enum';
5
+ export * from './enums/provider-failure-reason.enum';
6
+ export * from './interfaces/provider-attempt';
7
+ export * from './interfaces/per-channel-result';
8
+ export * from './interfaces/sms-send-result';
9
+ export * from './interfaces/email-send-result';
10
+ export * from './interfaces/notification-dispatch-result';
@@ -0,0 +1,22 @@
1
+ import { NotificationChannel } from '../enums/notification-channel.enum';
2
+ import { EmailProviderName } from '../enums/email-provider-name.enum';
3
+ import { ProviderFailureReason } from '../enums/provider-failure-reason.enum';
4
+ import { ProviderAttempt } from './provider-attempt';
5
+ /**
6
+ * Normalized result of an email send across the configured provider chain.
7
+ */
8
+ export interface EmailSendResult {
9
+ channel: NotificationChannel.EMAIL;
10
+ success: boolean;
11
+ /** Provider that ultimately succeeded. */
12
+ provider?: EmailProviderName | string;
13
+ /** Normalized provider message/reference id. */
14
+ messageId?: string;
15
+ /** Recipients targeted. */
16
+ to?: string[];
17
+ /** Ordered attempts (primary first, then fallbacks). */
18
+ attempts: ProviderAttempt[];
19
+ failureReason?: ProviderFailureReason;
20
+ /** Internal, safe-to-log error summary. */
21
+ errorMessage?: string;
22
+ }
@@ -0,0 +1,26 @@
1
+ import { NotificationChannel } from '../enums/notification-channel.enum';
2
+ import { NotificationOverallStatus } from '../enums/notification-overall-status.enum';
3
+ import { PerChannelResult } from './per-channel-result';
4
+ import { ProviderAttempt } from './provider-attempt';
5
+ /**
6
+ * Aggregate outcome of a multi-channel notification dispatch.
7
+ *
8
+ * NOTE: In the current architecture most dispatches are triggered by fire-and-forget
9
+ * Kafka events, so this object is produced for internal logging/persistence and
10
+ * observability rather than being returned synchronously to the original API caller.
11
+ * It is display-safe (no secrets) and can back a future synchronous notification
12
+ * endpoint or an admin-facing view.
13
+ */
14
+ export interface NotificationDispatchResult {
15
+ overallStatus: NotificationOverallStatus;
16
+ successfulChannels: NotificationChannel[];
17
+ failedChannels: NotificationChannel[];
18
+ /** Per-channel outcomes including provider attempts. */
19
+ perChannelResults: PerChannelResult[];
20
+ /** Flattened list of every provider attempt across all channels. */
21
+ providerAttempts: ProviderAttempt[];
22
+ /** Internal, safe-to-log error summaries. */
23
+ errors: string[];
24
+ /** Correlation/trace id linking this dispatch to the originating event. */
25
+ correlationId?: string;
26
+ }
@@ -0,0 +1,22 @@
1
+ import { NotificationChannel } from '../enums/notification-channel.enum';
2
+ import { ProviderFailureReason } from '../enums/provider-failure-reason.enum';
3
+ import { ProviderAttempt } from './provider-attempt';
4
+ /**
5
+ * Normalized outcome for a single notification channel, including every provider
6
+ * attempt made (primary and fallbacks) and which provider ultimately succeeded.
7
+ */
8
+ export interface PerChannelResult {
9
+ channel: NotificationChannel;
10
+ success: boolean;
11
+ /** Provider that ultimately succeeded (undefined when the channel failed). */
12
+ provider?: string;
13
+ /** Normalized provider reference id from the successful provider. */
14
+ messageId?: string;
15
+ /** Ordered attempts (primary first, then fallbacks). */
16
+ attempts: ProviderAttempt[];
17
+ /** True when the channel was intentionally not attempted (e.g. no recipient). */
18
+ skipped?: boolean;
19
+ failureReason?: ProviderFailureReason;
20
+ /** Internal, safe-to-log error summary. */
21
+ errorMessage?: string;
22
+ }
@@ -0,0 +1,25 @@
1
+ import { NotificationChannel } from '../enums/notification-channel.enum';
2
+ import { ProviderFailureReason } from '../enums/provider-failure-reason.enum';
3
+ /**
4
+ * Record of a single provider send attempt within a channel.
5
+ * One channel may produce several attempts (primary + fallbacks).
6
+ * Error details here are intended for internal logging/observability, not for
7
+ * public API clients.
8
+ */
9
+ export interface ProviderAttempt {
10
+ /** Provider identifier (SmsProviderName | EmailProviderName value). */
11
+ provider: string;
12
+ channel: NotificationChannel;
13
+ success: boolean;
14
+ /** Whether the failure was provider-level and eligible for fallback. */
15
+ retryable?: boolean;
16
+ failureReason?: ProviderFailureReason;
17
+ /** Normalized provider message/reference id when the send succeeded. */
18
+ messageId?: string;
19
+ /** Internal, safe-to-log error summary (never surfaced to public clients). */
20
+ errorMessage?: string;
21
+ /** Provider HTTP/status code when available. */
22
+ statusCode?: number;
23
+ startedAt?: string;
24
+ durationMs?: number;
25
+ }
@@ -0,0 +1,22 @@
1
+ import { NotificationChannel } from '../enums/notification-channel.enum';
2
+ import { ProviderFailureReason } from '../enums/provider-failure-reason.enum';
3
+ import { SmsProviderName } from '../enums/sms-provider-name.enum';
4
+ import { ProviderAttempt } from './provider-attempt';
5
+ /**
6
+ * Normalized result of an SMS send across the configured provider chain.
7
+ */
8
+ export interface SmsSendResult {
9
+ channel: NotificationChannel.SMS;
10
+ success: boolean;
11
+ /** Provider that ultimately succeeded. */
12
+ provider?: SmsProviderName | string;
13
+ /** Normalized provider message/reference id. */
14
+ messageId?: string;
15
+ /** Recipients targeted (E.164). */
16
+ to?: string[];
17
+ /** Ordered attempts (primary first, then fallbacks). */
18
+ attempts: ProviderAttempt[];
19
+ failureReason?: ProviderFailureReason;
20
+ /** Internal, safe-to-log error summary. */
21
+ errorMessage?: string;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarion-shared-types",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",