90dc-core 1.6.1 → 1.6.2

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.
@@ -1,5 +1,5 @@
1
1
  import apn from "apn";
2
- import type { AndroidMessage } from "../models/NotificationInterfaces";
2
+ import type { AndroidMessage, NotificationRequest } from "../models/NotificationInterfaces";
3
3
  export default class NotificationsUtil {
4
4
  private static apnProvider;
5
5
  private static getAccessToken;
@@ -8,7 +8,7 @@ export default class NotificationsUtil {
8
8
  static sendAndroidNotification(notification: AndroidMessage): Promise<void>;
9
9
  private static buildAppleNotification;
10
10
  private static buildAndroidNotification;
11
- private static sendNotification;
11
+ static sendNotification(userUuid: string, notification: NotificationRequest): Promise<void>;
12
12
  static calculateDelayUntil10AM(timeZone: string, additionalDelay?: number): number;
13
13
  static calculateDelayUntil6PM(timeZone: string): number;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/NotificationsUtil.ts"],"sourcesContent":["import apn, { Provider } from \"apn\";\nimport axios, { isAxiosError } from \"axios\";\nimport * as dotenv from \"dotenv\";\nimport { google } from \"googleapis\";\nimport type { JWT } from \"google-auth-library\";\nimport { cert_key } from \"../enums/cert\";\nimport type {\n AndroidMessage,\n NotificationRequest\n} from \"../models/NotificationInterfaces\";\nimport {DeviceTokens} from \"../dbmodels/DeviceTokens\";\ndotenv.config();\n\nexport default class NotificationsUtil {\n private static apnProvider: Provider = this.getAPNProvider();\n\n private static async getAccessToken(): Promise<string> {\n const key = cert_key;\n\n const jwtClient: JWT = new google.auth.JWT({\n email: key.client_email,\n key: key.private_key,\n scopes: [\"https://www.googleapis.com/auth/firebase.messaging\"],\n });\n\n return new Promise<string>((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n jwtClient.authorize((err: any, tokens: any) => {\n if (err) {\n reject(err);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n resolve(tokens.access_token as string);\n });\n });\n }\n\n private static getAPNProvider(): Provider {\n return new apn.Provider({\n token: {\n key: process.env.APN_KEY_PATH as string,\n keyId: process.env.NOTIFICATIONS_KEY_ID as string,\n teamId: process.env.NOTIFICATIONS_TEAM_ID as string,\n },\n production: true,\n });\n }\n\n public static async sendAppleNotification(\n notification: apn.Notification,\n token: string | string[]\n ) {\n try {\n await this.apnProvider.send(notification, token);\n } catch (e) {\n console.error(\n `ERROR: Could not send apple notification: ${(e as Error).message}`\n );\n }\n }\n\n public static async sendAndroidNotification(notification: AndroidMessage) {\n try {\n await axios.post(\n \"https://fcm.googleapis.com/v1/projects/dayschallenge-373510/messages:send\",\n notification,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${await this.getAccessToken()}`,\n },\n }\n );\n } catch (e) {\n if (isAxiosError(e)) {\n console.error(\n `ERROR: Could not send android notification: ${(e as Error).message}`\n );\n }\n }\n }\n\n private static buildAppleNotification(notificationReq: NotificationRequest) {\n const notification: apn.Notification = new apn.Notification();\n notification.topic = process.env.APPLE_BUNDLE_ID as string;\n notification.priority = 10;\n notification.expiry = Math.floor(Date.now() / 1000) + 3600;\n notification.rawPayload = {\n aps: {\n alert: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n \"content-available\": 1,\n sound: \"default\",\n redirectPath: notificationReq.redirectPath,\n },\n };\n return notification;\n }\n\n private static buildAndroidNotification(\n notificationReq: NotificationRequest,\n token: string | string[]\n ): AndroidMessage {\n if (Array.isArray(token)) {\n return {\n message: {\n token: token,\n notification: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n },\n };\n }\n\n return {\n message: {\n token: token,\n notification: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n },\n };\n }\n\n\n private static async sendNotification(\n userUuid: string,\n notification: NotificationRequest\n ) {\n const deviceToken: DeviceTokens | null = await DeviceTokens.findOne({\n where: { userUuid: userUuid },\n raw: true,\n });\n\n if (!deviceToken) {\n console.error(`ERROR: No token found for user ${userUuid}}`);\n return;\n }\n\n deviceToken.platform === \"ios\"\n ? await this.sendAppleNotification(\n this.buildAppleNotification(notification),\n deviceToken.deviceToken\n )\n : await this.sendAndroidNotification(\n this.buildAndroidNotification(notification, deviceToken.deviceToken)\n );\n }\n\n public static calculateDelayUntil10AM(timeZone: string, additionalDelay = 0) {\n const now = new Date(new Date().toLocaleString(\"en-US\", { timeZone }));\n\n // Create a Date object for 10 AM today in the user's time zone\n const next10AM = new Date(now);\n next10AM.setHours(10, 0, 0, 0);\n\n // If the current time is past 10 AM, set the next 10 AM to tomorrow\n if (now.getTime() > next10AM.getTime()) {\n next10AM.setDate(next10AM.getDate() + 1);\n }\n next10AM.setDate(next10AM.getDate() + additionalDelay);\n // Calculate the delay in milliseconds\n return next10AM.getTime() - now.getTime();\n }\n\n public static calculateDelayUntil6PM(timeZone: string) {\n // Get the current date and time in the user's time zone\n const now = new Date(new Date().toLocaleString(\"en-US\", { timeZone }));\n\n // Create a Date object for 6 PM today in the user's time zone\n const next6PM = new Date(now);\n next6PM.setHours(18, 0, 0, 0);\n\n // If the current time is past 6 PM, set the next 6 PM to tomorrow\n if (now.getTime() > next6PM.getTime()) {\n next6PM.setDate(next6PM.getDate() + 1);\n }\n\n // Calculate the delay in milliseconds\n return next6PM.getTime() - now.getTime();\n }\n}\n"],"names":["apn","axios","isAxiosError","dotenv","google","cert_key","DeviceTokens","config","NotificationsUtil","apnProvider","getAPNProvider","getAccessToken","key","jwtClient","auth","JWT","email","client_email","private_key","scopes","Promise","resolve","reject","authorize","err","tokens","access_token","Provider","token","process","env","APN_KEY_PATH","keyId","NOTIFICATIONS_KEY_ID","teamId","NOTIFICATIONS_TEAM_ID","production","sendAppleNotification","notification","send","e","console","error","message","sendAndroidNotification","post","headers","Authorization","buildAppleNotification","notificationReq","Notification","topic","APPLE_BUNDLE_ID","priority","expiry","Math","floor","Date","now","rawPayload","aps","alert","title","body","sound","redirectPath","buildAndroidNotification","Array","isArray","sendNotification","userUuid","deviceToken","findOne","where","raw","platform","calculateDelayUntil10AM","timeZone","additionalDelay","toLocaleString","next10AM","setHours","getTime","setDate","getDate","calculateDelayUntil6PM","next6PM"],"mappings":"AAAA,OAAOA,SAAuB,MAAM;AACpC,OAAOC,SAASC,YAAY,QAAQ,QAAQ;AAC5C,YAAYC,YAAY,SAAS;AACjC,SAASC,MAAM,QAAQ,aAAa;AAEpC,SAASC,QAAQ,QAAQ,gBAAgB;AAKzC,SAAQC,YAAY,QAAO,2BAA2B;AACtDH,OAAOI,MAAM;AAEb,eAAe,MAAMC;IACnB,OAAeC,cAAwB,IAAI,CAACC,cAAc,GAAG;IAE7D,aAAqBC,iBAAkC;QACrD,MAAMC,MAAMP;QAEZ,MAAMQ,YAAiB,IAAIT,OAAOU,IAAI,CAACC,GAAG,CAAC;YACzCC,OAAOJ,IAAIK,YAAY;YACvBL,KAAKA,IAAIM,WAAW;YACpBC,QAAQ;gBAAC;aAAqD;QAChE;QAEA,OAAO,IAAIC,QAAgB,CAACC,SAASC,SAAW;YAC9C,wGAAwG;YACxGT,UAAUU,SAAS,CAAC,CAACC,KAAUC,SAAgB;gBAC7C,IAAID,KAAK;oBACPF,OAAOE;oBACP;gBACF,CAAC;gBAED,sEAAsE;gBACtEH,QAAQI,OAAOC,YAAY;YAC7B;QACF;IACF;IAEA,OAAehB,iBAA2B;QACxC,OAAO,IAAIV,IAAI2B,QAAQ,CAAC;YACtBC,OAAO;gBACLhB,KAAKiB,QAAQC,GAAG,CAACC,YAAY;gBAC7BC,OAAOH,QAAQC,GAAG,CAACG,oBAAoB;gBACvCC,QAAQL,QAAQC,GAAG,CAACK,qBAAqB;YAC3C;YACAC,YAAY,IAAI;QAClB;IACF;IAEA,aAAoBC,sBAClBC,YAA8B,EAC9BV,KAAwB,EACxB;QACA,IAAI;YACF,MAAM,IAAI,CAACnB,WAAW,CAAC8B,IAAI,CAACD,cAAcV;QAC5C,EAAE,OAAOY,GAAG;YACVC,QAAQC,KAAK,CACX,CAA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ClE,IAAIvB,IAAIwB,OAAO,KAAKI,QAAQJ,OAAO,IAAI;YACrCI,QAAQH,OAAO,CAACG,QAAQF,OAAO,KAAK;QACtC,CAAC;QAED,sCAAsC;QACtC,OAAOE,QAAQJ,OAAO,KAAKxB,IAAIwB,OAAO;IACxC;AACF,CAAC"}
1
+ {"version":3,"sources":["../../../src/lib/utils/NotificationsUtil.ts"],"sourcesContent":["import apn, { Provider } from \"apn\";\nimport axios, { isAxiosError } from \"axios\";\nimport * as dotenv from \"dotenv\";\nimport { google } from \"googleapis\";\nimport type { JWT } from \"google-auth-library\";\nimport { cert_key } from \"../enums/cert\";\nimport type {\n AndroidMessage,\n NotificationRequest\n} from \"../models/NotificationInterfaces\";\nimport {DeviceTokens} from \"../dbmodels/DeviceTokens\";\ndotenv.config();\n\nexport default class NotificationsUtil {\n private static apnProvider: Provider = this.getAPNProvider();\n\n private static async getAccessToken(): Promise<string> {\n const key = cert_key;\n\n const jwtClient: JWT = new google.auth.JWT({\n email: key.client_email,\n key: key.private_key,\n scopes: [\"https://www.googleapis.com/auth/firebase.messaging\"],\n });\n\n return new Promise<string>((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access\n jwtClient.authorize((err: any, tokens: any) => {\n if (err) {\n reject(err);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n resolve(tokens.access_token as string);\n });\n });\n }\n\n private static getAPNProvider(): Provider {\n return new apn.Provider({\n token: {\n key: process.env.APN_KEY_PATH as string,\n keyId: process.env.NOTIFICATIONS_KEY_ID as string,\n teamId: process.env.NOTIFICATIONS_TEAM_ID as string,\n },\n production: true,\n });\n }\n\n public static async sendAppleNotification(\n notification: apn.Notification,\n token: string | string[]\n ) {\n try {\n await this.apnProvider.send(notification, token);\n } catch (e) {\n console.error(\n `ERROR: Could not send apple notification: ${(e as Error).message}`\n );\n }\n }\n\n public static async sendAndroidNotification(notification: AndroidMessage) {\n try {\n await axios.post(\n \"https://fcm.googleapis.com/v1/projects/dayschallenge-373510/messages:send\",\n notification,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${await this.getAccessToken()}`,\n },\n }\n );\n } catch (e) {\n if (isAxiosError(e)) {\n console.error(\n `ERROR: Could not send android notification: ${(e as Error).message}`\n );\n }\n }\n }\n\n private static buildAppleNotification(notificationReq: NotificationRequest) {\n const notification: apn.Notification = new apn.Notification();\n notification.topic = process.env.APPLE_BUNDLE_ID as string;\n notification.priority = 10;\n notification.expiry = Math.floor(Date.now() / 1000) + 3600;\n notification.rawPayload = {\n aps: {\n alert: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n \"content-available\": 1,\n sound: \"default\",\n redirectPath: notificationReq.redirectPath,\n },\n };\n return notification;\n }\n\n private static buildAndroidNotification(\n notificationReq: NotificationRequest,\n token: string | string[]\n ): AndroidMessage {\n if (Array.isArray(token)) {\n return {\n message: {\n token: token,\n notification: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n },\n };\n }\n\n return {\n message: {\n token: token,\n notification: {\n title: notificationReq.title,\n body: notificationReq.body,\n },\n },\n };\n }\n\n\n public static async sendNotification(\n userUuid: string,\n notification: NotificationRequest\n ) {\n const deviceToken: DeviceTokens | null = await DeviceTokens.findOne({\n where: { userUuid: userUuid },\n raw: true,\n });\n\n if (!deviceToken) {\n console.error(`ERROR: No token found for user ${userUuid}}`);\n return;\n }\n\n deviceToken.platform === \"ios\"\n ? await this.sendAppleNotification(\n this.buildAppleNotification(notification),\n deviceToken.deviceToken\n )\n : await this.sendAndroidNotification(\n this.buildAndroidNotification(notification, deviceToken.deviceToken)\n );\n }\n\n public static calculateDelayUntil10AM(timeZone: string, additionalDelay = 0) {\n const now = new Date(new Date().toLocaleString(\"en-US\", { timeZone }));\n\n // Create a Date object for 10 AM today in the user's time zone\n const next10AM = new Date(now);\n next10AM.setHours(10, 0, 0, 0);\n\n // If the current time is past 10 AM, set the next 10 AM to tomorrow\n if (now.getTime() > next10AM.getTime()) {\n next10AM.setDate(next10AM.getDate() + 1);\n }\n next10AM.setDate(next10AM.getDate() + additionalDelay);\n // Calculate the delay in milliseconds\n return next10AM.getTime() - now.getTime();\n }\n\n public static calculateDelayUntil6PM(timeZone: string) {\n // Get the current date and time in the user's time zone\n const now = new Date(new Date().toLocaleString(\"en-US\", { timeZone }));\n\n // Create a Date object for 6 PM today in the user's time zone\n const next6PM = new Date(now);\n next6PM.setHours(18, 0, 0, 0);\n\n // If the current time is past 6 PM, set the next 6 PM to tomorrow\n if (now.getTime() > next6PM.getTime()) {\n next6PM.setDate(next6PM.getDate() + 1);\n }\n\n // Calculate the delay in milliseconds\n return next6PM.getTime() - now.getTime();\n }\n}\n"],"names":["apn","axios","isAxiosError","dotenv","google","cert_key","DeviceTokens","config","NotificationsUtil","apnProvider","getAPNProvider","getAccessToken","key","jwtClient","auth","JWT","email","client_email","private_key","scopes","Promise","resolve","reject","authorize","err","tokens","access_token","Provider","token","process","env","APN_KEY_PATH","keyId","NOTIFICATIONS_KEY_ID","teamId","NOTIFICATIONS_TEAM_ID","production","sendAppleNotification","notification","send","e","console","error","message","sendAndroidNotification","post","headers","Authorization","buildAppleNotification","notificationReq","Notification","topic","APPLE_BUNDLE_ID","priority","expiry","Math","floor","Date","now","rawPayload","aps","alert","title","body","sound","redirectPath","buildAndroidNotification","Array","isArray","sendNotification","userUuid","deviceToken","findOne","where","raw","platform","calculateDelayUntil10AM","timeZone","additionalDelay","toLocaleString","next10AM","setHours","getTime","setDate","getDate","calculateDelayUntil6PM","next6PM"],"mappings":"AAAA,OAAOA,SAAuB,MAAM;AACpC,OAAOC,SAASC,YAAY,QAAQ,QAAQ;AAC5C,YAAYC,YAAY,SAAS;AACjC,SAASC,MAAM,QAAQ,aAAa;AAEpC,SAASC,QAAQ,QAAQ,gBAAgB;AAKzC,SAAQC,YAAY,QAAO,2BAA2B;AACtDH,OAAOI,MAAM;AAEb,eAAe,MAAMC;IACnB,OAAeC,cA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sBAAsB,CAACV,eAC5BiC,YAAYA,WAAW,IAEzB,MAAM,IAAI,CAAC3B,uBAAuB,CAChC,IAAI,CAACsB,wBAAwB,CAAC5B,cAAciC,YAAYA,WAAW,EACpE;IACP;IAEA,OAAcK,wBAAwBC,QAAgB,EAAEC,kBAAkB,CAAC,EAAE;QAC3E,MAAMpB,MAAM,IAAID,KAAK,IAAIA,OAAOsB,cAAc,CAAC,SAAS;YAAEF;QAAS;QAEnE,+DAA+D;QAC/D,MAAMG,WAAW,IAAIvB,KAAKC;QAC1BsB,SAASC,QAAQ,CAAC,IAAI,GAAG,GAAG;QAE5B,oEAAoE;QACpE,IAAIvB,IAAIwB,OAAO,KAAKF,SAASE,OAAO,IAAI;YACtCF,SAASG,OAAO,CAACH,SAASI,OAAO,KAAK;QACxC,CAAC;QACDJ,SAASG,OAAO,CAACH,SAASI,OAAO,KAAKN;QACtC,sCAAsC;QACtC,OAAOE,SAASE,OAAO,KAAKxB,IAAIwB,OAAO;IACzC;IAEA,OAAcG,uBAAuBR,QAAgB,EAAE;QACrD,wDAAwD;QACxD,MAAMnB,MAAM,IAAID,KAAK,IAAIA,OAAOsB,cAAc,CAAC,SAAS;YAAEF;QAAS;QAEnE,8DAA8D;QAC9D,MAAMS,UAAU,IAAI7B,KAAKC;QACzB4B,QAAQL,QAAQ,CAAC,IAAI,GAAG,GAAG;QAE3B,kEAAkE;QAClE,IAAIvB,IAAIwB,OAAO,KAAKI,QAAQJ,OAAO,IAAI;YACrCI,QAAQH,OAAO,CAACG,QAAQF,OAAO,KAAK;QACtC,CAAC;QAED,sCAAsC;QACtC,OAAOE,QAAQJ,OAAO,KAAKxB,IAAIwB,OAAO;IACxC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -129,7 +129,7 @@ export default class NotificationsUtil {
129
129
  }
130
130
 
131
131
 
132
- private static async sendNotification(
132
+ public static async sendNotification(
133
133
  userUuid: string,
134
134
  notification: NotificationRequest
135
135
  ) {