@runnerpro/backend 1.0.3 → 1.0.4
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.
|
@@ -14,7 +14,6 @@ const apn = require('@parse/node-apn');
|
|
|
14
14
|
const { query } = require('../db');
|
|
15
15
|
const sendNotification = ({ firebaseMessaging, idCliente, title, body, url, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
const devices = yield query('SELECT [SUBSCRIPTION], [TYPE] FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ?', [idCliente]);
|
|
17
|
-
console.log(devices);
|
|
18
17
|
for (const device of devices) {
|
|
19
18
|
if (device.type === 'IOS') {
|
|
20
19
|
notificationIOS({
|
|
@@ -47,14 +46,7 @@ function notificationIOS(msg, token) {
|
|
|
47
46
|
note.expiry = Math.floor(Date.now() / 1000) + 3600 * 24; // Expires 24 hour from now.
|
|
48
47
|
note.alert = { title: 'RunnerPro', subtitle: msg.title, body: msg.body };
|
|
49
48
|
note.topic = 'ios.runnerpro.cliente';
|
|
50
|
-
apnProvider
|
|
51
|
-
.send(note, token)
|
|
52
|
-
.then((result) => {
|
|
53
|
-
console.log(result);
|
|
54
|
-
})
|
|
55
|
-
.catch((error) => {
|
|
56
|
-
console.log(error);
|
|
57
|
-
});
|
|
49
|
+
apnProvider.send(note, token);
|
|
58
50
|
});
|
|
59
51
|
}
|
|
60
52
|
function notificationWEB(firebaseMessaging, msg, token) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,gBAAgB,wDAMnB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,gBAAgB,wDAMnB,YAAY,kBA2Bd,CAAC;AA+CF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runnerpro/backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A collection of common backend functions",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/cjs/index.js"
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@parse/node-apn": "6.0.1",
|
|
47
|
-
"firebase-admin": "11.10.1",
|
|
48
47
|
"nodemailer": "6.9.9",
|
|
49
48
|
"pg": "8.11.3"
|
|
50
49
|
},
|