@rpcbase/server 0.224.0 → 0.226.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/cli/run_native.js
CHANGED
|
@@ -137,7 +137,7 @@ const get_processes = (args) => {
|
|
|
137
137
|
"-E", `http.port=${env.SEARCH_INDEX_PORT}`,
|
|
138
138
|
...(is_production ? [] : [
|
|
139
139
|
"-E", `http.cors.enabled=true`,
|
|
140
|
-
|
|
140
|
+
"-E", `http.cors.allow-origin=http://localhost:8080`,
|
|
141
141
|
]),
|
|
142
142
|
"-E", `path.data=${data_dir}`,
|
|
143
143
|
"-E", "discovery.type=single-node",
|
package/mailer/index.js
CHANGED
|
@@ -4,20 +4,23 @@ const postmark = require("postmark")
|
|
|
4
4
|
|
|
5
5
|
const log = debug("rb:mailer")
|
|
6
6
|
|
|
7
|
-
const {POSTMARK_API_KEY, IS_PRODUCTION} = process.env
|
|
7
|
+
const {POSTMARK_API_KEY, IS_PRODUCTION, RB_FORCE_SEND_EMAILS} = process.env
|
|
8
8
|
|
|
9
9
|
const is_production = IS_PRODUCTION === "yes"
|
|
10
|
+
const force_send = RB_FORCE_SEND_EMAILS === "yes"
|
|
11
|
+
|
|
10
12
|
log("mailer, is_production:", is_production, "env:", JSON.stringify(IS_PRODUCTION))
|
|
11
13
|
|
|
12
14
|
let client
|
|
13
15
|
|
|
14
|
-
if (is_production && typeof POSTMARK_API_KEY === "string" && POSTMARK_API_KEY.trim() !== "") {
|
|
16
|
+
if (force_send || is_production && typeof POSTMARK_API_KEY === "string" && POSTMARK_API_KEY.trim() !== "") {
|
|
15
17
|
client = new postmark.ServerClient(POSTMARK_API_KEY)
|
|
16
18
|
} else {
|
|
17
19
|
client = {
|
|
18
20
|
sendEmail: async(payload) => {
|
|
19
21
|
log("sendEmail disabled when not in production")
|
|
20
22
|
log("From:", payload.From, "To:", payload.To, "Subject:", payload.Subject)
|
|
23
|
+
return {Message: "OK"}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpcbase/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.226.0",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@rpcbase/access-control": "0.27.0",
|
|
14
|
-
"@rpcbase/agent": "0.
|
|
14
|
+
"@rpcbase/agent": "0.31.0",
|
|
15
15
|
"@rpcbase/std": "0.9.0",
|
|
16
16
|
"@sentry/node": "7.64.0",
|
|
17
17
|
"bluebird": "3.7.2",
|
|
18
18
|
"body-parser": "1.20.2",
|
|
19
|
-
"bull": "4.11.
|
|
19
|
+
"bull": "4.11.3",
|
|
20
20
|
"connect-redis": "6.1.3",
|
|
21
21
|
"cors": "2.8.5",
|
|
22
22
|
"debug": "4.3.4",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"glob": "9.3.5",
|
|
28
28
|
"lodash": "4.17.21",
|
|
29
29
|
"mkdirp": "2.1.3",
|
|
30
|
-
"mongoose": "7.4.
|
|
30
|
+
"mongoose": "7.4.3",
|
|
31
31
|
"picocolors": "1.0.0",
|
|
32
32
|
"postmark": "3.0.19",
|
|
33
33
|
"redis": "4.6.7",
|
package/queue/dispatch_queue.js
CHANGED
|
@@ -6,7 +6,7 @@ const op_names = {
|
|
|
6
6
|
update: "update",
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const dispatch_queue = (queue, model_name, op, doc) => {
|
|
9
|
+
const dispatch_queue = (queue, model_name, op, doc, update_description) => {
|
|
10
10
|
const instance = queue.instance()
|
|
11
11
|
|
|
12
12
|
const tasks = queue.get_tasks()
|
|
@@ -16,9 +16,7 @@ const dispatch_queue = (queue, model_name, op, doc) => {
|
|
|
16
16
|
// skip if there's no matching handler
|
|
17
17
|
if (!Object.keys(tasks).includes(handler_name)) return
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
queue.add(handler_name, {doc}, {
|
|
19
|
+
queue.add(handler_name, {doc, update_description}, {
|
|
22
20
|
jobId: `${op}-${doc._id}`,
|
|
23
21
|
removeOnComplete: true,
|
|
24
22
|
removeOnFail: true,
|
|
@@ -40,7 +40,7 @@ const mongoose_delete_plugin = (schema) => {
|
|
|
40
40
|
const get_dispatch_change_handler = (model_name) => (change) => {
|
|
41
41
|
const op = change.operationType
|
|
42
42
|
if (["insert", "update"].includes(op)) {
|
|
43
|
-
dispatch_queue(queue, model_name, op, change.fullDocument)
|
|
43
|
+
dispatch_queue(queue, model_name, op, change.fullDocument, change.updateDescription)
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|