@arkstack/notifications 0.12.12 → 0.12.14

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 +7 -6
  2. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Transporter } from "nodemailer";
3
3
  import { Model } from "@arkstack/database";
4
4
  import { User } from "@arkstack/auth";
5
5
  import * as _$twilio_lib_rest_api_v2010_account_message0 from "twilio/lib/rest/api/v2010/account/message.js";
6
+ import * as _$arkormx from "arkormx";
6
7
 
7
8
  //#region src/Contracts/UserNotification.d.ts
8
9
  declare abstract class UserNotification extends Model {
@@ -162,8 +163,8 @@ declare class DbNotification extends NotificationContract<UserNotification> {
162
163
  type(type: DbNotificationPayload['type']): this;
163
164
  action(text?: string | null, link?: string | null): this;
164
165
  meta(meta?: NotificationData | null): this;
165
- create(user: User$1, payload: DbNotificationPayload): Promise<any>;
166
- send(message: string, subject?: string, _recipient?: NotificationRecipient, data?: NotificationData): Promise<any>;
166
+ create(user: User$1, payload: DbNotificationPayload): Promise<UserNotification>;
167
+ send(message: string, subject?: string, _recipient?: NotificationRecipient, data?: NotificationData): Promise<UserNotification>;
167
168
  }
168
169
  //#endregion
169
170
  //#region src/drivers/MailNotification.d.ts
@@ -279,7 +280,7 @@ declare class Notification<D extends keyof DriverMap = keyof DriverMap> {
279
280
  static email(options?: MailDriverOptions): MailNotification;
280
281
  static sms(options?: SmsDriverOptions): SmsNotification;
281
282
  static db(): DbNotification;
282
- static channel(channel?: NotificationChannel | 'email', options?: MailDriverOptions | SmsDriverOptions): DbNotification | MailNotification | SmsNotification;
283
+ static channel(channel?: NotificationChannel | 'email', options?: MailDriverOptions | SmsDriverOptions): SmsNotification | MailNotification | DbNotification;
283
284
  prepare(recipient?: null | MailRecipient | NotificationRecipient | User$1, data?: NotificationData): DriverMap[D];
284
285
  private static createDriver;
285
286
  }
@@ -287,9 +288,9 @@ declare class Notification<D extends keyof DriverMap = keyof DriverMap> {
287
288
  //#region src/UserNotificationCenter.d.ts
288
289
  declare class UserNotificationCenter {
289
290
  private static getModel;
290
- static create(user: User$1, payload: DbNotificationPayload): Promise<any>;
291
- static forUser(user: User$1): Promise<any>;
292
- static unreadForUser(user: User$1): Promise<any>;
291
+ static create(user: User$1, payload: DbNotificationPayload): Promise<UserNotification>;
292
+ static forUser(user: User$1): Promise<_$arkormx.ArkormCollection<UserNotification, UserNotification[]>>;
293
+ static unreadForUser(user: User$1): Promise<_$arkormx.ArkormCollection<UserNotification, UserNotification[]>>;
293
294
  static markRead(notification: UserNotification | UserNotification['id']): Promise<void>;
294
295
  static markAllRead(user: User$1): Promise<void>;
295
296
  static delete(notification: UserNotification | UserNotification['id']): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/notifications",
3
- "version": "0.12.12",
3
+ "version": "0.12.14",
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",
@@ -34,11 +34,11 @@
34
34
  "africastalking": "^0.8.0",
35
35
  "nodemailer": "^8.0.7",
36
36
  "twilio": "^6.0.0",
37
- "@arkstack/common": "^0.12.12"
37
+ "@arkstack/common": "^0.12.14"
38
38
  },
39
39
  "peerDependencies": {
40
- "@arkstack/database": "^0.12.12",
41
- "@arkstack/contract": "^0.12.12"
40
+ "@arkstack/database": "^0.12.14",
41
+ "@arkstack/contract": "^0.12.14"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/nodemailer": "^7.0.11"