@ccci/micro-server 1.0.118 → 1.0.120

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.js CHANGED
@@ -250958,10 +250958,6 @@ class PushNotifier {
250958
250958
  credential: import_firebase_admin.default.credential.cert(FirebaseServiceAccount.default)
250959
250959
  });
250960
250960
  PushNotifier.instance = PushNotifier.FirebaseAdmin.app.length;
250961
- PushNotifier.FirebaseAdmin.messaging().send({
250962
- token: "fW3o0vp_F2iPB9qsJp0UEP:APA91bEuiMrkpSQnJi8FyvkNPJNK4uSTqBHGQ18QLufnZpl7xOC3-6-Fz938fCqX0iimTNAFpY42r2Dm0zz3ClGgOhagF9MTjYE3JwresxjfxRhe8NO-qK8UbYp8-EwDDs0PalNCMMfu",
250963
- notification: { title: "Push Notification", body: "Push Notification" }
250964
- });
250965
250961
  });
250966
250962
  }
250967
250963
  }
@@ -250981,6 +250977,19 @@ class PushNotifier {
250981
250977
  console.log("error :>> ", error);
250982
250978
  }
250983
250979
  }
250980
+ static async sendNotification(token, message, metadata = {}, options) {
250981
+ try {
250982
+ let params = {
250983
+ token,
250984
+ notification: message,
250985
+ data: metadata
250986
+ };
250987
+ let result = await PushNotifier.FirebaseAdmin.messaging().send(params);
250988
+ return result;
250989
+ } catch (error) {
250990
+ console.log("error :>> ", error);
250991
+ }
250992
+ }
250984
250993
  }
250985
250994
 
250986
250995
  // src/utils/ApplicationServer.ts
@@ -14,5 +14,6 @@ export default class PushNotifier {
14
14
  * @param options
15
15
  */
16
16
  static sendNotifications(tokens: Array<string>, message: NotificationType, metadata?: any, options?: NotificationOptions): Promise<BatchResponse | undefined>;
17
+ static sendNotification(token: string, message: NotificationType, metadata?: any, options?: NotificationOptions): Promise<string | undefined>;
17
18
  }
18
19
  //# 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.118",
3
+ "version": "1.0.120",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",