@superhuman/push-receiver
Advanced tools
+2
-1
| { | ||
| "name": "@superhuman/push-receiver", | ||
| "version": "1.1.8", | ||
| "version": "1.1.9", | ||
| "description": "A module to subscribe to GCM/FCM and receive notifications within a node process.", | ||
@@ -48,2 +48,3 @@ "main": "src/index.js", | ||
| "dependencies": { | ||
| "electron-log": "^2.2.14", | ||
| "http_ece": "^1.0.5", | ||
@@ -50,0 +51,0 @@ "long": "^3.2.0", |
+9
-10
| const crypto = require('crypto'); | ||
| const request = require('request-promise'); | ||
| const log = require('electron-log'); | ||
| const { escape } = require('../utils/base64'); | ||
| log.transports.console.level = 'info'; | ||
| log.transports.file.level = 'info'; | ||
| const FCM_SUBSCRIBE = 'https://fcm.googleapis.com/fcm/connect/subscribe'; | ||
@@ -12,2 +16,3 @@ const FCM_ENDPOINT = 'https://fcm.googleapis.com/fcm/send'; | ||
| const keys = await createKeys(); | ||
| log.info('CREATED KEYS', keys) | ||
| const response = await request({ | ||
@@ -22,10 +27,4 @@ url : FCM_SUBSCRIBE, | ||
| endpoint : `${FCM_ENDPOINT}/${token}`, | ||
| encryption_key : keys.publicKey | ||
| .replace(/=/g, '') | ||
| .replace(/\+/g, '-') | ||
| .replace(/\//g, '_'), | ||
| encryption_key : keys.publicKey, | ||
| encryption_auth : keys.authSecret | ||
| .replace(/=/g, '') | ||
| .replace(/\+/g, '-') | ||
| .replace(/\//g, '_'), | ||
| }, | ||
@@ -48,5 +47,5 @@ }); | ||
| return resolve({ | ||
| privateKey : escape(dh.getPrivateKey('base64')), | ||
| publicKey : escape(dh.getPublicKey('base64')), | ||
| authSecret : escape(buf.toString('base64')), | ||
| privateKey : dh.getPrivateKey('base64'), | ||
| publicKey : dh.getPublicKey('base64'), | ||
| authSecret : buf.toString('base64'), | ||
| }); | ||
@@ -53,0 +52,0 @@ }); |
+4
-0
@@ -455,2 +455,6 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| electron-log@^2.2.14: | ||
| version "2.2.14" | ||
| resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-2.2.14.tgz#2123319ccb8d70b0db07f0eda57d5823cb42b4b0" | ||
| escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: | ||
@@ -457,0 +461,0 @@ version "1.0.5" |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
113213
0.13%7
16.67%863
-0.23%+ Added
+ Added