@runnerpro/backend 1.0.3 → 1.0.5
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/lib/cjs/err/index.js +7 -0
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/sendNotification/index.js +1 -9
- package/lib/cjs/types/err/index.d.ts +3 -0
- package/lib/cjs/types/err/index.d.ts.map +1 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/sendNotification/index.d.ts.map +1 -1
- package/package.json +1 -2
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
3
|
+
exports.err = exports.sendMail = exports.batchQuery = exports.query = exports.sleep = exports.sendNotification = void 0;
|
|
4
4
|
const sendNotification_1 = require("./sendNotification");
|
|
5
5
|
Object.defineProperty(exports, "sendNotification", { enumerable: true, get: function () { return sendNotification_1.sendNotification; } });
|
|
6
6
|
const sleep_1 = require("./sleep");
|
|
@@ -10,3 +10,5 @@ Object.defineProperty(exports, "query", { enumerable: true, get: function () { r
|
|
|
10
10
|
Object.defineProperty(exports, "batchQuery", { enumerable: true, get: function () { return db_1.batchQuery; } });
|
|
11
11
|
const sendMail_1 = require("./sendMail");
|
|
12
12
|
Object.defineProperty(exports, "sendMail", { enumerable: true, get: function () { return sendMail_1.sendMail; } });
|
|
13
|
+
const err_1 = require("./err");
|
|
14
|
+
Object.defineProperty(exports, "err", { enumerable: true, get: function () { return err_1.err; } });
|
|
@@ -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) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/err/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,GAAG,QAAS,GAAG,OAAO,GAAG,SAAS,GAAG,UAE1C,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { sendNotification } from './sendNotification';
|
|
|
2
2
|
import { sleep } from './sleep';
|
|
3
3
|
import { query, batchQuery } from './db';
|
|
4
4
|
import { sendMail } from './sendMail';
|
|
5
|
-
|
|
5
|
+
import { err } from './err';
|
|
6
|
+
export { sendNotification, sleep, query, batchQuery, sendMail, err };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -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.5",
|
|
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
|
},
|