@arkstack/notifications 0.17.24 → 0.17.26

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.
package/dist/index.d.ts CHANGED
@@ -425,6 +425,31 @@ declare class FirebaseRealtimeDriver implements RealtimeDriver {
425
425
  constructor(options?: FirebaseTransportConfig);
426
426
  private messaging;
427
427
  broadcast(channel: string | string[], event: string, payload: RealtimeNotificationPayload): Promise<string | FirebaseMulticastResult>;
428
+ /**
429
+ * Firebase channels do not require server-side authorization.
430
+ *
431
+ * @param _socketId
432
+ * @param _channel
433
+ * @param _data
434
+ */
435
+ auth(_socketId: string, _channel: string, _data?: unknown): Promise<void>;
436
+ /**
437
+ * Firebase does not require an authorization route.
438
+ *
439
+ * @param _authEndpoint
440
+ * @param _middleware
441
+ * @param _channelPrefix
442
+ * @param _config
443
+ */
444
+ static registerAuthRoute(_authEndpoint?: string, _middleware?: unknown | unknown[], _channelPrefix?: string, _config?: FirebaseTransportConfig): Promise<void>;
445
+ /**
446
+ * Firebase does not require an authorization route.
447
+ *
448
+ * @param _authEndpoint
449
+ * @param _middleware
450
+ * @param _channelPrefix
451
+ */
452
+ registerAuthRoute(_authEndpoint?: string, _middleware?: unknown | unknown[], _channelPrefix?: string): Promise<void>;
428
453
  /**
429
454
  * Send to many device tokens at once, chunked to FCM's 500-token limit, and
430
455
  * collect the tokens FCM rejects as dead so the caller can prune them.
@@ -497,9 +522,10 @@ declare class PusherRealtimeDriver implements RealtimeDriver {
497
522
  */
498
523
  interface RealtimeDriver {
499
524
  broadcast(channel: string | string[], event: string, payload: RealtimeNotificationPayload): Promise<unknown>;
500
- auth?(socketId: string, channel: string, data?: unknown): unknown | Promise<unknown>;
525
+ auth(socketId: string, channel: string, data?: unknown): unknown | Promise<unknown>;
526
+ registerAuthRoute(authEndpoint?: string, middleware?: unknown | unknown[], channelPrefix?: string): Promise<void>;
501
527
  }
502
- type RealtimeNotificationDriver<T extends RealtimeDriverName> = T extends 'firebase' ? FirebaseRealtimeDriver : T extends 'firebase' ? PusherRealtimeDriver : RealtimeDriver;
528
+ type RealtimeNotificationDriver<T extends RealtimeDriverName> = T extends 'firebase' ? FirebaseRealtimeDriver : T extends 'pusher' ? PusherRealtimeDriver : RealtimeDriver;
503
529
  //#endregion
504
530
  //#region src/drivers/RealtimeNotification.d.ts
505
531
  /**
package/dist/index.js CHANGED
@@ -561,6 +561,31 @@ var FirebaseRealtimeDriver = class {
561
561
  });
562
562
  }
563
563
  /**
564
+ * Firebase channels do not require server-side authorization.
565
+ *
566
+ * @param _socketId
567
+ * @param _channel
568
+ * @param _data
569
+ */
570
+ async auth(_socketId, _channel, _data) {}
571
+ /**
572
+ * Firebase does not require an authorization route.
573
+ *
574
+ * @param _authEndpoint
575
+ * @param _middleware
576
+ * @param _channelPrefix
577
+ * @param _config
578
+ */
579
+ static async registerAuthRoute(_authEndpoint = "/realtime/auth", _middleware, _channelPrefix, _config = {}) {}
580
+ /**
581
+ * Firebase does not require an authorization route.
582
+ *
583
+ * @param _authEndpoint
584
+ * @param _middleware
585
+ * @param _channelPrefix
586
+ */
587
+ async registerAuthRoute(_authEndpoint = "/realtime/auth", _middleware, _channelPrefix) {}
588
+ /**
564
589
  * Send to many device tokens at once, chunked to FCM's 500-token limit, and
565
590
  * collect the tokens FCM rejects as dead so the caller can prune them.
566
591
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkstack/notifications",
3
- "version": "0.17.24",
3
+ "version": "0.17.26",
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,7 +34,7 @@
34
34
  "africastalking": "^0.8.0",
35
35
  "nodemailer": "^9.0.3",
36
36
  "twilio": "^6.0.2",
37
- "@arkstack/common": "^0.17.24"
37
+ "@arkstack/common": "^0.17.26"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@kanun-hq/plugin-phone": "^0.1.8",
@@ -42,9 +42,9 @@
42
42
  "pusher": "^5.2.0",
43
43
  "@arkstack/contract": "^0.17.22",
44
44
  "@arkstack/database": "^0.17.22",
45
- "@arkstack/driver-h3": "^0.17.24",
46
- "@arkstack/driver-express": "^0.17.24",
47
- "@arkstack/jobs": "^0.17.24"
45
+ "@arkstack/driver-express": "^0.17.26",
46
+ "@arkstack/driver-h3": "^0.17.26",
47
+ "@arkstack/jobs": "^0.17.26"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@arkstack/driver-express": {