@rpcbase/server 0.351.0 → 0.353.0-notifications.0
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/package.json +8 -8
- package/rts/index.js +1 -4
- package/src/models/Notification.js +44 -0
- package/src/models/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.353.0-notifications.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -60,27 +60,27 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@rpcbase/std": "0.
|
|
64
|
-
"@sentry/node": "8.
|
|
63
|
+
"@rpcbase/std": "0.17.0",
|
|
64
|
+
"@sentry/node": "8.24.0",
|
|
65
65
|
"bluebird": "3.7.2",
|
|
66
66
|
"body-parser": "1.20.2",
|
|
67
|
-
"bull": "4.
|
|
67
|
+
"bull": "4.16.0",
|
|
68
68
|
"connect-redis": "7.1.1",
|
|
69
69
|
"cors": "2.8.5",
|
|
70
|
-
"debug": "4.3.
|
|
70
|
+
"debug": "4.3.6",
|
|
71
71
|
"dotenv": "16.4.5",
|
|
72
72
|
"expect": "29.7.0",
|
|
73
73
|
"express": "4.19.2",
|
|
74
74
|
"express-session": "1.18.0",
|
|
75
|
-
"firebase-admin": "12.
|
|
75
|
+
"firebase-admin": "12.3.0",
|
|
76
76
|
"glob": "11.0.0",
|
|
77
77
|
"jest-extended": "4.0.2",
|
|
78
78
|
"lodash": "4.17.21",
|
|
79
79
|
"mkdirp": "3.0.1",
|
|
80
|
-
"mongoose": "8.5.
|
|
80
|
+
"mongoose": "8.5.2",
|
|
81
81
|
"picocolors": "1.0.1",
|
|
82
82
|
"postmark": "4.0.4",
|
|
83
|
-
"redis": "4.
|
|
83
|
+
"redis": "4.7.0",
|
|
84
84
|
"request-ip": "3.3.0",
|
|
85
85
|
"sift": "17.1.3",
|
|
86
86
|
"socket.io": "4.7.5",
|
package/rts/index.js
CHANGED
|
@@ -273,10 +273,7 @@ const run_query = async(mongoose, socket_id, {model_name, query, query_key, opti
|
|
|
273
273
|
|
|
274
274
|
// log("initial run_query AUTH", ctx.req.session.user_id)
|
|
275
275
|
if (!ctx.req.session.user_id) {
|
|
276
|
-
|
|
277
|
-
// throw new Error("no user ID for client query")
|
|
278
|
-
console.log("no user ID for client query")
|
|
279
|
-
// TODO: this happens right after sign in, investigate
|
|
276
|
+
console.warn("no user ID for client query")
|
|
280
277
|
s.emit("query_payload", {model_name, query_key, error: "error no user id"})
|
|
281
278
|
return
|
|
282
279
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
const mongoose = require("../../mongoose")
|
|
3
|
+
|
|
4
|
+
const NOTIFICATIONS_TYPES = {
|
|
5
|
+
new_message: "new_message",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const NotificationSchema = new mongoose.Schema(
|
|
9
|
+
{
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: Object.keys(NOTIFICATIONS_TYPES),
|
|
13
|
+
},
|
|
14
|
+
notification: {
|
|
15
|
+
title: String,
|
|
16
|
+
body: String,
|
|
17
|
+
icon: String,
|
|
18
|
+
},
|
|
19
|
+
action_url: String,
|
|
20
|
+
ack_at_ms: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: null,
|
|
23
|
+
},
|
|
24
|
+
server_timestamp_ms: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
context: mongoose.Schema.Types.Mixed,
|
|
29
|
+
push_sent: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: [],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
strict: false,
|
|
36
|
+
versionKey: false,
|
|
37
|
+
},
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const model = mongoose.model("Notification", NotificationSchema)
|
|
41
|
+
|
|
42
|
+
model.NOTIFICATIONS_TYPES = NOTIFICATIONS_TYPES
|
|
43
|
+
|
|
44
|
+
module.exports = model
|