@crowdin/app-project-module 0.43.1 → 0.45.0
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/index.d.ts +3 -3
- package/out/index.js +103 -219
- package/out/middlewares/crowdin-client.d.ts +1 -1
- package/out/middlewares/crowdin-client.js +3 -2
- package/out/middlewares/integration-credentials.d.ts +3 -2
- package/out/middlewares/render-ui-module.d.ts +2 -2
- package/out/middlewares/ui-module.d.ts +2 -2
- package/out/middlewares/ui-module.js +5 -1
- package/out/{util → modules}/api/api.d.ts +3 -2
- package/out/{util → modules}/api/api.js +22 -22
- package/out/modules/api/index.d.ts +6 -0
- package/out/modules/api/index.js +14 -0
- package/out/modules/api/types.d.ts +20 -0
- package/out/modules/api/types.js +11 -0
- package/out/modules/context-menu/index.d.ts +6 -0
- package/out/modules/context-menu/index.js +17 -0
- package/out/modules/context-menu/types.d.ts +27 -0
- package/out/modules/context-menu/types.js +18 -0
- package/out/{handlers/custom-mt → modules/custom-mt/handlers}/translate.d.ts +2 -1
- package/out/{handlers/custom-mt → modules/custom-mt/handlers}/translate.js +2 -2
- package/out/modules/custom-mt/index.d.ts +6 -0
- package/out/modules/custom-mt/index.js +17 -0
- package/out/modules/custom-mt/types.d.ts +22 -0
- package/out/modules/custom-mt/types.js +2 -0
- package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/get-languages-list.d.ts +2 -1
- package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/get-languages-list.js +2 -2
- package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/spell-check.d.ts +2 -1
- package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/spell-check.js +5 -3
- package/out/modules/custom-spell-check/index.d.ts +6 -0
- package/out/modules/custom-spell-check/index.js +32 -0
- package/out/modules/custom-spell-check/types.d.ts +56 -0
- package/out/modules/custom-spell-check/types.js +2 -0
- package/out/modules/editor-right-panel/index.d.ts +6 -0
- package/out/modules/editor-right-panel/index.js +17 -0
- package/out/modules/editor-right-panel/types.d.ts +7 -0
- package/out/modules/editor-right-panel/types.js +2 -0
- package/out/modules/editor-themes/index.d.ts +6 -0
- package/out/modules/editor-themes/index.js +11 -0
- package/out/modules/editor-themes/types.d.ts +17 -0
- package/out/modules/editor-themes/types.js +2 -0
- package/out/{handlers/file-processing → modules/file-processing/handlers}/custom-file-format.d.ts +2 -1
- package/out/{handlers/file-processing → modules/file-processing/handlers}/custom-file-format.js +5 -5
- package/out/modules/file-processing/handlers/file-download.d.ts +5 -0
- package/out/{handlers/file-processing → modules/file-processing/handlers}/file-download.js +2 -2
- package/out/{handlers/file-processing → modules/file-processing/handlers}/pre-post-process.d.ts +2 -1
- package/out/{handlers/file-processing → modules/file-processing/handlers}/pre-post-process.js +8 -8
- package/out/modules/file-processing/index.d.ts +22 -0
- package/out/modules/file-processing/index.js +57 -0
- package/out/modules/file-processing/types.d.ts +133 -0
- package/out/modules/file-processing/types.js +12 -0
- package/out/modules/file-processing/util/defaults.d.ts +3 -0
- package/out/modules/file-processing/util/defaults.js +30 -0
- package/out/modules/file-processing/util/files.d.ts +6 -0
- package/out/modules/file-processing/util/files.js +47 -0
- package/out/{handlers/integration/crowdin-project.d.ts → modules/form-data-display.d.ts} +1 -1
- package/out/modules/form-data-save.d.ts +4 -0
- package/out/modules/install.d.ts +4 -0
- package/out/{handlers → modules}/install.js +3 -3
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-file-progress.d.ts +2 -1
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-file-progress.js +2 -2
- package/out/modules/integration/handlers/crowdin-files.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-files.js +3 -3
- package/out/modules/integration/handlers/crowdin-project.d.ts +4 -0
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-project.js +1 -1
- package/out/modules/integration/handlers/crowdin-update.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-update.js +9 -9
- package/out/modules/integration/handlers/crowdin-webhook.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/crowdin-webhook.js +19 -8
- package/out/modules/integration/handlers/integration-data.d.ts +4 -0
- package/out/{handlers/integration → modules/integration/handlers}/integration-data.js +5 -5
- package/out/{handlers/integration → modules/integration/handlers}/integration-login.d.ts +2 -1
- package/out/{handlers/integration → modules/integration/handlers}/integration-login.js +3 -3
- package/out/modules/integration/handlers/integration-logout.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/integration-logout.js +14 -7
- package/out/modules/integration/handlers/integration-update.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/integration-update.js +9 -8
- package/out/modules/integration/handlers/integration-webhook.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/integration-webhook.js +9 -4
- package/out/modules/integration/handlers/job-cancel.d.ts +3 -0
- package/out/{handlers/integration → modules/integration/handlers}/job-cancel.js +4 -4
- package/out/modules/integration/handlers/job-info.d.ts +3 -0
- package/out/{handlers/integration → modules/integration/handlers}/job-info.js +4 -4
- package/out/modules/integration/handlers/main.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/main.js +5 -5
- package/out/modules/integration/handlers/oauth-login.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/oauth-login.js +3 -3
- package/out/{handlers/integration → modules/integration/handlers}/oauth-url.d.ts +2 -1
- package/out/{handlers/integration → modules/integration/handlers}/oauth-url.js +2 -2
- package/out/modules/integration/handlers/settings-save.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/settings-save.js +28 -11
- package/out/modules/integration/handlers/settings.d.ts +3 -0
- package/out/{handlers/integration → modules/integration/handlers}/settings.js +1 -1
- package/out/{handlers/integration → modules/integration/handlers}/subscription-info.d.ts +1 -1
- package/out/{handlers/integration → modules/integration/handlers}/subscription-info.js +2 -2
- package/out/modules/integration/handlers/sync-settings-save.d.ts +5 -0
- package/out/{handlers/integration → modules/integration/handlers}/sync-settings-save.js +16 -8
- package/out/modules/integration/handlers/sync-settings.d.ts +3 -0
- package/out/{handlers/integration → modules/integration/handlers}/sync-settings.js +2 -2
- package/out/modules/integration/handlers/user-errors.d.ts +3 -0
- package/out/{handlers/integration → modules/integration/handlers}/user-errors.js +2 -2
- package/out/modules/integration/index.d.ts +6 -0
- package/out/modules/integration/index.js +118 -0
- package/out/modules/integration/types.d.ts +435 -0
- package/out/modules/integration/types.js +19 -0
- package/out/modules/integration/util/cron.d.ts +27 -0
- package/out/{util → modules/integration/util}/cron.js +97 -28
- package/out/{util → modules/integration/util}/defaults.d.ts +2 -3
- package/out/{util → modules/integration/util}/defaults.js +1 -36
- package/out/modules/integration/util/files.d.ts +5 -0
- package/out/{util → modules/integration/util}/files.js +9 -40
- package/out/{util → modules/integration/util}/job.d.ts +1 -1
- package/out/{util → modules/integration/util}/job.js +11 -11
- package/out/{util/file-snapshot.d.ts → modules/integration/util/snapshot.d.ts} +2 -3
- package/out/{util/file-snapshot.js → modules/integration/util/snapshot.js} +6 -65
- package/out/{models/job.d.ts → modules/integration/util/types.d.ts} +14 -0
- package/out/modules/integration/util/webhooks.d.ts +48 -0
- package/out/{util → modules/integration/util}/webhooks.js +95 -49
- package/out/modules/manifest.d.ts +3 -0
- package/out/{handlers → modules}/manifest.js +22 -16
- package/out/modules/modal/index.d.ts +6 -0
- package/out/modules/modal/index.js +17 -0
- package/out/modules/organization-menu/index.d.ts +6 -0
- package/out/modules/organization-menu/index.js +18 -0
- package/out/modules/profile-resources-menu/index.d.ts +6 -0
- package/out/modules/profile-resources-menu/index.js +18 -0
- package/out/modules/project-menu/index.d.ts +6 -0
- package/out/modules/project-menu/index.js +17 -0
- package/out/modules/project-menu-crowdsource/index.d.ts +6 -0
- package/out/modules/project-menu-crowdsource/index.js +17 -0
- package/out/modules/project-reports/index.d.ts +6 -0
- package/out/modules/project-reports/index.js +18 -0
- package/out/modules/project-tools/index.d.ts +6 -0
- package/out/modules/project-tools/index.js +18 -0
- package/out/modules/subscription-paid.d.ts +3 -0
- package/out/{handlers → modules}/subscription-paid.js +2 -2
- package/out/modules/uninstall.d.ts +4 -0
- package/out/{handlers → modules}/uninstall.js +6 -2
- package/out/storage/index.d.ts +5 -3
- package/out/storage/mysql.d.ts +4 -2
- package/out/storage/mysql.js +3 -3
- package/out/storage/postgre.d.ts +4 -2
- package/out/storage/postgre.js +3 -3
- package/out/storage/sqlite.d.ts +4 -2
- package/out/storage/sqlite.js +3 -3
- package/out/storage/types.d.ts +9 -0
- package/out/storage/types.js +2 -0
- package/out/types.d.ts +374 -0
- package/out/types.js +59 -0
- package/out/util/connection.d.ts +2 -9
- package/out/util/connection.js +54 -150
- package/out/util/handlebars.d.ts +1 -0
- package/out/util/handlebars.js +34 -0
- package/out/util/index.d.ts +2 -2
- package/out/util/index.js +6 -6
- package/out/util/logger.d.ts +2 -2
- package/out/util/subscription.d.ts +9 -0
- package/out/util/subscription.js +111 -0
- package/package.json +1 -1
- package/out/handlers/file-processing/file-download.d.ts +0 -4
- package/out/handlers/form-data-display.d.ts +0 -3
- package/out/handlers/form-data-save.d.ts +0 -3
- package/out/handlers/install.d.ts +0 -4
- package/out/handlers/integration/crowdin-files.d.ts +0 -4
- package/out/handlers/integration/crowdin-update.d.ts +0 -4
- package/out/handlers/integration/crowdin-webhook.d.ts +0 -4
- package/out/handlers/integration/integration-data.d.ts +0 -4
- package/out/handlers/integration/integration-logout.d.ts +0 -4
- package/out/handlers/integration/integration-update.d.ts +0 -4
- package/out/handlers/integration/integration-webhook.d.ts +0 -4
- package/out/handlers/integration/job-cancel.d.ts +0 -3
- package/out/handlers/integration/job-info.d.ts +0 -3
- package/out/handlers/integration/main.d.ts +0 -4
- package/out/handlers/integration/oauth-login.d.ts +0 -4
- package/out/handlers/integration/settings-save.d.ts +0 -4
- package/out/handlers/integration/settings.d.ts +0 -3
- package/out/handlers/integration/sync-settings-save.d.ts +0 -4
- package/out/handlers/integration/sync-settings.d.ts +0 -3
- package/out/handlers/integration/user-errors.d.ts +0 -3
- package/out/handlers/manifest.d.ts +0 -3
- package/out/handlers/subscription-paid.d.ts +0 -3
- package/out/handlers/uninstall.d.ts +0 -4
- package/out/models/index.d.ts +0 -1088
- package/out/models/index.js +0 -106
- package/out/util/cron.d.ts +0 -7
- package/out/util/files.d.ts +0 -9
- package/out/util/webhooks.d.ts +0 -28
- /package/out/{util → modules}/api/base.d.ts +0 -0
- /package/out/{util → modules}/api/base.js +0 -0
- /package/out/{util → modules}/api/components.d.ts +0 -0
- /package/out/{util → modules}/api/components.js +0 -0
- /package/out/{handlers → modules}/form-data-display.js +0 -0
- /package/out/{handlers → modules}/form-data-save.js +0 -0
- /package/out/{models/job.js → modules/integration/util/types.js} +0 -0
package/out/util/connection.js
CHANGED
|
@@ -12,54 +12,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.prepareIntegrationCredentials = exports.prepareCrowdinClient = void 0;
|
|
16
16
|
const crowdin_api_client_1 = __importDefault(require("@crowdin/crowdin-api-client"));
|
|
17
17
|
const crowdin_apps_functions_1 = require("@crowdin/crowdin-apps-functions");
|
|
18
18
|
const axios_1 = __importDefault(require("axios"));
|
|
19
19
|
const _1 = require(".");
|
|
20
|
-
const models_1 = require("../models");
|
|
21
20
|
const storage_1 = require("../storage");
|
|
21
|
+
const types_1 = require("../types");
|
|
22
22
|
const axios_2 = require("./axios");
|
|
23
23
|
const logger_1 = require("./logger");
|
|
24
24
|
const axiosCustom = new axios_2.AxiosProvider().axios;
|
|
25
|
-
function refreshToken(config, credentials) {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
if (config.authenticationType === models_1.AuthenticationType.CODE) {
|
|
29
|
-
const token = yield (0, crowdin_apps_functions_1.refreshOAuthToken)({
|
|
30
|
-
clientId: config.clientId,
|
|
31
|
-
clientSecret: config.clientSecret,
|
|
32
|
-
refreshToken: (0, _1.decryptData)(config, credentials.refreshToken),
|
|
33
|
-
url: (_a = config.crowdinUrls) === null || _a === void 0 ? void 0 : _a.accountUrl,
|
|
34
|
-
});
|
|
35
|
-
return {
|
|
36
|
-
accessToken: (0, _1.encryptData)(config, token.accessToken),
|
|
37
|
-
refreshToken: (0, _1.encryptData)(config, token.refreshToken),
|
|
38
|
-
expiresIn: token.expiresIn,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const token = yield (0, crowdin_apps_functions_1.fetchAppToken)({
|
|
42
|
-
appId: config.identifier,
|
|
43
|
-
appSecret: credentials.appSecret,
|
|
44
|
-
clientId: config.clientId,
|
|
45
|
-
clientSecret: config.clientSecret,
|
|
46
|
-
domain: credentials.domain || '',
|
|
47
|
-
userId: credentials.userId,
|
|
48
|
-
url: (_b = config.crowdinUrls) === null || _b === void 0 ? void 0 : _b.accountUrl,
|
|
49
|
-
});
|
|
50
|
-
return {
|
|
51
|
-
accessToken: (0, _1.encryptData)(config, token.accessToken),
|
|
52
|
-
expiresIn: token.expiresIn,
|
|
53
|
-
refreshToken: '',
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
25
|
function prepareCrowdinClient({ config, credentials, autoRenew = false, context, }) {
|
|
58
26
|
var _a, _b;
|
|
59
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
28
|
//2 min as an extra buffer
|
|
61
29
|
const isExpired = +credentials.expire - 120 < Date.now() / 1000;
|
|
62
|
-
const organization = credentials.type ===
|
|
30
|
+
const organization = credentials.type === types_1.AccountType.ENTERPRISE ? credentials.id : undefined;
|
|
63
31
|
let token;
|
|
64
32
|
let crowdinCreds;
|
|
65
33
|
if (!isExpired) {
|
|
@@ -211,31 +179,6 @@ function prepareCrowdinClient({ config, credentials, autoRenew = false, context,
|
|
|
211
179
|
});
|
|
212
180
|
}
|
|
213
181
|
exports.prepareCrowdinClient = prepareCrowdinClient;
|
|
214
|
-
function refreshCrowdinCreds({ config, credentials }) {
|
|
215
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
(0, logger_1.log)('Crowdin credentials have expired. Requesting a new credentials');
|
|
217
|
-
const newCredentials = yield refreshToken(config, credentials);
|
|
218
|
-
(0, logger_1.log)('Saving updated crowdin credentials in the database');
|
|
219
|
-
const newCrowdinCredentials = {
|
|
220
|
-
id: credentials.id,
|
|
221
|
-
appSecret: credentials.appSecret,
|
|
222
|
-
domain: credentials.domain,
|
|
223
|
-
userId: credentials.userId,
|
|
224
|
-
organizationId: credentials.organizationId,
|
|
225
|
-
baseUrl: credentials.baseUrl,
|
|
226
|
-
refreshToken: newCredentials.refreshToken,
|
|
227
|
-
accessToken: newCredentials.accessToken,
|
|
228
|
-
expire: (new Date().getTime() / 1000 + newCredentials.expiresIn).toString(),
|
|
229
|
-
type: credentials.type,
|
|
230
|
-
};
|
|
231
|
-
yield (0, storage_1.getStorage)().updateCrowdinCredentials(newCrowdinCredentials);
|
|
232
|
-
const token = (0, _1.decryptData)(config, newCredentials.accessToken);
|
|
233
|
-
return {
|
|
234
|
-
credentials: newCrowdinCredentials,
|
|
235
|
-
token,
|
|
236
|
-
};
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
182
|
function prepareIntegrationCredentials(config, integration, integrationCredentials) {
|
|
240
183
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
241
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -279,99 +222,60 @@ function prepareIntegrationCredentials(config, integration, integrationCredentia
|
|
|
279
222
|
});
|
|
280
223
|
}
|
|
281
224
|
exports.prepareIntegrationCredentials = prepareIntegrationCredentials;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return !config.pricing || config.pricing.planType === 'free';
|
|
307
|
-
}
|
|
308
|
-
exports.isAppFree = isAppFree;
|
|
309
|
-
function validateSubscription(date) {
|
|
310
|
-
const expired = date.getTime() < Date.now();
|
|
311
|
-
const daysLeft = Math.round((date.getTime() - Date.now()) / (1000 * 60 * 60 * 24));
|
|
312
|
-
return { expired, daysLeft };
|
|
225
|
+
function refreshCrowdinCreds({ config, credentials }) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
+
(0, logger_1.log)('Crowdin credentials have expired. Requesting a new credentials');
|
|
228
|
+
const newCredentials = yield refreshToken(config, credentials);
|
|
229
|
+
(0, logger_1.log)('Saving updated crowdin credentials in the database');
|
|
230
|
+
const newCrowdinCredentials = {
|
|
231
|
+
id: credentials.id,
|
|
232
|
+
appSecret: credentials.appSecret,
|
|
233
|
+
domain: credentials.domain,
|
|
234
|
+
userId: credentials.userId,
|
|
235
|
+
organizationId: credentials.organizationId,
|
|
236
|
+
baseUrl: credentials.baseUrl,
|
|
237
|
+
refreshToken: newCredentials.refreshToken,
|
|
238
|
+
accessToken: newCredentials.accessToken,
|
|
239
|
+
expire: (new Date().getTime() / 1000 + newCredentials.expiresIn).toString(),
|
|
240
|
+
type: credentials.type,
|
|
241
|
+
};
|
|
242
|
+
yield (0, storage_1.getStorage)().updateCrowdinCredentials(newCrowdinCredentials);
|
|
243
|
+
const token = (0, _1.decryptData)(config, newCredentials.accessToken);
|
|
244
|
+
return {
|
|
245
|
+
credentials: newCrowdinCredentials,
|
|
246
|
+
token,
|
|
247
|
+
};
|
|
248
|
+
});
|
|
313
249
|
}
|
|
314
|
-
function
|
|
315
|
-
var _a, _b
|
|
250
|
+
function refreshToken(config, credentials) {
|
|
251
|
+
var _a, _b;
|
|
316
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (cacheEntry) {
|
|
324
|
-
const { cacheValidUntil, validUntil, subscribeLink, type } = cacheEntry;
|
|
325
|
-
if (cacheValidUntil.getTime() > Date.now()) {
|
|
326
|
-
(0, logger_1.log)(`Loaded data from cache. Subscription is valid until ${validUntil.toISOString()}`);
|
|
327
|
-
const { expired, daysLeft } = validateSubscription(new Date(validUntil));
|
|
328
|
-
(0, logger_1.log)(`expired ${expired}`);
|
|
329
|
-
return { expired, subscribeLink, daysLeft, type };
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
try {
|
|
333
|
-
const subscription = yield (0, crowdin_apps_functions_1.getSubscription)({
|
|
334
|
-
appIdentifier,
|
|
335
|
-
organization: accountType === models_1.AccountType.ENTERPRISE ? organization : undefined,
|
|
336
|
-
token,
|
|
337
|
-
baseUrl: (_a = config.crowdinUrls) === null || _a === void 0 ? void 0 : _a.subscriptionUrl,
|
|
253
|
+
if (config.authenticationType === types_1.AuthenticationType.CODE) {
|
|
254
|
+
const token = yield (0, crowdin_apps_functions_1.refreshOAuthToken)({
|
|
255
|
+
clientId: config.clientId,
|
|
256
|
+
clientSecret: config.clientSecret,
|
|
257
|
+
refreshToken: (0, _1.decryptData)(config, credentials.refreshToken),
|
|
258
|
+
url: (_a = config.crowdinUrls) === null || _a === void 0 ? void 0 : _a.accountUrl,
|
|
338
259
|
});
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
catch (e) {
|
|
346
|
-
if (e instanceof crowdin_apps_functions_1.PaymentRequiredError) {
|
|
347
|
-
const { initializedAt, subscribeLink } = e;
|
|
348
|
-
(0, logger_1.log)(`Recieved 402 payment error. initializedAt ${initializedAt}`);
|
|
349
|
-
//default 2 weeks
|
|
350
|
-
const defaultSubscriptionPlan = 14;
|
|
351
|
-
let days;
|
|
352
|
-
if (accountType === models_1.AccountType.ENTERPRISE) {
|
|
353
|
-
days = ((_c = config.pricing) === null || _c === void 0 ? void 0 : _c.trialEnterprise) || ((_d = config.pricing) === null || _d === void 0 ? void 0 : _d.trial) || defaultSubscriptionPlan;
|
|
354
|
-
}
|
|
355
|
-
else {
|
|
356
|
-
days = ((_e = config.pricing) === null || _e === void 0 ? void 0 : _e.trialCrowdin) || ((_f = config.pricing) === null || _f === void 0 ? void 0 : _f.trial) || defaultSubscriptionPlan;
|
|
357
|
-
}
|
|
358
|
-
(0, logger_1.log)(`Subscriptino trial plan ${days} days`);
|
|
359
|
-
const date = new Date(initializedAt);
|
|
360
|
-
date.setDate(date.getDate() + days);
|
|
361
|
-
const { expired, daysLeft } = validateSubscription(date);
|
|
362
|
-
(0, logger_1.log)(`expired ${expired}`);
|
|
363
|
-
addToCache(organization, appIdentifier, new Date(date), models_1.SubscriptionInfoType.TRIAL, (_g = config.pricing) === null || _g === void 0 ? void 0 : _g.cachingSeconds, subscribeLink);
|
|
364
|
-
return { expired, subscribeLink, daysLeft, type: models_1.SubscriptionInfoType.TRIAL };
|
|
365
|
-
}
|
|
366
|
-
if (config.onError) {
|
|
367
|
-
config.onError(e);
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
console.error(e);
|
|
371
|
-
}
|
|
372
|
-
(0, logger_1.log)('Recieved http error from subscription request. Returning expired=false');
|
|
373
|
-
return { expired: false };
|
|
260
|
+
return {
|
|
261
|
+
accessToken: (0, _1.encryptData)(config, token.accessToken),
|
|
262
|
+
refreshToken: (0, _1.encryptData)(config, token.refreshToken),
|
|
263
|
+
expiresIn: token.expiresIn,
|
|
264
|
+
};
|
|
374
265
|
}
|
|
266
|
+
const token = yield (0, crowdin_apps_functions_1.fetchAppToken)({
|
|
267
|
+
appId: config.identifier,
|
|
268
|
+
appSecret: credentials.appSecret,
|
|
269
|
+
clientId: config.clientId,
|
|
270
|
+
clientSecret: config.clientSecret,
|
|
271
|
+
domain: credentials.domain || '',
|
|
272
|
+
userId: credentials.userId,
|
|
273
|
+
url: (_b = config.crowdinUrls) === null || _b === void 0 ? void 0 : _b.accountUrl,
|
|
274
|
+
});
|
|
275
|
+
return {
|
|
276
|
+
accessToken: (0, _1.encryptData)(config, token.accessToken),
|
|
277
|
+
expiresIn: token.expiresIn,
|
|
278
|
+
refreshToken: '',
|
|
279
|
+
};
|
|
375
280
|
});
|
|
376
281
|
}
|
|
377
|
-
exports.checkSubscription = checkSubscription;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const engine: (path: string, options: object, callback: (e: any, rendered: string) => void) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.engine = void 0;
|
|
7
|
+
const express_handlebars_1 = __importDefault(require("express-handlebars"));
|
|
8
|
+
exports.engine = (0, express_handlebars_1.default)({
|
|
9
|
+
layoutsDir: '',
|
|
10
|
+
defaultLayout: '',
|
|
11
|
+
helpers: {
|
|
12
|
+
ifeq: function (a, b, options) {
|
|
13
|
+
if (a === b) {
|
|
14
|
+
return options.fn(this);
|
|
15
|
+
}
|
|
16
|
+
return options.inverse(this);
|
|
17
|
+
},
|
|
18
|
+
checkLength: function (a, b, options) {
|
|
19
|
+
if (a.length > b) {
|
|
20
|
+
return options.fn(this);
|
|
21
|
+
}
|
|
22
|
+
return options.inverse(this);
|
|
23
|
+
},
|
|
24
|
+
in: function (a, b, options) {
|
|
25
|
+
if (a.toString().includes(b.toString())) {
|
|
26
|
+
return options.fn(this);
|
|
27
|
+
}
|
|
28
|
+
return options.inverse(this);
|
|
29
|
+
},
|
|
30
|
+
or: function (a, b, options) {
|
|
31
|
+
return a || b ? options.fn(this) : options.inverse(this);
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
package/out/util/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
import { Config, CrowdinClientRequest,
|
|
2
|
+
import { Config, CrowdinClientRequest, ImagePath, UnauthorizedConfig } from '../types';
|
|
3
3
|
export declare class CodeError extends Error {
|
|
4
4
|
code: number | undefined;
|
|
5
5
|
constructor(message: string, code?: number);
|
|
@@ -8,5 +8,5 @@ export declare function runAsyncWrapper(callback: Function): (req: Request | Cro
|
|
|
8
8
|
export declare function encryptData(config: Config, data: string): string;
|
|
9
9
|
export declare function decryptData(config: Config, data: string): string;
|
|
10
10
|
export declare function executeWithRetry<T>(func: () => Promise<T>, numOfRetries?: number): Promise<T>;
|
|
11
|
-
export declare function isExtendedResultType<T>(data?: T | ExtendedResult<T>): data is ExtendedResult<T>;
|
|
12
11
|
export declare function getLogoUrl(moduleConfig?: ImagePath, modulePath?: string): string;
|
|
12
|
+
export declare function isAuthorizedConfig(config: Config | UnauthorizedConfig): config is Config;
|
package/out/util/index.js
CHANGED
|
@@ -32,9 +32,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
35
|
+
exports.isAuthorizedConfig = exports.getLogoUrl = exports.executeWithRetry = exports.decryptData = exports.encryptData = exports.runAsyncWrapper = exports.CodeError = void 0;
|
|
36
36
|
const crypto = __importStar(require("crypto-js"));
|
|
37
37
|
const storage_1 = require("../storage");
|
|
38
|
+
const types_1 = require("../types");
|
|
38
39
|
const logger_1 = require("./logger");
|
|
39
40
|
class CodeError extends Error {
|
|
40
41
|
constructor(message, code) {
|
|
@@ -100,11 +101,6 @@ function executeWithRetry(func, numOfRetries = 2) {
|
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
103
|
exports.executeWithRetry = executeWithRetry;
|
|
103
|
-
function isExtendedResultType(data) {
|
|
104
|
-
const dataTyped = data;
|
|
105
|
-
return !!dataTyped && !Array.isArray(dataTyped);
|
|
106
|
-
}
|
|
107
|
-
exports.isExtendedResultType = isExtendedResultType;
|
|
108
104
|
function getLogoUrl(moduleConfig, modulePath) {
|
|
109
105
|
if (!moduleConfig && !modulePath) {
|
|
110
106
|
return '/logo.png';
|
|
@@ -112,3 +108,7 @@ function getLogoUrl(moduleConfig, modulePath) {
|
|
|
112
108
|
return `/logo${modulePath}/logo.png`;
|
|
113
109
|
}
|
|
114
110
|
exports.getLogoUrl = getLogoUrl;
|
|
111
|
+
function isAuthorizedConfig(config) {
|
|
112
|
+
return !!config.clientId && !!config.clientSecret && config.authenticationType !== types_1.AuthenticationType.NONE;
|
|
113
|
+
}
|
|
114
|
+
exports.isAuthorizedConfig = isAuthorizedConfig;
|
package/out/util/logger.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosError } from 'axios';
|
|
2
|
-
import { Config, CrowdinContextInfo } from '../
|
|
2
|
+
import { Config, CrowdinContextInfo, UnauthorizedConfig } from '../types';
|
|
3
3
|
export type LogFunction = (message: string) => void;
|
|
4
4
|
export type LogErrorFunction = (error: any) => void;
|
|
5
5
|
export type LogContext = {
|
|
@@ -7,7 +7,7 @@ export type LogContext = {
|
|
|
7
7
|
orgId: string;
|
|
8
8
|
projectId: number;
|
|
9
9
|
};
|
|
10
|
-
export declare function initialize(config: Config): void;
|
|
10
|
+
export declare function initialize(config: Config | UnauthorizedConfig): void;
|
|
11
11
|
export declare function prepareContext(context: CrowdinContextInfo): LogContext;
|
|
12
12
|
export declare function withContext(context: CrowdinContextInfo): LogFunction;
|
|
13
13
|
export declare function withContextError(context: CrowdinContextInfo): LogFunction;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AccountType, Config, SubscriptionInfo, UnauthorizedConfig } from '../types';
|
|
2
|
+
export declare function isAppFree(config: Config | UnauthorizedConfig): boolean;
|
|
3
|
+
export declare function checkSubscription({ config, token, organization, accountType, }: {
|
|
4
|
+
config: Config;
|
|
5
|
+
token: string;
|
|
6
|
+
organization: string;
|
|
7
|
+
accountType: AccountType;
|
|
8
|
+
}): Promise<SubscriptionInfo>;
|
|
9
|
+
export declare function clearCache(organization: string): void;
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
exports.clearCache = exports.checkSubscription = exports.isAppFree = void 0;
|
|
13
|
+
const crowdin_apps_functions_1 = require("@crowdin/crowdin-apps-functions");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
const logger_1 = require("./logger");
|
|
16
|
+
const subscriptionCache = {};
|
|
17
|
+
function isAppFree(config) {
|
|
18
|
+
return !config.pricing || config.pricing.planType === 'free';
|
|
19
|
+
}
|
|
20
|
+
exports.isAppFree = isAppFree;
|
|
21
|
+
function checkSubscription({ config, token, organization, accountType, }) {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
if (isAppFree(config)) {
|
|
25
|
+
return { expired: false };
|
|
26
|
+
}
|
|
27
|
+
(0, logger_1.log)('Checking subscription plan');
|
|
28
|
+
const appIdentifier = config.identifier;
|
|
29
|
+
const cacheEntry = getFromCache(organization, appIdentifier);
|
|
30
|
+
if (cacheEntry) {
|
|
31
|
+
const { cacheValidUntil, validUntil, subscribeLink, type } = cacheEntry;
|
|
32
|
+
if (cacheValidUntil.getTime() > Date.now()) {
|
|
33
|
+
(0, logger_1.log)(`Loaded data from cache. Subscription is valid until ${validUntil.toISOString()}`);
|
|
34
|
+
const { expired, daysLeft } = validateSubscription(new Date(validUntil));
|
|
35
|
+
(0, logger_1.log)(`expired ${expired}`);
|
|
36
|
+
return { expired, subscribeLink, daysLeft, type };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const subscription = yield (0, crowdin_apps_functions_1.getSubscription)({
|
|
41
|
+
appIdentifier,
|
|
42
|
+
organization: accountType === types_1.AccountType.ENTERPRISE ? organization : undefined,
|
|
43
|
+
token,
|
|
44
|
+
baseUrl: (_a = config.crowdinUrls) === null || _a === void 0 ? void 0 : _a.subscriptionUrl,
|
|
45
|
+
});
|
|
46
|
+
(0, logger_1.log)(`Recieved subscription info. ${JSON.stringify(subscription)}`);
|
|
47
|
+
const { expired, daysLeft } = validateSubscription(new Date(subscription.expires));
|
|
48
|
+
(0, logger_1.log)(`expired ${expired}`);
|
|
49
|
+
addToCache(organization, appIdentifier, new Date(subscription.expires), types_1.SubscriptionInfoType.SUBSCRIPTION, (_b = config.pricing) === null || _b === void 0 ? void 0 : _b.cachingSeconds);
|
|
50
|
+
return { expired, daysLeft, type: types_1.SubscriptionInfoType.SUBSCRIPTION };
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
if (e instanceof crowdin_apps_functions_1.PaymentRequiredError) {
|
|
54
|
+
const { initializedAt, subscribeLink } = e;
|
|
55
|
+
(0, logger_1.log)(`Recieved 402 payment error. initializedAt ${initializedAt}`);
|
|
56
|
+
//default 2 weeks
|
|
57
|
+
const defaultSubscriptionPlan = 14;
|
|
58
|
+
let days;
|
|
59
|
+
if (accountType === types_1.AccountType.ENTERPRISE) {
|
|
60
|
+
days = ((_c = config.pricing) === null || _c === void 0 ? void 0 : _c.trialEnterprise) || ((_d = config.pricing) === null || _d === void 0 ? void 0 : _d.trial) || defaultSubscriptionPlan;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
days = ((_e = config.pricing) === null || _e === void 0 ? void 0 : _e.trialCrowdin) || ((_f = config.pricing) === null || _f === void 0 ? void 0 : _f.trial) || defaultSubscriptionPlan;
|
|
64
|
+
}
|
|
65
|
+
(0, logger_1.log)(`Subscriptino trial plan ${days} days`);
|
|
66
|
+
const date = new Date(initializedAt);
|
|
67
|
+
date.setDate(date.getDate() + days);
|
|
68
|
+
const { expired, daysLeft } = validateSubscription(date);
|
|
69
|
+
(0, logger_1.log)(`expired ${expired}`);
|
|
70
|
+
addToCache(organization, appIdentifier, new Date(date), types_1.SubscriptionInfoType.TRIAL, (_g = config.pricing) === null || _g === void 0 ? void 0 : _g.cachingSeconds, subscribeLink);
|
|
71
|
+
return { expired, subscribeLink, daysLeft, type: types_1.SubscriptionInfoType.TRIAL };
|
|
72
|
+
}
|
|
73
|
+
if (config.onError) {
|
|
74
|
+
config.onError(e);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
console.error(e);
|
|
78
|
+
}
|
|
79
|
+
(0, logger_1.log)('Recieved http error from subscription request. Returning expired=false');
|
|
80
|
+
return { expired: false };
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.checkSubscription = checkSubscription;
|
|
85
|
+
function clearCache(organization) {
|
|
86
|
+
delete subscriptionCache[organization];
|
|
87
|
+
}
|
|
88
|
+
exports.clearCache = clearCache;
|
|
89
|
+
function addToCache(organization, appIdentifier, validUntil, type, cachingSeconds, subscribeLink) {
|
|
90
|
+
if (!cachingSeconds) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const orgCache = subscriptionCache[organization] || {};
|
|
94
|
+
const now = new Date();
|
|
95
|
+
now.setSeconds(now.getSeconds() + cachingSeconds);
|
|
96
|
+
orgCache[appIdentifier] = {
|
|
97
|
+
cacheValidUntil: now,
|
|
98
|
+
validUntil,
|
|
99
|
+
subscribeLink,
|
|
100
|
+
type,
|
|
101
|
+
};
|
|
102
|
+
subscriptionCache[organization] = orgCache;
|
|
103
|
+
}
|
|
104
|
+
function getFromCache(organization, appIdentifier) {
|
|
105
|
+
return (subscriptionCache[organization] || {})[appIdentifier];
|
|
106
|
+
}
|
|
107
|
+
function validateSubscription(date) {
|
|
108
|
+
const expired = date.getTime() < Date.now();
|
|
109
|
+
const daysLeft = Math.round((date.getTime() - Date.now()) / (1000 * 60 * 60 * 24));
|
|
110
|
+
return { expired, daysLeft };
|
|
111
|
+
}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import { Config, FileProcessLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, processingConfig: FileProcessLogic, folderName: string): (req: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import { Config } from '../models';
|
|
4
|
-
export default function handle(config: Config): (req: import("../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
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: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
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: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
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: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
import { Config, IntegrationLogic } from '../../models';
|
|
4
|
-
export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../../models").CrowdinClientRequest | 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;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
export default function handle(): (req: import("../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import { Config } from '../models';
|
|
4
|
-
export default function handle(config: Config): (req: import("../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
|