nodebb-plugin-webhooks 2.0.0 → 2.0.2

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.
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ import serverConfig from 'eslint-config-nodebb';
4
+ import publicConfig from 'eslint-config-nodebb/public';
5
+
6
+ export default [
7
+ ...publicConfig,
8
+ ...serverConfig,
9
+ ];
10
+
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  'use strict';
3
2
 
4
3
  const https = require('https');
@@ -47,6 +46,7 @@ plugin.onHookFired = async function (hookData) {
47
46
  hash.update(JSON.stringify(hookData));
48
47
  signature = `sha1=${hash.digest('hex')}`;
49
48
  }
49
+ // eslint-disable-next-line no-await-in-loop
50
50
  await makeRequest(hook.endpoint, hookData, signature);
51
51
  }
52
52
  }
@@ -85,7 +85,7 @@ async function makeRequest(endpoint, hookData, signature) {
85
85
  });
86
86
  }
87
87
  try {
88
- const { status, data } = await axios.post(endpoint, hookData, )
88
+ const { status, data } = await axios.post(endpoint, hookData, axiosOptions);
89
89
  if (status !== 200) {
90
90
  winston.error(`[nodebb-plugin-webhooks] ${status} ${data}`);
91
91
  }
@@ -106,7 +106,6 @@ plugin.admin.menu = function (menu, callback) {
106
106
  setImmediate(callback, null, menu);
107
107
  };
108
108
 
109
-
110
109
  socketAdmin.plugins.webhooks = {};
111
110
  socketAdmin.plugins.webhooks.save = async function (socket, data) {
112
111
  await db.set('nodebb-plugin-webhooks', JSON.stringify(data));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-webhooks",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A Plugin that pings end points when a hook is triggered",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -8,6 +8,7 @@
8
8
  "url": "https://github.com/NodeBB/nodebb-plugin-webhooks"
9
9
  },
10
10
  "scripts": {
11
+ "lint": "eslint .",
11
12
  "test": "echo \"Error: no test specified\" && exit 1"
12
13
  },
13
14
  "keywords": [
@@ -18,14 +19,13 @@
18
19
  "author": "Baris Usakli <baris@nodebb.org>",
19
20
  "license": "MIT",
20
21
  "dependencies": {
21
- "axios": "1.6.2"
22
+ "axios": "1.9.0"
22
23
  },
23
24
  "devDependencies": {
24
- "eslint": "8.55.0",
25
- "eslint-config-nodebb": "0.2.1",
26
- "eslint-plugin-import": "2.29.0"
25
+ "eslint": "9.26.0",
26
+ "eslint-config-nodebb": "^1.1.4"
27
27
  },
28
28
  "nbbpm": {
29
- "compatibility": "^3.2.0"
29
+ "compatibility": "^3.2.0 || ^4.0.0"
30
30
  }
31
31
  }
package/public/admin.js CHANGED
@@ -1,5 +1,3 @@
1
- /* globals app, $, socket, define */
2
-
3
1
  'use strict';
4
2
 
5
3
  define('admin/plugins/webhooks', ['settings', 'alerts'], function (settings, alerts) {
package/.eslintignore DELETED
@@ -1,21 +0,0 @@
1
- node_modules/
2
- *.sublime-project
3
- *.sublime-workspace
4
- .project
5
- .vagrant
6
- .DS_Store
7
- logs/
8
- /public/templates
9
- /public/uploads
10
- /public/sounds
11
- /public/vendor
12
- /public/src/modules/string.js
13
- .idea/
14
- .vscode/
15
- *.ipr
16
- *.iws
17
- /coverage
18
- /build
19
- .eslintrc
20
- test/files
21
- *.min.js
package/.eslintrc DELETED
@@ -1,137 +0,0 @@
1
- {
2
- "extends": "airbnb-base",
3
- "parserOptions": {
4
- "sourceType": "script"
5
- },
6
-
7
- "rules": {
8
- // Customized
9
- "handle-callback-err": [ "error","^(e$|(e|(.*(_e|E)))rr)" ],
10
- "comma-dangle": ["error", {
11
- "arrays": "always-multiline",
12
- "objects": "always-multiline",
13
- "imports": "always-multiline",
14
- "exports": "always-multiline",
15
- "functions": "never"
16
- }],
17
- "no-empty": ["error", { "allowEmptyCatch": true }],
18
- "no-underscore-dangle": "off",
19
- "no-console": "off",
20
- "no-mixed-operators": ["error", { "allowSamePrecedence": true }],
21
- "strict": ["error", "global"],
22
- "consistent-return": "off",
23
- "func-names": "off",
24
- "no-tabs": "off",
25
- "indent": ["error", "tab"],
26
- "no-eq-null": "off",
27
- "camelcase": "off",
28
- "no-new": "off",
29
- "no-shadow": "off",
30
- "no-use-before-define": ["error", "nofunc"],
31
- "no-prototype-builtins": "off",
32
- "new-cap": "off",
33
- "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
34
- "object-curly-newline": "off",
35
- "no-restricted-globals": "off",
36
- "function-paren-newline": "off",
37
- "import/no-unresolved": "error",
38
- "quotes": ["error", "single", {
39
- "avoidEscape": true,
40
- "allowTemplateLiterals": true
41
- }],
42
- "no-else-return": [ "error", { "allowElseIf": true } ],
43
- "operator-linebreak": [ "error", "after" ],
44
-
45
- // ES6
46
- "prefer-rest-params": "off",
47
- "prefer-spread": "off",
48
- "prefer-arrow-callback": "off",
49
- "prefer-template": "off",
50
- "no-var": "off",
51
- "object-shorthand": "off",
52
- "vars-on-top": "off",
53
- "prefer-destructuring": "off",
54
-
55
- // TODO
56
- "import/no-extraneous-dependencies": "off",
57
- "import/no-dynamic-require": "off",
58
- "import/newline-after-import": "off",
59
- "no-bitwise": "off",
60
- "global-require": "off",
61
- "max-len": "off",
62
- "no-param-reassign": "off",
63
- "no-restricted-syntax": "off",
64
- "no-script-url": "off",
65
- "default-case": "off",
66
- "linebreak-style": "off",
67
-
68
- // "no-multi-assign": "off",
69
- // "one-var": "off",
70
- // "no-undef": "off",
71
- // "max-nested-callbacks": "off",
72
- // "no-mixed-requires": "off",
73
- // "brace-style": "off",
74
- // "max-statements-per-line": "off",
75
- // "no-unused-vars": "off",
76
- // "no-mixed-spaces-and-tabs": "off",
77
- // "no-useless-concat": "off",
78
- // "require-jsdoc": "off",
79
- // "eqeqeq": "off",
80
- // "no-negated-condition": "off",
81
- // "one-var-declaration-per-line": "off",
82
- // "no-lonely-if": "off",
83
- // "radix": "off",
84
- // "no-else-return": "off",
85
- // "no-useless-escape": "off",
86
- // "block-scoped-var": "off",
87
- // "operator-assignment": "off",
88
- // "yoda": "off",
89
- // "no-loop-func": "off",
90
- // "no-void": "off",
91
- // "valid-jsdoc": "off",
92
- // "no-cond-assign": "off",
93
- // "no-redeclare": "off",
94
- // "no-unreachable": "off",
95
- // "no-nested-ternary": "off",
96
- // "operator-linebreak": "off",
97
- // "guard-for-in": "off",
98
- // "no-unneeded-ternary": "off",
99
- // "no-sequences": "off",
100
- // "no-extend-native": "off",
101
- // "no-shadow-restricted-names": "off",
102
- // "no-extra-boolean-cast": "off",
103
- // "no-path-concat": "off",
104
- // "no-unused-expressions": "off",
105
- // "no-return-assign": "off",
106
- // "no-restricted-modules": "off",
107
- // "object-curly-spacing": "off",
108
- // "indent": "off",
109
- // "padded-blocks": "off",
110
- // "eol-last": "off",
111
- // "lines-around-directive": "off",
112
- // "strict": "off",
113
- // "comma-dangle": "off",
114
- // "no-multi-spaces": "off",
115
- // "quotes": "off",
116
- // "keyword-spacing": "off",
117
- // "no-mixed-operators": "off",
118
- // "comma-spacing": "off",
119
- // "no-trailing-spaces": "off",
120
- // "key-spacing": "off",
121
- // "no-multiple-empty-lines": "off",
122
- // "spaced-comment": "off",
123
- // "space-in-parens": "off",
124
- // "block-spacing": "off",
125
- // "quote-props": "off",
126
- // "space-unary-ops": "off",
127
- // "no-empty": "off",
128
- // "dot-notation": "off",
129
- // "func-call-spacing": "off",
130
- // "array-bracket-spacing": "off",
131
- // "object-property-newline": "off",
132
- // "no-continue": "off",
133
- // "no-extra-semi": "off",
134
- // "no-spaced-func": "off",
135
- // "no-useless-return": "off"
136
- }
137
- }