@ccci/micro-server 1.0.107 → 1.0.109

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.
@@ -20,5 +20,6 @@ export type ApplicationOptionType = {
20
20
  smtpHost?: string;
21
21
  smtpUser?: string;
22
22
  smtpPassword?: string;
23
+ enablePushNotifications?: boolean;
23
24
  };
24
25
  //# sourceMappingURL=ApplicationOptionType.d.ts.map
@@ -0,0 +1,8 @@
1
+ export type NotificationType = {
2
+ title: string;
3
+ body: string;
4
+ };
5
+ export type NotificationOptions = {
6
+ isBroadcast?: Boolean;
7
+ };
8
+ //# sourceMappingURL=NotificationTypes.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { NotificationType, NotificationOptions } from '@/types/NotificationTypes';
2
+ import admin from 'firebase-admin';
3
+ import { BatchResponse } from 'firebase-admin/lib/messaging/messaging-api';
4
+ export default class PushNotifier {
5
+ static FirebaseAdmin: typeof admin;
6
+ static instance: number;
7
+ private static rootDir;
8
+ constructor(path: string);
9
+ /**
10
+ * Initiate sending push notifications
11
+ * @param tokens firebase user tokens
12
+ * @param message message to send
13
+ * @param metadata
14
+ * @param options
15
+ */
16
+ static sendNotifications(tokens: Array<string>, message: NotificationType, metadata?: any, options?: NotificationOptions): Promise<BatchResponse | undefined>;
17
+ }
18
+ //# sourceMappingURL=PushNotifier.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.107",
3
+ "version": "1.0.109",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,6 +39,8 @@
39
39
  "cors": "^2.8.5",
40
40
  "express": "^4.19.2",
41
41
  "express-fileupload": "^1.5.0",
42
+ "firebase": "^10.13.1",
43
+ "firebase-admin": "^12.4.0",
42
44
  "handlebars": "^4.7.8",
43
45
  "helmet": "^7.1.0",
44
46
  "jsonwebtoken": "^9.0.2",