@crowdin/app-project-module 0.17.5 → 0.17.7
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/README.md +1 -0
- package/out/handlers/crowdin-file-progress.d.ts +4 -0
- package/out/handlers/crowdin-file-progress.js +22 -0
- package/out/handlers/crowdin-files.d.ts +4 -0
- package/out/handlers/crowdin-files.js +31 -0
- package/out/handlers/crowdin-project.d.ts +4 -0
- package/out/handlers/crowdin-project.js +22 -0
- package/out/handlers/crowdin-update.d.ts +4 -0
- package/out/handlers/crowdin-update.js +26 -0
- package/out/handlers/custom-file-format/download.d.ts +4 -0
- package/out/handlers/custom-file-format/download.js +32 -0
- package/out/handlers/custom-file-format/process.d.ts +4 -0
- package/out/handlers/custom-file-format/process.js +139 -0
- package/out/handlers/custom-mt/translate.d.ts +4 -0
- package/out/handlers/custom-mt/translate.js +42 -0
- package/out/handlers/install.d.ts +4 -0
- package/out/handlers/install.js +45 -0
- package/out/handlers/integration-data.d.ts +4 -0
- package/out/handlers/integration-data.js +21 -0
- package/out/handlers/integration-login.d.ts +4 -0
- package/out/handlers/integration-login.js +30 -0
- package/out/handlers/integration-logout.d.ts +4 -0
- package/out/handlers/integration-logout.js +23 -0
- package/out/handlers/integration-update.d.ts +4 -0
- package/out/handlers/integration-update.js +25 -0
- package/out/handlers/main.d.ts +4 -0
- package/out/handlers/main.js +64 -0
- package/out/handlers/manifest.d.ts +3 -0
- package/out/handlers/manifest.js +126 -0
- package/out/handlers/oauth-login.d.ts +4 -0
- package/out/handlers/oauth-login.js +69 -0
- package/out/handlers/settings-save.d.ts +4 -0
- package/out/handlers/settings-save.js +21 -0
- package/out/handlers/subscription-info.d.ts +3 -0
- package/out/handlers/subscription-info.js +15 -0
- package/out/handlers/subscription-paid.d.ts +4 -0
- package/out/handlers/subscription-paid.js +22 -0
- package/out/handlers/sync-settings-save.d.ts +4 -0
- package/out/handlers/sync-settings-save.js +29 -0
- package/out/handlers/sync-settings.d.ts +4 -0
- package/out/handlers/sync-settings.js +27 -0
- package/out/handlers/uninstall.d.ts +4 -0
- package/out/handlers/uninstall.js +27 -0
- package/out/index.d.ts +5 -0
- package/out/index.js +191 -0
- package/out/logo.png +0 -0
- package/out/middlewares/crowdin-client.d.ts +10 -0
- package/out/middlewares/crowdin-client.js +88 -0
- package/out/middlewares/integration-credentials.d.ts +4 -0
- package/out/middlewares/integration-credentials.js +39 -0
- package/out/middlewares/json-response.d.ts +2 -0
- package/out/middlewares/json-response.js +7 -0
- package/out/middlewares/ui-module.d.ts +4 -0
- package/out/middlewares/ui-module.js +39 -0
- package/out/models/index.d.ts +544 -0
- package/out/models/index.js +41 -0
- package/out/static/css/styles.css +57 -0
- package/out/static/js/main.js +130 -0
- package/out/static/js/polyfills/fetch.js +494 -0
- package/out/static/js/polyfills/promise.js +375 -0
- package/out/storage/index.d.ts +22 -0
- package/out/storage/index.js +319 -0
- package/out/util/connection.d.ts +10 -0
- package/out/util/connection.js +211 -0
- package/out/util/cron.d.ts +3 -0
- package/out/util/cron.js +103 -0
- package/out/util/defaults.d.ts +5 -0
- package/out/util/defaults.js +153 -0
- package/out/util/index.d.ts +11 -0
- package/out/util/index.js +105 -0
- package/out/views/install.handlebars +16 -0
- package/out/views/login.handlebars +115 -0
- package/out/views/main.handlebars +471 -0
- package/out/views/oauth.handlebars +4 -0
- package/out/views/partials/head.handlebars +20 -0
- package/out/views/subscription.handlebars +26 -0
- package/package.json +1 -1
- package/.github/workflows/basic.yml +0 -39
- package/.github/workflows/publish.yml +0 -34
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const models_1 = require("../models");
|
|
4
|
+
const connection_1 = require("../util/connection");
|
|
5
|
+
function handle(config) {
|
|
6
|
+
const modules = {};
|
|
7
|
+
if (config.projectIntegration) {
|
|
8
|
+
modules['project-integrations'] = [
|
|
9
|
+
{
|
|
10
|
+
key: config.identifier + '-int',
|
|
11
|
+
name: config.name,
|
|
12
|
+
description: config.description,
|
|
13
|
+
logo: '/logo/integration/logo.png',
|
|
14
|
+
url: '/',
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
if (config.customFileFormat) {
|
|
19
|
+
modules['custom-file-format'] = [
|
|
20
|
+
{
|
|
21
|
+
key: config.identifier + '-ff',
|
|
22
|
+
type: config.customFileFormat.type,
|
|
23
|
+
stringsExport: !!config.customFileFormat.stringsExport,
|
|
24
|
+
multilingual: !!config.customFileFormat.multilingual,
|
|
25
|
+
customSrxSupported: !!config.customFileFormat.customSrxSupported,
|
|
26
|
+
extensions: config.customFileFormat.extensions,
|
|
27
|
+
signaturePatterns: config.customFileFormat.signaturePatterns,
|
|
28
|
+
url: '/process',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
if (config.customMT) {
|
|
33
|
+
modules['custom-mt'] = [
|
|
34
|
+
{
|
|
35
|
+
key: config.identifier + '-mt',
|
|
36
|
+
name: config.name,
|
|
37
|
+
url: '/translate',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
if (config.organizationMenu) {
|
|
42
|
+
modules['organization-menu'] = [
|
|
43
|
+
{
|
|
44
|
+
key: config.identifier + '-resources',
|
|
45
|
+
name: config.name,
|
|
46
|
+
url: '/resources/' + (config.organizationMenu.fileName || 'index.html'),
|
|
47
|
+
icon: '/logo/resources/logo.png',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
if (config.profileResourcesMenu) {
|
|
52
|
+
modules['profile-resources-menu'] = [
|
|
53
|
+
{
|
|
54
|
+
key: config.identifier + '-profile-resources-menu',
|
|
55
|
+
name: config.name,
|
|
56
|
+
url: '/resources/' + (config.profileResourcesMenu.fileName || 'index.html'),
|
|
57
|
+
icon: '/logo/resources/logo.png',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
if (config.editorRightPanel) {
|
|
62
|
+
modules['editor-right-panel'] = [
|
|
63
|
+
{
|
|
64
|
+
key: config.identifier + '-editor-panels',
|
|
65
|
+
name: config.name,
|
|
66
|
+
url: '/editor-panels/' + (config.editorRightPanel.fileName || 'index.html'),
|
|
67
|
+
modes: config.editorRightPanel.modes,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
if (config.projectMenu) {
|
|
72
|
+
modules['project-menu'] = [
|
|
73
|
+
{
|
|
74
|
+
key: config.identifier + '-project-menu',
|
|
75
|
+
name: config.name,
|
|
76
|
+
url: '/project-menu/' + (config.projectMenu.fileName || 'index.html'),
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
if (config.projectTools) {
|
|
81
|
+
modules['project-tools'] = [
|
|
82
|
+
{
|
|
83
|
+
key: config.identifier + '-tools',
|
|
84
|
+
name: config.name,
|
|
85
|
+
description: config.description,
|
|
86
|
+
logo: '/logo/tools/logo.png',
|
|
87
|
+
url: '/tools/' + (config.projectTools.fileName || 'index.html'),
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
if (config.projectReports) {
|
|
92
|
+
modules['project-reports'] = [
|
|
93
|
+
{
|
|
94
|
+
key: config.identifier + '-project-reports',
|
|
95
|
+
name: config.name,
|
|
96
|
+
description: config.description,
|
|
97
|
+
logo: '/logo/reports/logo.png',
|
|
98
|
+
url: '/reports/' + (config.projectReports.fileName || 'index.html'),
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
const events = {
|
|
103
|
+
installed: '/installed',
|
|
104
|
+
uninstall: '/uninstall',
|
|
105
|
+
};
|
|
106
|
+
if (!(0, connection_1.isAppFree)(config)) {
|
|
107
|
+
events['subscription_paid'] = '/subscription-paid';
|
|
108
|
+
}
|
|
109
|
+
return (_req, res) => {
|
|
110
|
+
const manifest = {
|
|
111
|
+
identifier: config.identifier,
|
|
112
|
+
name: config.name,
|
|
113
|
+
logo: '/logo.png',
|
|
114
|
+
baseUrl: config.baseUrl,
|
|
115
|
+
authentication: {
|
|
116
|
+
type: 'authorization_code',
|
|
117
|
+
clientId: config.clientId,
|
|
118
|
+
},
|
|
119
|
+
events,
|
|
120
|
+
scopes: config.scopes ? config.scopes : [models_1.Scope.PROJECTS],
|
|
121
|
+
modules,
|
|
122
|
+
};
|
|
123
|
+
res.send(manifest);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { Config, IntegrationLogic } from '../models';
|
|
4
|
+
export default function handle(config: Config, integration: IntegrationLogic): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
const util_1 = require("../util");
|
|
17
|
+
const defaults_1 = require("../util/defaults");
|
|
18
|
+
function handle(config, integration) {
|
|
19
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
21
|
+
const message = {
|
|
22
|
+
uid: 'oauth_popup',
|
|
23
|
+
};
|
|
24
|
+
const code = req.query[((_b = (_a = integration.oauthLogin) === null || _a === void 0 ? void 0 : _a.fieldsMapping) === null || _b === void 0 ? void 0 : _b.code) || 'code'];
|
|
25
|
+
(0, util_1.log)(`Recieved request from OAuth login callback. Code ${code}`, config.logger);
|
|
26
|
+
try {
|
|
27
|
+
const oauthLogin = integration.oauthLogin;
|
|
28
|
+
let credentials;
|
|
29
|
+
if (oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.performGetTokenRequest) {
|
|
30
|
+
(0, util_1.log)('Performing custom get bearer token request', config.logger);
|
|
31
|
+
credentials = yield oauthLogin.performGetTokenRequest(code);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const request = {};
|
|
35
|
+
const oauthLogin = integration.oauthLogin;
|
|
36
|
+
request[((_c = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _c === void 0 ? void 0 : _c.code) || 'code'] = code;
|
|
37
|
+
request[((_d = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _d === void 0 ? void 0 : _d.clientId) || 'client_id'] = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.clientId;
|
|
38
|
+
request[((_e = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _e === void 0 ? void 0 : _e.clientSecret) || 'client_secret'] = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.clientSecret;
|
|
39
|
+
request[((_f = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _f === void 0 ? void 0 : _f.redirectUri) || 'redirect_uri'] = `${config.baseUrl}${(0, defaults_1.getOauthRoute)(integration)}`;
|
|
40
|
+
if (oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.extraAccessTokenParameters) {
|
|
41
|
+
Object.entries(oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.extraAccessTokenParameters).forEach(([key, value]) => (request[key] = value));
|
|
42
|
+
}
|
|
43
|
+
credentials = (yield axios_1.default.post(((_g = integration.oauthLogin) === null || _g === void 0 ? void 0 : _g.accessTokenUrl) || '', request, {
|
|
44
|
+
headers: { Accept: 'application/json' },
|
|
45
|
+
})).data;
|
|
46
|
+
}
|
|
47
|
+
const oauthCredentials = {};
|
|
48
|
+
oauthCredentials.accessToken = credentials[((_h = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _h === void 0 ? void 0 : _h.accessToken) || 'access_token'];
|
|
49
|
+
if (oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.refresh) {
|
|
50
|
+
oauthCredentials.refreshToken = credentials[((_j = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _j === void 0 ? void 0 : _j.refreshToken) || 'refresh_token'];
|
|
51
|
+
oauthCredentials.expireIn =
|
|
52
|
+
Number(credentials[((_k = oauthLogin === null || oauthLogin === void 0 ? void 0 : oauthLogin.fieldsMapping) === null || _k === void 0 ? void 0 : _k.expiresIn) || 'expires_in']) + Date.now() / 1000;
|
|
53
|
+
}
|
|
54
|
+
message.data = oauthCredentials;
|
|
55
|
+
return res.render('oauth', { message: JSON.stringify(message) });
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
if (config.onError) {
|
|
59
|
+
config.onError(e);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(e);
|
|
63
|
+
}
|
|
64
|
+
message.data = { error: (0, util_1.getMessage)(e) };
|
|
65
|
+
return res.render('oauth', { message: JSON.stringify(message) });
|
|
66
|
+
}
|
|
67
|
+
}), config.onError);
|
|
68
|
+
}
|
|
69
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
import { Config } from '../models';
|
|
4
|
+
export default function handle(config: Config): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const storage_1 = require("../storage");
|
|
13
|
+
const util_1 = require("../util");
|
|
14
|
+
function handle(config) {
|
|
15
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
(0, util_1.log)(`Saving settings ${JSON.stringify(req.body.config, null, 2)}`, config.logger);
|
|
17
|
+
yield (0, storage_1.updateIntegrationConfig)(req.crowdinContext.clientId, JSON.stringify(req.body.config));
|
|
18
|
+
res.status(204).end();
|
|
19
|
+
}), config.onError);
|
|
20
|
+
}
|
|
21
|
+
exports.default = handle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const models_1 = require("../models");
|
|
4
|
+
function handle(config) {
|
|
5
|
+
return (req, res) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const subscriptionInfo = req.subscriptionInfo;
|
|
8
|
+
let showInfo = (subscriptionInfo === null || subscriptionInfo === void 0 ? void 0 : subscriptionInfo.type) === models_1.SubscriptionInfoType.TRIAL;
|
|
9
|
+
if (showInfo && ((_a = config.pricing) === null || _a === void 0 ? void 0 : _a.infoDisplayDaysThreshold)) {
|
|
10
|
+
showInfo = config.pricing.infoDisplayDaysThreshold >= ((subscriptionInfo === null || subscriptionInfo === void 0 ? void 0 : subscriptionInfo.daysLeft) || 0);
|
|
11
|
+
}
|
|
12
|
+
res.send(Object.assign(Object.assign({}, (subscriptionInfo || {})), { showInfo }));
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { Config } from '../models';
|
|
4
|
+
export default function handle(config: Config): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const util_1 = require("../util");
|
|
13
|
+
const connection_1 = require("../util/connection");
|
|
14
|
+
function handle(config) {
|
|
15
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const organizationId = (req.query || {})['organization_id'] || (req.body || {})['organization_id'];
|
|
17
|
+
(0, util_1.log)(`Recieved subscription paid request for organization ${organizationId}`, config.logger);
|
|
18
|
+
(0, connection_1.clearCache)(organizationId);
|
|
19
|
+
res.status(204).end();
|
|
20
|
+
}), config.onError);
|
|
21
|
+
}
|
|
22
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
import { Config } from '../models';
|
|
4
|
+
export default function handle(config: Config): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const storage_1 = require("../storage");
|
|
13
|
+
const util_1 = require("../util");
|
|
14
|
+
function handle(config) {
|
|
15
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const { files, type, provider } = req.body;
|
|
17
|
+
const existingSettings = yield (0, storage_1.getSyncSettings)(req.crowdinContext.clientId, req.crowdinContext.crowdinId, type, provider);
|
|
18
|
+
if (existingSettings) {
|
|
19
|
+
(0, util_1.log)(`Updating sync settings for type ${type} and provider ${provider} ${JSON.stringify(files, null, 2)}`, config.logger);
|
|
20
|
+
yield (0, storage_1.updateSyncSettings)(JSON.stringify(files), req.crowdinContext.clientId, req.crowdinContext.crowdinId, type, provider);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
(0, util_1.log)(`Saving sync settings for type ${type} and provider ${provider} ${JSON.stringify(files, null, 2)}`, config.logger);
|
|
24
|
+
yield (0, storage_1.saveSyncSettings)(JSON.stringify(files), req.crowdinContext.clientId, req.crowdinContext.crowdinId, type, provider);
|
|
25
|
+
}
|
|
26
|
+
res.status(204).end();
|
|
27
|
+
}), config.onError);
|
|
28
|
+
}
|
|
29
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
import { Config } from '../models';
|
|
4
|
+
export default function handle(config: Config): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const storage_1 = require("../storage");
|
|
13
|
+
const util_1 = require("../util");
|
|
14
|
+
function handle(config) {
|
|
15
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
let files = {};
|
|
17
|
+
const provider = req.params.provider;
|
|
18
|
+
(0, util_1.log)(`Loading sync settings for provider ${provider}`, config.logger);
|
|
19
|
+
const syncSettings = yield (0, storage_1.getSyncSettingsByProvider)(req.crowdinContext.clientId, provider);
|
|
20
|
+
if (syncSettings) {
|
|
21
|
+
files = JSON.parse(syncSettings.files) || [];
|
|
22
|
+
}
|
|
23
|
+
(0, util_1.log)(`Returning sync settings ${JSON.stringify(files, null, 2)}`, config.logger);
|
|
24
|
+
res.send(files);
|
|
25
|
+
}), config.onError);
|
|
26
|
+
}
|
|
27
|
+
exports.default = handle;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import { Config } from '../models';
|
|
4
|
+
export default function handle(config: Config): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const storage_1 = require("../storage");
|
|
13
|
+
const util_1 = require("../util");
|
|
14
|
+
function handle(config) {
|
|
15
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const event = req.body;
|
|
17
|
+
(0, util_1.log)(`Recieved uninstall request ${JSON.stringify(event, null, 2)}`, config.logger);
|
|
18
|
+
const organization = (event.domain || event.organizationId).toString();
|
|
19
|
+
yield (0, storage_1.deleteCrowdinCredentials)(organization);
|
|
20
|
+
if (config.onUninstall) {
|
|
21
|
+
yield config.onUninstall(organization);
|
|
22
|
+
}
|
|
23
|
+
(0, util_1.log)('App has been uninstalled', config.logger);
|
|
24
|
+
res.status(204).end();
|
|
25
|
+
}), config.onError);
|
|
26
|
+
}
|
|
27
|
+
exports.default = handle;
|
package/out/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Express } from 'express';
|
|
2
|
+
import { Config, CrowdinAppUtilities } from './models';
|
|
3
|
+
export { Scope } from './models';
|
|
4
|
+
export declare function addCrowdinEndpoints(app: Express, config: Config): CrowdinAppUtilities;
|
|
5
|
+
export declare function createApp(config: Config): void;
|
package/out/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.createApp = exports.addCrowdinEndpoints = exports.Scope = void 0;
|
|
35
|
+
const express_1 = __importDefault(require("express"));
|
|
36
|
+
const express_handlebars_1 = __importDefault(require("express-handlebars"));
|
|
37
|
+
const cron = __importStar(require("node-cron"));
|
|
38
|
+
const path_1 = require("path");
|
|
39
|
+
const crowdin_file_progress_1 = __importDefault(require("./handlers/crowdin-file-progress"));
|
|
40
|
+
const crowdin_files_1 = __importDefault(require("./handlers/crowdin-files"));
|
|
41
|
+
const crowdin_project_1 = __importDefault(require("./handlers/crowdin-project"));
|
|
42
|
+
const crowdin_update_1 = __importDefault(require("./handlers/crowdin-update"));
|
|
43
|
+
const download_1 = __importDefault(require("./handlers/custom-file-format/download"));
|
|
44
|
+
const process_1 = __importDefault(require("./handlers/custom-file-format/process"));
|
|
45
|
+
const translate_1 = __importDefault(require("./handlers/custom-mt/translate"));
|
|
46
|
+
const install_1 = __importDefault(require("./handlers/install"));
|
|
47
|
+
const integration_data_1 = __importDefault(require("./handlers/integration-data"));
|
|
48
|
+
const integration_login_1 = __importDefault(require("./handlers/integration-login"));
|
|
49
|
+
const integration_logout_1 = __importDefault(require("./handlers/integration-logout"));
|
|
50
|
+
const integration_update_1 = __importDefault(require("./handlers/integration-update"));
|
|
51
|
+
const main_1 = __importDefault(require("./handlers/main"));
|
|
52
|
+
const manifest_1 = __importDefault(require("./handlers/manifest"));
|
|
53
|
+
const oauth_login_1 = __importDefault(require("./handlers/oauth-login"));
|
|
54
|
+
const settings_save_1 = __importDefault(require("./handlers/settings-save"));
|
|
55
|
+
const subscription_info_1 = __importDefault(require("./handlers/subscription-info"));
|
|
56
|
+
const subscription_paid_1 = __importDefault(require("./handlers/subscription-paid"));
|
|
57
|
+
const sync_settings_1 = __importDefault(require("./handlers/sync-settings"));
|
|
58
|
+
const sync_settings_save_1 = __importDefault(require("./handlers/sync-settings-save"));
|
|
59
|
+
const uninstall_1 = __importDefault(require("./handlers/uninstall"));
|
|
60
|
+
const crowdin_client_1 = __importStar(require("./middlewares/crowdin-client"));
|
|
61
|
+
const integration_credentials_1 = __importDefault(require("./middlewares/integration-credentials"));
|
|
62
|
+
const json_response_1 = __importDefault(require("./middlewares/json-response"));
|
|
63
|
+
const ui_module_1 = __importDefault(require("./middlewares/ui-module"));
|
|
64
|
+
const storage = __importStar(require("./storage"));
|
|
65
|
+
const connection_1 = require("./util/connection");
|
|
66
|
+
const cron_1 = require("./util/cron");
|
|
67
|
+
const defaults_1 = require("./util/defaults");
|
|
68
|
+
var models_1 = require("./models");
|
|
69
|
+
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return models_1.Scope; } });
|
|
70
|
+
function addCrowdinEndpoints(app, config) {
|
|
71
|
+
storage.connect(config.dbFolder);
|
|
72
|
+
app.use(express_1.default.json({ limit: '50mb' }));
|
|
73
|
+
app.use('/assets', express_1.default.static((0, path_1.join)(__dirname, 'static')));
|
|
74
|
+
app.set('views', (0, path_1.join)(__dirname, 'views'));
|
|
75
|
+
app.engine('handlebars', (0, express_handlebars_1.default)({
|
|
76
|
+
layoutsDir: '',
|
|
77
|
+
defaultLayout: '',
|
|
78
|
+
helpers: {
|
|
79
|
+
ifeq: function (a, b, options) {
|
|
80
|
+
if (a === b) {
|
|
81
|
+
return options.fn(this);
|
|
82
|
+
}
|
|
83
|
+
return options.inverse(this);
|
|
84
|
+
},
|
|
85
|
+
checkLength: function (a, b, options) {
|
|
86
|
+
if (a.length > b) {
|
|
87
|
+
return options.fn(this);
|
|
88
|
+
}
|
|
89
|
+
return options.inverse(this);
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}));
|
|
93
|
+
app.set('view engine', 'handlebars');
|
|
94
|
+
app.get('/logo.png', (req, res) => res.sendFile(config.imagePath || (0, path_1.join)(__dirname, 'logo.png')));
|
|
95
|
+
app.post('/installed', (0, install_1.default)(config));
|
|
96
|
+
app.post('/uninstall', (0, uninstall_1.default)(config));
|
|
97
|
+
app.get('/manifest.json', json_response_1.default, (0, manifest_1.default)(config));
|
|
98
|
+
if (!(0, connection_1.isAppFree)(config)) {
|
|
99
|
+
app.post('/subscription-paid', (0, subscription_paid_1.default)(config));
|
|
100
|
+
}
|
|
101
|
+
const integrationLogic = config.projectIntegration;
|
|
102
|
+
if (integrationLogic) {
|
|
103
|
+
(0, defaults_1.applyDefaults)(config, integrationLogic);
|
|
104
|
+
app.get('/logo/integration/logo.png', (req, res) => res.sendFile(integrationLogic.imagePath || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')));
|
|
105
|
+
app.get('/', (0, crowdin_client_1.default)(config, true, false), (0, integration_credentials_1.default)(config, integrationLogic, true), (0, main_1.default)(config, integrationLogic));
|
|
106
|
+
app.get('/api/subscription-info', json_response_1.default, (0, crowdin_client_1.default)(config), (0, subscription_info_1.default)(config));
|
|
107
|
+
app.post('/api/settings', (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, settings_save_1.default)(config));
|
|
108
|
+
app.post('/api/login', (0, crowdin_client_1.default)(config, false, false), (0, integration_login_1.default)(config, integrationLogic));
|
|
109
|
+
app.post('/api/logout', (0, crowdin_client_1.default)(config, false, false), (0, integration_logout_1.default)(config));
|
|
110
|
+
app.get('/api/crowdin/files', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, crowdin_files_1.default)(config, integrationLogic));
|
|
111
|
+
app.get('/api/crowdin/project', json_response_1.default, (0, crowdin_client_1.default)(config), (0, crowdin_project_1.default)(config));
|
|
112
|
+
app.get('/api/crowdin/file-progress/:fileId', (0, crowdin_client_1.default)(config), (0, crowdin_file_progress_1.default)(config));
|
|
113
|
+
app.get('/api/integration/data', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, integration_data_1.default)(config, integrationLogic));
|
|
114
|
+
app.post('/api/crowdin/update', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, crowdin_update_1.default)(config, integrationLogic));
|
|
115
|
+
app.post('/api/integration/update', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, integration_update_1.default)(config, integrationLogic));
|
|
116
|
+
app.get('/api/sync-settings/:provider', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, sync_settings_1.default)(config));
|
|
117
|
+
app.post('/api/sync-settings', json_response_1.default, (0, crowdin_client_1.default)(config), (0, integration_credentials_1.default)(config, integrationLogic), (0, sync_settings_save_1.default)(config));
|
|
118
|
+
if (integrationLogic.oauthLogin) {
|
|
119
|
+
app.get((0, defaults_1.getOauthRoute)(integrationLogic), (0, oauth_login_1.default)(config, integrationLogic));
|
|
120
|
+
}
|
|
121
|
+
if (integrationLogic.cronJobs) {
|
|
122
|
+
integrationLogic.cronJobs.forEach(job => {
|
|
123
|
+
cron.schedule(job.expression, () => (0, cron_1.runJob)(config, integrationLogic, job).catch(console.error));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (integrationLogic.withCronSync) {
|
|
127
|
+
cron.schedule('0 * * * *', () => (0, cron_1.filesCron)(config, integrationLogic, '1').catch(console.error));
|
|
128
|
+
cron.schedule('0 */3 * * *', () => (0, cron_1.filesCron)(config, integrationLogic, '3').catch(console.error));
|
|
129
|
+
cron.schedule('0 */6 * * *', () => (0, cron_1.filesCron)(config, integrationLogic, '6').catch(console.error));
|
|
130
|
+
cron.schedule('0 */12 * * *', () => (0, cron_1.filesCron)(config, integrationLogic, '12').catch(console.error));
|
|
131
|
+
cron.schedule('0 0 * * *', () => (0, cron_1.filesCron)(config, integrationLogic, '24').catch(console.error));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (config.customFileFormat) {
|
|
135
|
+
app.post('/process', (0, crowdin_client_1.default)(config), (0, process_1.default)(config, config.baseUrl, config.customFileFormat.filesFolder || config.dbFolder, config.customFileFormat));
|
|
136
|
+
app.get('/file/download', (0, download_1.default)(config, config.customFileFormat.filesFolder || config.dbFolder));
|
|
137
|
+
}
|
|
138
|
+
if (config.customMT) {
|
|
139
|
+
app.post('/translate', (0, crowdin_client_1.default)(config), (0, translate_1.default)(config, config.customMT));
|
|
140
|
+
}
|
|
141
|
+
if (config.profileResourcesMenu) {
|
|
142
|
+
app.get('/logo/resources/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.profileResourcesMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
|
|
143
|
+
app.use('/resources', (0, ui_module_1.default)(config), express_1.default.static(config.profileResourcesMenu.uiPath));
|
|
144
|
+
}
|
|
145
|
+
if (config.organizationMenu) {
|
|
146
|
+
app.get('/logo/resources/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.organizationMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
|
|
147
|
+
app.use('/resources', (0, ui_module_1.default)(config), express_1.default.static(config.organizationMenu.uiPath));
|
|
148
|
+
}
|
|
149
|
+
if (config.editorRightPanel) {
|
|
150
|
+
app.use('/editor-panels', (0, ui_module_1.default)(config), express_1.default.static(config.editorRightPanel.uiPath));
|
|
151
|
+
}
|
|
152
|
+
if (config.projectMenu) {
|
|
153
|
+
app.use('/project-menu', (0, ui_module_1.default)(config), express_1.default.static(config.projectMenu.uiPath));
|
|
154
|
+
}
|
|
155
|
+
if (config.projectTools) {
|
|
156
|
+
app.get('/logo/tools/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.projectTools) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
|
|
157
|
+
app.use('/tools', (0, ui_module_1.default)(config), express_1.default.static(config.projectTools.uiPath));
|
|
158
|
+
}
|
|
159
|
+
if (config.projectReports) {
|
|
160
|
+
app.get('/logo/reports/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.projectReports) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
|
|
161
|
+
app.use('/reports', (0, ui_module_1.default)(config), express_1.default.static(config.projectReports.uiPath));
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
getMetadata: storage.getMetadata,
|
|
165
|
+
saveMetadata: (id, metadata) => __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
const existing = yield storage.getMetadata(id);
|
|
167
|
+
if (existing) {
|
|
168
|
+
yield storage.updateMetadata(id, metadata);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
yield storage.saveMetadata(id, metadata);
|
|
172
|
+
}
|
|
173
|
+
}),
|
|
174
|
+
deleteMetadata: storage.deleteMetadata,
|
|
175
|
+
getUserSettings: (clientId) => __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
const integrationCredentials = yield storage.getIntegrationCredentials(clientId);
|
|
177
|
+
if (integrationCredentials === null || integrationCredentials === void 0 ? void 0 : integrationCredentials.config) {
|
|
178
|
+
return JSON.parse(integrationCredentials.config);
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
establishCrowdinConnection: jwtToken => (0, crowdin_client_1.prepareCrowdinRequest)(jwtToken, config),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
exports.addCrowdinEndpoints = addCrowdinEndpoints;
|
|
185
|
+
function createApp(config) {
|
|
186
|
+
const app = (0, express_1.default)();
|
|
187
|
+
addCrowdinEndpoints(app, config);
|
|
188
|
+
/* eslint no-console: "off" */
|
|
189
|
+
app.listen(config.port || 3000, () => console.log(`App started on port ${config.port || 3000}`));
|
|
190
|
+
}
|
|
191
|
+
exports.createApp = createApp;
|
package/out/logo.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="qs" />
|
|
2
|
+
import Crowdin from '@crowdin/crowdin-api-client';
|
|
3
|
+
import { Response } from 'express';
|
|
4
|
+
import { Config, CrowdinContextInfo, SubscriptionInfo } from '../models';
|
|
5
|
+
export declare function prepareCrowdinRequest(jwtToken: string, config: Config, optional?: boolean, checkSubscriptionExpiration?: boolean): Promise<{
|
|
6
|
+
context: CrowdinContextInfo;
|
|
7
|
+
client?: Crowdin;
|
|
8
|
+
subscriptionInfo?: SubscriptionInfo;
|
|
9
|
+
}>;
|
|
10
|
+
export default function handle(config: Config, optional?: boolean, checkSubscriptionExpiration?: boolean): (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|