@crowdin/app-project-module 0.28.0-7 → 0.28.0-9
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/out/util/webhooks.js +9 -2
- package/package.json +8 -8
package/out/util/webhooks.js
CHANGED
|
@@ -43,6 +43,7 @@ const index_1 = require("./index");
|
|
|
43
43
|
const connection_1 = require("./connection");
|
|
44
44
|
const storage_1 = require("../storage");
|
|
45
45
|
const defaults_1 = require("./defaults");
|
|
46
|
+
const util_1 = require("../util");
|
|
46
47
|
const HookEvents = {
|
|
47
48
|
ALL: ['file.translated', 'file.approved'],
|
|
48
49
|
TRANSLATED: ['file.translated'],
|
|
@@ -288,14 +289,20 @@ function consumer(channel, config, integration) {
|
|
|
288
289
|
return function (msg) {
|
|
289
290
|
var _a;
|
|
290
291
|
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
-
if (msg) {
|
|
292
|
+
if (!msg) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
try {
|
|
292
296
|
const data = JSON.parse(msg.content.toString());
|
|
293
297
|
const urlParam = (_a = integration.webhooks) === null || _a === void 0 ? void 0 : _a.urlParam;
|
|
294
298
|
const webhookUrlParam = data.query[urlParam];
|
|
295
299
|
const webhookData = yield prepareWebhookData(config, integration, webhookUrlParam, 'integration');
|
|
296
300
|
yield updateCrowdinFromWebhookRequest(integration, webhookData, data);
|
|
297
|
-
channel.ack(msg);
|
|
298
301
|
}
|
|
302
|
+
catch (e) {
|
|
303
|
+
(0, util_1.logError)(e, config.onError);
|
|
304
|
+
}
|
|
305
|
+
channel.ack(msg);
|
|
299
306
|
});
|
|
300
307
|
};
|
|
301
308
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "0.28.0-
|
|
3
|
+
"version": "0.28.0-9",
|
|
4
4
|
"description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@crowdin/crowdin-apps-functions": "0.
|
|
16
|
+
"@crowdin/crowdin-apps-functions": "0.4.0",
|
|
17
17
|
"@types/pg": "^8.6.6",
|
|
18
18
|
"amqplib": "^0.10.3",
|
|
19
19
|
"crypto-js": "^4.0.0",
|
|
20
|
-
"express": "4.
|
|
20
|
+
"express": "4.18.2",
|
|
21
21
|
"express-handlebars": "^5.3.4",
|
|
22
22
|
"mysql2": "^2.3.3",
|
|
23
23
|
"node-cron": "^3.0.2",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"@rollup/plugin-replace": "^5.0.2",
|
|
44
44
|
"@rollup/plugin-terser": "^0.4.0",
|
|
45
45
|
"@types/crypto-js": "^4.0.0",
|
|
46
|
-
"@types/express": "4.17.
|
|
46
|
+
"@types/express": "4.17.17",
|
|
47
47
|
"@types/express-handlebars": "^5.3.1",
|
|
48
|
-
"@types/jest": "^29.
|
|
49
|
-
"@types/node": "^12.
|
|
48
|
+
"@types/jest": "^29.5.0",
|
|
49
|
+
"@types/node": "^12.20.55",
|
|
50
50
|
"@types/node-cron": "^3.0.7",
|
|
51
51
|
"@typescript-eslint/eslint-plugin": "^2.3.1",
|
|
52
52
|
"@typescript-eslint/parser": "^2.3.1",
|
|
53
53
|
"eslint": "^6.4.0",
|
|
54
54
|
"eslint-config-prettier": "^6.3.0",
|
|
55
55
|
"eslint-plugin-prettier": "^3.1.1",
|
|
56
|
-
"jest": "^29.
|
|
56
|
+
"jest": "^29.5.0",
|
|
57
57
|
"jest-junit": "^15.0.0",
|
|
58
58
|
"prettier": "^2.8.1",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-dom": "^18.2.0",
|
|
61
|
-
"rollup": "^3.
|
|
61
|
+
"rollup": "^3.20.2",
|
|
62
62
|
"ts-jest": "^29.0.5",
|
|
63
63
|
"typescript": "^4.9.5"
|
|
64
64
|
},
|