nodebb-plugin-web-push 0.7.6 → 0.7.8
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/lib/controllers.js +2 -3
- package/lib/subscriptions.js +1 -1
- package/library.js +13 -13
- package/package.json +8 -9
- package/test/index.js +1 -1
- package/package-lock.json +0 -4276
package/lib/controllers.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const user =
|
|
3
|
+
const user = nodebb.require('./src/user');
|
|
4
|
+
const helpers = nodebb.require('./src/controllers/helpers');
|
|
4
5
|
|
|
5
6
|
const subscriptions = require('./subscriptions');
|
|
6
7
|
|
|
7
|
-
const helpers = require.main.require('./src/controllers/helpers');
|
|
8
|
-
|
|
9
8
|
const Controllers = module.exports;
|
|
10
9
|
|
|
11
10
|
Controllers.renderSettings = async function (req, res) {
|
package/lib/subscriptions.js
CHANGED
package/library.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const nconf = require.main.require('nconf');
|
|
4
|
-
const winston = require.main.require('winston');
|
|
5
3
|
const webPush = require('web-push');
|
|
6
4
|
const validator = require('validator');
|
|
7
5
|
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
6
|
+
const nconf = nodebb.require('nconf');
|
|
7
|
+
const winston = nodebb.require('winston');
|
|
8
|
+
|
|
9
|
+
const db = nodebb.require('./src/database');
|
|
10
|
+
const user = nodebb.require('./src/user');
|
|
11
|
+
const meta = nodebb.require('./src/meta');
|
|
12
|
+
const utils = nodebb.require('./src/utils');
|
|
13
|
+
const translator = nodebb.require('./src/translator');
|
|
14
|
+
const notifications = nodebb.require('./src/notifications');
|
|
15
|
+
|
|
16
|
+
const routeHelpers = nodebb.require('./src/routes/helpers');
|
|
14
17
|
|
|
15
18
|
const controllers = require('./lib/controllers');
|
|
16
19
|
const subscriptions = require('./lib/subscriptions');
|
|
17
20
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const plugin = {};
|
|
21
|
+
const plugin = module.exports;
|
|
21
22
|
|
|
22
23
|
plugin.init = async (params) => {
|
|
23
24
|
const { router, middleware/* , controllers */ } = params;
|
|
@@ -218,6 +219,7 @@ async function constructPayload(notification, uid, lang) {
|
|
|
218
219
|
|
|
219
220
|
let [title, body] = await translator.translateKeys([bodyShort, bodyLong], lang);
|
|
220
221
|
([title, body] = [title, body].map(str => validator.unescape(utils.stripHTMLTags(str))));
|
|
222
|
+
title = `${dir === 'rtl' ? '\u200f' : '\u200e'}${title}`;
|
|
221
223
|
const tag = mergeId || nid;
|
|
222
224
|
const url = `${nconf.get('url')}${path}`;
|
|
223
225
|
|
|
@@ -246,5 +248,3 @@ async function constructPayload(notification, uid, lang) {
|
|
|
246
248
|
data: { url, icon, badge },
|
|
247
249
|
};
|
|
248
250
|
}
|
|
249
|
-
|
|
250
|
-
module.exports = plugin;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-web-push",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.7.8",
|
|
4
|
+
"description": "A plugin for adding native push notifications to NodeBB via the Web Push API.",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -35,16 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"readmeFilename": "README.md",
|
|
37
37
|
"nbbpm": {
|
|
38
|
-
"compatibility": "^4.
|
|
38
|
+
"compatibility": "^4.12.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@commitlint/cli": "
|
|
42
|
-
"@commitlint/config-angular": "
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-config-nodebb": "^
|
|
45
|
-
"eslint-plugin-import": "^2.31.0",
|
|
41
|
+
"@commitlint/cli": "21.0.2",
|
|
42
|
+
"@commitlint/config-angular": "21.0.2",
|
|
43
|
+
"@eslint/js": "^10.0.1",
|
|
44
|
+
"eslint-config-nodebb": "^2.0.2",
|
|
46
45
|
"husky": "9.1.7",
|
|
47
|
-
"lint-staged": "
|
|
46
|
+
"lint-staged": "17.0.5"
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
49
|
"validator": "^13.12.0",
|
package/test/index.js
CHANGED