@waline/vercel 1.18.2 → 1.18.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/index.js CHANGED
@@ -1,5 +1,5 @@
1
- const os = require('node:os');
2
- const path = require('node:path');
1
+ const os = require('os');
2
+ const path = require('path');
3
3
  const Application = require('thinkjs');
4
4
  const Loader = require('thinkjs/lib/loader');
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/vercel",
3
- "version": "1.18.2",
3
+ "version": "1.18.5",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -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({ ...resp, rawComment: comment }, parentComment);
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(newData, pComment, true);
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);
@@ -1,5 +1,5 @@
1
- const fs = require('node:fs');
2
- const util = require('node:util');
1
+ const fs = require('fs');
2
+ const util = require('util');
3
3
  const BaseRest = require('./rest');
4
4
 
5
5
  const readFileAsync = util.promisify(fs.readFile);
@@ -1,4 +1,4 @@
1
- const qs = require('node:querystring');
1
+ const qs = require('querystring');
2
2
  const jwt = require('jsonwebtoken');
3
3
  const { PasswordHash } = require('phpass');
4
4
  const request = require('request-promise-native');
@@ -1,4 +1,4 @@
1
- const path = require('node:path');
1
+ const path = require('path');
2
2
 
3
3
  module.exports = class extends think.Controller {
4
4
  static get _REST() {
@@ -1,4 +1,4 @@
1
- const qs = require('node:querystring');
1
+ const qs = require('querystring');
2
2
  const { PasswordHash } = require('phpass');
3
3
  const BaseRest = require('./rest');
4
4
 
@@ -1,4 +1,4 @@
1
- const path = require('node:path');
1
+ const path = require('path');
2
2
  const { parseString, writeToString } = require('fast-csv');
3
3
  const request = require('request-promise-native');
4
4
  const Base = require('./base');
package/vanilla.js CHANGED
@@ -1,4 +1,4 @@
1
- const path = require('node:path');
1
+ const path = require('path');
2
2
  const Application = require('thinkjs');
3
3
 
4
4
  const instance = new Application({