@waline/vercel 1.18.3 → 1.18.6
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/index.js +2 -2
- package/package.json +33 -32
- package/src/config/config.js +1 -1
- package/src/controller/comment.js +19 -3
- package/src/controller/db.js +2 -2
- package/src/controller/oauth.js +1 -1
- package/src/controller/rest.js +1 -1
- package/src/controller/user.js +1 -1
- package/src/service/storage/github.js +1 -1
- package/src/service/storage/mysql.js +5 -0
- package/vanilla.js +1 -1
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waline/vercel",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.6",
|
|
4
4
|
"description": "vercel server for waline comment system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"waline",
|
|
@@ -15,38 +15,39 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "lizheming <i@imnerd.org>",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudbase/node-sdk": "
|
|
19
|
-
"@koa/cors": "
|
|
20
|
-
"akismet": "
|
|
21
|
-
"deta": "
|
|
22
|
-
"dompurify": "
|
|
23
|
-
"dy-node-ip2region": "
|
|
24
|
-
"fast-csv": "
|
|
25
|
-
"jsdom": "
|
|
26
|
-
"jsonwebtoken": "
|
|
27
|
-
"katex": "
|
|
28
|
-
"leancloud-storage": "
|
|
29
|
-
"markdown-it": "
|
|
30
|
-
"markdown-it-emoji": "
|
|
31
|
-
"markdown-it-sub": "
|
|
32
|
-
"markdown-it-sup": "
|
|
33
|
-
"mathjax-full": "
|
|
34
|
-
"nodemailer": "
|
|
35
|
-
"nunjucks": "
|
|
36
|
-
"phpass": "
|
|
37
|
-
"prismjs": "
|
|
38
|
-
"request": "
|
|
39
|
-
"request-promise-native": "
|
|
40
|
-
"speakeasy": "
|
|
41
|
-
"think-
|
|
42
|
-
"think-
|
|
43
|
-
"think-model
|
|
18
|
+
"@cloudbase/node-sdk": "2.9.1",
|
|
19
|
+
"@koa/cors": "3.3.0",
|
|
20
|
+
"akismet": "2.0.7",
|
|
21
|
+
"deta": "1.1.0",
|
|
22
|
+
"dompurify": "2.3.8",
|
|
23
|
+
"dy-node-ip2region": "1.0.1",
|
|
24
|
+
"fast-csv": "4.3.6",
|
|
25
|
+
"jsdom": "19.0.0",
|
|
26
|
+
"jsonwebtoken": "8.5.1",
|
|
27
|
+
"katex": "0.15.6",
|
|
28
|
+
"leancloud-storage": "4.12.2",
|
|
29
|
+
"markdown-it": "13.0.1",
|
|
30
|
+
"markdown-it-emoji": "2.0.2",
|
|
31
|
+
"markdown-it-sub": "1.0.0",
|
|
32
|
+
"markdown-it-sup": "1.0.0",
|
|
33
|
+
"mathjax-full": "3.2.1",
|
|
34
|
+
"nodemailer": "6.7.5",
|
|
35
|
+
"nunjucks": "3.2.3",
|
|
36
|
+
"phpass": "0.1.1",
|
|
37
|
+
"prismjs": "1.28.0",
|
|
38
|
+
"request": "2.88.2",
|
|
39
|
+
"request-promise-native": "1.0.9",
|
|
40
|
+
"speakeasy": "2.0.0",
|
|
41
|
+
"think-helper": "^1.1.3",
|
|
42
|
+
"think-logger3": "1.3.1",
|
|
43
|
+
"think-model": "1.5.4",
|
|
44
|
+
"think-model-mysql": "1.1.7",
|
|
44
45
|
"think-model-postgresql": "1.1.6",
|
|
45
|
-
"think-model-sqlite": "
|
|
46
|
-
"think-mongo": "
|
|
47
|
-
"think-router-rest": "
|
|
48
|
-
"thinkjs": "
|
|
49
|
-
"ua-parser-js": "
|
|
46
|
+
"think-model-sqlite": "1.2.3",
|
|
47
|
+
"think-mongo": "2.2.1",
|
|
48
|
+
"think-router-rest": "1.0.5",
|
|
49
|
+
"thinkjs": "3.2.14",
|
|
50
|
+
"ua-parser-js": "1.0.2"
|
|
50
51
|
},
|
|
51
52
|
"engines": {
|
|
52
53
|
"node": ">=14"
|
package/src/config/config.js
CHANGED
|
@@ -92,7 +92,7 @@ const markdown = {
|
|
|
92
92
|
|
|
93
93
|
if (isFalse(MARKDOWN_HIGHLIGHT)) markdown.config.highlight = false;
|
|
94
94
|
|
|
95
|
-
let avatarProxy = '
|
|
95
|
+
let avatarProxy = '';
|
|
96
96
|
if (AVATAR_PROXY) {
|
|
97
97
|
avatarProxy = !isFalse(AVATAR_PROXY) ? AVATAR_PROXY : '';
|
|
98
98
|
}
|
|
@@ -556,7 +556,12 @@ module.exports = class extends BaseRest {
|
|
|
556
556
|
|
|
557
557
|
if (comment.status !== 'spam') {
|
|
558
558
|
const notify = this.service('notify');
|
|
559
|
-
await notify.run(
|
|
559
|
+
await notify.run(
|
|
560
|
+
{ ...resp, comment: markdownParser(resp.comment), rawComment: comment },
|
|
561
|
+
parentComment
|
|
562
|
+
? { ...parentComment, comment: markdownParser(parentComment.comment) }
|
|
563
|
+
: undefined
|
|
564
|
+
);
|
|
560
565
|
}
|
|
561
566
|
|
|
562
567
|
think.logger.debug(`Comment notify done!`);
|
|
@@ -616,7 +621,11 @@ module.exports = class extends BaseRest {
|
|
|
616
621
|
pComment = pComment[0];
|
|
617
622
|
|
|
618
623
|
const notify = this.service('notify');
|
|
619
|
-
await notify.run(
|
|
624
|
+
await notify.run(
|
|
625
|
+
{ ...newData, comment: markdownParser(newData.comment) },
|
|
626
|
+
{ ...pComment, comment: markdownParser(pComment.comment) },
|
|
627
|
+
true
|
|
628
|
+
);
|
|
620
629
|
}
|
|
621
630
|
|
|
622
631
|
await this.hook('postUpdate', data);
|
|
@@ -631,7 +640,14 @@ module.exports = class extends BaseRest {
|
|
|
631
640
|
return this.fail(preDeleteResp);
|
|
632
641
|
}
|
|
633
642
|
|
|
634
|
-
await this.modelInstance.delete({
|
|
643
|
+
await this.modelInstance.delete({
|
|
644
|
+
_complex: {
|
|
645
|
+
_logic: 'or',
|
|
646
|
+
objectId: this.id,
|
|
647
|
+
pid: this.id,
|
|
648
|
+
rid: this.id,
|
|
649
|
+
},
|
|
650
|
+
});
|
|
635
651
|
await this.hook('postDelete', this.id);
|
|
636
652
|
|
|
637
653
|
return this.success();
|
package/src/controller/db.js
CHANGED
package/src/controller/oauth.js
CHANGED
package/src/controller/rest.js
CHANGED
package/src/controller/user.js
CHANGED
package/vanilla.js
CHANGED