@crowdin/app-project-module 0.29.3 → 0.29.5
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/handlers/settings-save.js +4 -2
- package/out/index.d.ts +2 -0
- package/out/index.js +6 -5
- package/out/static/js/form.js +6 -6
- package/out/storage/postgre.d.ts +1 -0
- package/out/storage/postgre.js +19 -1
- package/out/util/cron.js +4 -3
- package/out/util/defaults.js +2 -2
- package/out/util/file-snapshot.js +6 -0
- package/out/util/terminus-express.d.ts +7 -0
- package/out/util/terminus-express.js +21 -0
- package/out/views/main.handlebars +16 -4
- package/package.json +6 -5
|
@@ -24,13 +24,15 @@ function handle(config, integration) {
|
|
|
24
24
|
yield (0, webhooks_1.registerWebhooks)(config, integration, req.crowdinApiClient, req.crowdinContext, req.integrationCredentials, appSettings);
|
|
25
25
|
}
|
|
26
26
|
if (appSettings['new-crowdin-files']) {
|
|
27
|
-
yield (0, cron_1.createOrUpdateSyncSettings)(config, req, {}, models_1.Provider.CROWDIN, true);
|
|
28
27
|
(0, file_snapshot_1.createOrUpdateFileSnapshot)(config, integration, req, models_1.Provider.CROWDIN);
|
|
29
28
|
}
|
|
30
29
|
if (appSettings['new-integration-files']) {
|
|
31
|
-
yield (0, cron_1.createOrUpdateSyncSettings)(config, req, [], models_1.Provider.INTEGRATION, true);
|
|
32
30
|
(0, file_snapshot_1.createOrUpdateFileSnapshot)(config, integration, req, models_1.Provider.INTEGRATION);
|
|
33
31
|
}
|
|
32
|
+
if (integration.syncNewElements) {
|
|
33
|
+
yield (0, cron_1.createOrUpdateSyncSettings)(config, req, {}, models_1.Provider.CROWDIN, true);
|
|
34
|
+
yield (0, cron_1.createOrUpdateSyncSettings)(config, req, [], models_1.Provider.INTEGRATION, true);
|
|
35
|
+
}
|
|
34
36
|
res.status(204).end();
|
|
35
37
|
}), config.onError);
|
|
36
38
|
}
|
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Express } from 'express';
|
|
2
|
+
import express from './util/terminus-express';
|
|
2
3
|
import { ClientConfig, Config, CrowdinAppUtilities } from './models';
|
|
3
4
|
export { Scope } from './models';
|
|
5
|
+
export { express };
|
|
4
6
|
export declare function addCrowdinEndpoints(app: Express, clientConfig: Config | ClientConfig): CrowdinAppUtilities;
|
|
5
7
|
export declare function createApp(clientConfig: ClientConfig): void;
|
package/out/index.js
CHANGED
|
@@ -35,11 +35,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.createApp = exports.addCrowdinEndpoints = exports.Scope = void 0;
|
|
39
|
-
const express_1 = __importDefault(require("express"));
|
|
38
|
+
exports.createApp = exports.addCrowdinEndpoints = exports.express = exports.Scope = void 0;
|
|
40
39
|
const express_handlebars_1 = __importDefault(require("express-handlebars"));
|
|
41
40
|
const cron = __importStar(require("node-cron"));
|
|
42
41
|
const path_1 = require("path");
|
|
42
|
+
const terminus_express_1 = __importDefault(require("./util/terminus-express"));
|
|
43
|
+
exports.express = terminus_express_1.default;
|
|
43
44
|
const crowdin_file_progress_1 = __importDefault(require("./handlers/crowdin-file-progress"));
|
|
44
45
|
const crowdin_files_1 = __importDefault(require("./handlers/crowdin-files"));
|
|
45
46
|
const crowdin_project_1 = __importDefault(require("./handlers/crowdin-project"));
|
|
@@ -89,8 +90,8 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
89
90
|
handleUncaughtErrors(config);
|
|
90
91
|
}
|
|
91
92
|
storage.initialize(config);
|
|
92
|
-
app.use(
|
|
93
|
-
app.use('/assets',
|
|
93
|
+
app.use(terminus_express_1.default.json({ limit: '50mb' }));
|
|
94
|
+
app.use('/assets', terminus_express_1.default.static((0, path_1.join)(__dirname, 'static')));
|
|
94
95
|
app.set('views', (0, path_1.join)(__dirname, 'views'));
|
|
95
96
|
app.engine('handlebars', (0, express_handlebars_1.default)({
|
|
96
97
|
layoutsDir: '',
|
|
@@ -284,7 +285,7 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
284
285
|
}
|
|
285
286
|
exports.addCrowdinEndpoints = addCrowdinEndpoints;
|
|
286
287
|
function createApp(clientConfig) {
|
|
287
|
-
const app = (0,
|
|
288
|
+
const app = (0, terminus_express_1.default)();
|
|
288
289
|
const config = (0, defaults_1.convertClientConfig)(clientConfig);
|
|
289
290
|
addCrowdinEndpoints(app, config);
|
|
290
291
|
/* eslint no-console: "off" */
|