@arkstack/notifications 0.12.18 → 0.12.19

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 +10 -20
  2. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { DotPath, DotPathValue, MergedConfig } from "@arkstack/common";
2
2
  import { Transporter } from "nodemailer";
3
3
  import { Model } from "@arkstack/database";
4
- import { User } from "@arkstack/auth";
4
+ import { User } from "@app/models/User";
5
+ import { User as User$1 } from "@arkstack/auth";
5
6
  import * as _$twilio_lib_rest_api_v2010_account_message0 from "twilio/lib/rest/api/v2010/account/message.js";
6
7
  import * as _$arkormx from "arkormx";
7
8
 
@@ -142,28 +143,17 @@ declare abstract class NotificationContract<TResult = DriverResult> {
142
143
  };
143
144
  }
144
145
  //#endregion
145
- //#region src/Contracts/User.d.ts
146
- declare abstract class User$1 extends Model {
147
- [key: string]: any;
148
- email: string;
149
- name: string;
150
- password: string;
151
- createdAt: Date;
152
- updatedAt: Date;
153
- protected static table?: string | undefined;
154
- }
155
- //#endregion
156
146
  //#region src/drivers/DbNotification.d.ts
157
147
  declare class DbNotification extends NotificationContract<UserNotification> {
158
148
  private user?;
159
149
  private payload;
160
150
  from(_from: string): this;
161
151
  subject(subject: string): this;
162
- recipient(recipient: NotificationRecipient | User$1): this;
152
+ recipient(recipient: NotificationRecipient | User): this;
163
153
  type(type: DbNotificationPayload['type']): this;
164
154
  action(text?: string | null, link?: string | null): this;
165
155
  meta(meta?: NotificationData | null): this;
166
- create(user: User$1, payload: DbNotificationPayload): Promise<UserNotification>;
156
+ create(user: User, payload: DbNotificationPayload): Promise<UserNotification>;
167
157
  send(message: string, subject?: string, _recipient?: NotificationRecipient, data?: NotificationData): Promise<UserNotification>;
168
158
  }
169
159
  //#endregion
@@ -219,7 +209,7 @@ declare class MailNotification extends NotificationContract {
219
209
  *
220
210
  * @param user The recipient user(s) for the notification.
221
211
  */
222
- prepare(user?: null | string | string[] | User, data?: Record<string, any>): this;
212
+ prepare(user?: null | string | string[] | User$1, data?: Record<string, any>): this;
223
213
  /**
224
214
  * Send a notification to the specified recipient(s) with the given message.
225
215
  *
@@ -281,18 +271,18 @@ declare class Notification<D extends keyof DriverMap = keyof DriverMap> {
281
271
  static sms(options?: SmsDriverOptions): SmsNotification;
282
272
  static db(): DbNotification;
283
273
  static channel(channel?: NotificationChannel | 'email', options?: MailDriverOptions | SmsDriverOptions): MailNotification | SmsNotification | DbNotification;
284
- prepare(recipient?: null | MailRecipient | NotificationRecipient | User$1, data?: NotificationData): DriverMap[D];
274
+ prepare(recipient?: null | MailRecipient | NotificationRecipient | User, data?: NotificationData): DriverMap[D];
285
275
  private static createDriver;
286
276
  }
287
277
  //#endregion
288
278
  //#region src/UserNotificationCenter.d.ts
289
279
  declare class UserNotificationCenter {
290
280
  private static getModel;
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[]>>;
281
+ static create(user: User, payload: DbNotificationPayload): Promise<UserNotification>;
282
+ static forUser(user: User): Promise<_$arkormx.ArkormCollection<UserNotification, UserNotification[]>>;
283
+ static unreadForUser(user: User): Promise<_$arkormx.ArkormCollection<UserNotification, UserNotification[]>>;
294
284
  static markRead(notification: UserNotification | UserNotification['id']): Promise<void>;
295
- static markAllRead(user: User$1): Promise<void>;
285
+ static markAllRead(user: User): Promise<void>;
296
286
  static delete(notification: UserNotification | UserNotification['id']): Promise<void>;
297
287
  }
298
288
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/notifications",
3
- "version": "0.12.18",
3
+ "version": "0.12.19",
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.18"
37
+ "@arkstack/common": "^0.12.19"
38
38
  },
39
39
  "peerDependencies": {
40
- "@arkstack/database": "^0.12.18",
41
- "@arkstack/contract": "^0.12.18"
40
+ "@arkstack/database": "^0.12.19",
41
+ "@arkstack/contract": "^0.12.19"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/nodemailer": "^7.0.11"