@arkstack/notifications 0.17.9 → 0.17.11

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 (2) hide show
  1. package/dist/index.d.ts +12 -2
  2. package/package.json +6 -6
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { DotPath, DotPathValue, MergedConfig } from "@arkstack/common";
2
- import { Transport, Transporter } from "nodemailer";
2
+ import { TransportOptions, Transporter } from "nodemailer";
3
3
  import { Model } from "@arkstack/database";
4
4
  import { Logger } from "nodemailer/lib/shared/index.js";
5
+ import MailMessage from "nodemailer/lib/mailer/mail-message.js";
5
6
  import { User } from "@app/models/User";
6
7
  import { User as User$1 } from "@arkstack/auth";
7
8
  import { PhoneNumber } from "@kanun-hq/plugin-phone";
@@ -33,6 +34,15 @@ type NotificationData = Record<string, unknown>;
33
34
  type SmsDriverName = 'africastalking' | 'twilio';
34
35
  type RealtimeDriverName = 'pusher' | 'firebase';
35
36
  type NotificationChannel = 'mail' | 'sms' | 'db' | 'realtime';
37
+ interface Transport<T = any, D extends TransportOptions = TransportOptions> {
38
+ mailer?: Transporter<T, D> | undefined;
39
+ name: string;
40
+ version: string;
41
+ send(mail: MailMessage<T>, callback: (err: Error | null, info: T) => void): void;
42
+ verify?(callback: (err: Error | null, success: true) => void): void;
43
+ verify?(): Promise<true>;
44
+ close?(): void;
45
+ }
36
46
  type MailDriverOptions = {
37
47
  transport?: 'file' | 'smtp' | 'sendmail' | 'ses';
38
48
  url?: string;
@@ -648,4 +658,4 @@ declare const configure: <T extends DotPath<NotificationConfig>>(key: T, default
648
658
  //#region src/utils/template.d.ts
649
659
  declare const interpolate: (value: string, data?: NotificationData) => string;
650
660
  //#endregion
651
- export { AfricasTalkingSmsDriver, DbNotification, DbNotificationPayload, DbNotificationType, DriverResult, FirebaseMulticastResult, FirebaseRealtimeDriver, FirebaseTransportConfig, MailDriverOptions, MailNotification, MailNotificationOptions, MailRecipient, MailRecipientAddress, MergedTransportConfig, Notification, NotificationChannel, NotificationConfig, NotificationContract, NotificationData, NotificationDriverMap, NotificationRecipient, PusherRealtimeDriver, PusherTransportConfig, RealtimeBroadcastResult, RealtimeDriver, RealtimeDriverName, RealtimeDriverOptions, RealtimeNotification, RealtimeNotificationDriver, RealtimeNotificationPayload, SmsDriverName, SmsDriverOptions, SmsNotification, TwilioSmsDriver, UserNotification, UserNotificationCenter, configure, interpolate };
661
+ export { AfricasTalkingSmsDriver, DbNotification, DbNotificationPayload, DbNotificationType, DriverResult, FirebaseMulticastResult, FirebaseRealtimeDriver, FirebaseTransportConfig, MailDriverOptions, MailNotification, MailNotificationOptions, MailRecipient, MailRecipientAddress, MergedTransportConfig, Notification, NotificationChannel, NotificationConfig, NotificationContract, NotificationData, NotificationDriverMap, NotificationRecipient, PusherRealtimeDriver, PusherTransportConfig, RealtimeBroadcastResult, RealtimeDriver, RealtimeDriverName, RealtimeDriverOptions, RealtimeNotification, RealtimeNotificationDriver, RealtimeNotificationPayload, SmsDriverName, SmsDriverOptions, SmsNotification, Transport, TwilioSmsDriver, UserNotification, UserNotificationCenter, configure, interpolate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/notifications",
3
- "version": "0.17.9",
3
+ "version": "0.17.11",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic notification module for Arkstack and Nodejs, providing support for multi-channel notification delivery.",
6
6
  "homepage": "https://arkstack.toneflix.net/guide/notifications",
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "africastalking": "^0.8.0",
35
- "nodemailer": "^8.0.7",
36
- "twilio": "^6.0.0",
37
- "@arkstack/common": "^0.17.9"
35
+ "nodemailer": "^9.0.3",
36
+ "twilio": "^6.0.2",
37
+ "@arkstack/common": "^0.17.11"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@kanun-hq/plugin-phone": "^0.1.8",
41
41
  "firebase-admin": "^13.0.0",
42
42
  "pusher": "^5.2.0",
43
- "@arkstack/contract": "^0.17.9",
44
- "@arkstack/database": "^0.17.9"
43
+ "@arkstack/contract": "^0.17.11",
44
+ "@arkstack/database": "^0.17.11"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "pusher": {