@runnerpro/backend 1.6.5 → 1.6.7
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.
|
@@ -11,10 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.sendNotification = void 0;
|
|
13
13
|
const index_1 = require("../db/index");
|
|
14
|
-
const
|
|
14
|
+
const { getMessaging } = require('firebase-admin/messaging');
|
|
15
|
+
const sendNotification = ({ idCliente, title, body }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const messaging = getMessaging();
|
|
15
17
|
const devices = yield (0, index_1.query)('SELECT [SUBSCRIPTION], [TYPE] FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ?', [idCliente]);
|
|
16
18
|
for (const device of devices) {
|
|
17
|
-
notificationWEB(
|
|
19
|
+
notificationWEB(messaging, {
|
|
18
20
|
title,
|
|
19
21
|
body,
|
|
20
22
|
}, device.subscription);
|
|
@@ -4,6 +4,6 @@ interface Notification {
|
|
|
4
4
|
title?: string;
|
|
5
5
|
body: string;
|
|
6
6
|
}
|
|
7
|
-
declare const sendNotification: ({
|
|
7
|
+
declare const sendNotification: ({ idCliente, title, body }: Notification) => Promise<void>;
|
|
8
8
|
export { sendNotification };
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,gBAAgB,+BAAsC,YAAY,kBAcvE,CAAC;AAqBF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|