@crowdin/app-project-module 1.2.1 → 1.3.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/app-test/integration/get-integration-files.js +1 -1
- package/out/app-test/integration/index.js +6 -6
- package/out/app-test/integration/mocks/crowdin-storage.d.ts +16 -16
- package/out/app-test/integration/mocks/mock-crowdin-api-client.js +17 -7
- package/out/app-test/integration/update-crowdin.js +1 -1
- package/out/app-test/integration/update-integration.js +1 -1
- package/out/app-test/util/index.js +1 -2
- package/out/index.js +23 -13
- package/out/middlewares/api-call.js +1 -1
- package/out/middlewares/auto-credentials-masker.js +2 -3
- package/out/middlewares/crowdin-client.d.ts +1 -2
- package/out/middlewares/crowdin-client.js +5 -6
- package/out/middlewares/integration-credentials.d.ts +1 -2
- package/out/middlewares/integration-credentials.js +18 -8
- package/out/middlewares/json-response.js +1 -1
- package/out/middlewares/render-ui-module.d.ts +1 -2
- package/out/middlewares/render-ui-module.js +1 -1
- package/out/middlewares/ui-module.d.ts +1 -2
- package/out/middlewares/ui-module.js +1 -1
- package/out/modules/about.js +2 -3
- package/out/modules/ai-prompt-provider/handlers/compile.d.ts +1 -2
- package/out/modules/ai-prompt-provider/handlers/compile.js +1 -1
- package/out/modules/ai-prompt-provider/index.js +1 -2
- package/out/modules/ai-prompt-provider/types.js +1 -1
- package/out/modules/ai-provider/handlers/chat-completions.d.ts +1 -2
- package/out/modules/ai-provider/handlers/chat-completions.js +2 -2
- package/out/modules/ai-provider/handlers/get-model-list.d.ts +1 -2
- package/out/modules/ai-provider/handlers/get-model-list.js +1 -1
- package/out/modules/ai-provider/index.js +1 -2
- package/out/modules/ai-provider/util/index.js +6 -6
- package/out/modules/ai-request-processors/handler.d.ts +1 -2
- package/out/modules/ai-request-processors/handler.js +1 -1
- package/out/modules/ai-request-processors/index.js +5 -5
- package/out/modules/ai-tools/handlers/tool-calls.d.ts +1 -2
- package/out/modules/ai-tools/handlers/tool-calls.js +1 -1
- package/out/modules/ai-tools/index.js +2 -3
- package/out/modules/ai-tools/util/index.js +4 -5
- package/out/modules/api/api.js +4 -5
- package/out/modules/api/index.js +1 -2
- package/out/modules/api/types.js +1 -1
- package/out/modules/auth-guard/handlers/verify.d.ts +1 -2
- package/out/modules/auth-guard/handlers/verify.js +1 -1
- package/out/modules/auth-guard/index.js +1 -2
- package/out/modules/automation-action/handlers/execute.d.ts +1 -2
- package/out/modules/automation-action/handlers/execute.js +1 -1
- package/out/modules/automation-action/handlers/input-schema.d.ts +1 -2
- package/out/modules/automation-action/handlers/input-schema.js +1 -1
- package/out/modules/automation-action/handlers/output-schema.d.ts +1 -2
- package/out/modules/automation-action/handlers/output-schema.js +1 -1
- package/out/modules/automation-action/handlers/validate-settings.d.ts +1 -2
- package/out/modules/automation-action/handlers/validate-settings.js +1 -1
- package/out/modules/automation-action/index.js +1 -2
- package/out/modules/automation-action/util/index.js +2 -3
- package/out/modules/automation-action/util/validate-input.js +1 -2
- package/out/modules/context-menu/index.js +1 -2
- package/out/modules/context-menu/types.js +2 -2
- package/out/modules/custom-mt/handlers/translate.d.ts +1 -2
- package/out/modules/custom-mt/handlers/translate.js +1 -1
- package/out/modules/custom-mt/index.js +1 -2
- package/out/modules/custom-mt/types.d.ts +0 -2
- package/out/modules/custom-spell-check/handlers/get-languages-list.d.ts +1 -2
- package/out/modules/custom-spell-check/handlers/get-languages-list.js +1 -1
- package/out/modules/custom-spell-check/handlers/spell-check.d.ts +1 -2
- package/out/modules/custom-spell-check/handlers/spell-check.js +1 -1
- package/out/modules/custom-spell-check/index.js +1 -2
- package/out/modules/editor-right-panel/index.js +1 -2
- package/out/modules/external-qa-check/handlers/validate.d.ts +1 -2
- package/out/modules/external-qa-check/handlers/validate.js +1 -1
- package/out/modules/external-qa-check/index.js +1 -2
- package/out/modules/file-processing/handlers/custom-file-format.d.ts +1 -2
- package/out/modules/file-processing/handlers/custom-file-format.js +9 -9
- package/out/modules/file-processing/handlers/file-download.d.ts +1 -2
- package/out/modules/file-processing/handlers/file-download.js +1 -1
- package/out/modules/file-processing/handlers/pre-post-process.d.ts +1 -2
- package/out/modules/file-processing/handlers/pre-post-process.js +1 -1
- package/out/modules/file-processing/handlers/translations-alignment.d.ts +1 -2
- package/out/modules/file-processing/handlers/translations-alignment.js +1 -1
- package/out/modules/file-processing/index.js +6 -7
- package/out/modules/file-processing/types.d.ts +0 -2
- package/out/modules/file-processing/types.js +1 -1
- package/out/modules/file-processing/util/defaults.js +18 -9
- package/out/modules/file-processing/util/files.d.ts +0 -2
- package/out/modules/file-processing/util/files.js +4 -4
- package/out/modules/form-data-display.d.ts +1 -2
- package/out/modules/form-data-display.js +18 -8
- package/out/modules/form-data-save.d.ts +1 -2
- package/out/modules/form-data-save.js +18 -8
- package/out/modules/install.d.ts +1 -2
- package/out/modules/install.js +2 -2
- package/out/modules/integration/handlers/crowdin-file-progress.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-file-progress.js +1 -1
- package/out/modules/integration/handlers/crowdin-files-target-languages.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-files-target-languages.js +1 -1
- package/out/modules/integration/handlers/crowdin-files.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-files.js +1 -1
- package/out/modules/integration/handlers/crowdin-project.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-project.js +1 -1
- package/out/modules/integration/handlers/crowdin-update.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-update.js +1 -1
- package/out/modules/integration/handlers/crowdin-webhook.d.ts +1 -2
- package/out/modules/integration/handlers/crowdin-webhook.js +2 -2
- package/out/modules/integration/handlers/integration-data.d.ts +1 -2
- package/out/modules/integration/handlers/integration-data.js +1 -1
- package/out/modules/integration/handlers/integration-login.d.ts +1 -2
- package/out/modules/integration/handlers/integration-login.js +1 -1
- package/out/modules/integration/handlers/integration-logout.d.ts +1 -2
- package/out/modules/integration/handlers/integration-logout.js +18 -8
- package/out/modules/integration/handlers/integration-update.d.ts +1 -2
- package/out/modules/integration/handlers/integration-update.js +1 -1
- package/out/modules/integration/handlers/integration-webhook.d.ts +1 -2
- package/out/modules/integration/handlers/integration-webhook.js +1 -1
- package/out/modules/integration/handlers/invite-users.d.ts +1 -2
- package/out/modules/integration/handlers/invite-users.js +1 -1
- package/out/modules/integration/handlers/job-cancel.d.ts +1 -2
- package/out/modules/integration/handlers/job-cancel.js +1 -1
- package/out/modules/integration/handlers/job-info-deprecated.d.ts +1 -2
- package/out/modules/integration/handlers/job-info-deprecated.js +1 -1
- package/out/modules/integration/handlers/job-info.d.ts +1 -2
- package/out/modules/integration/handlers/job-info.js +1 -1
- package/out/modules/integration/handlers/job-list.d.ts +1 -2
- package/out/modules/integration/handlers/job-list.js +1 -1
- package/out/modules/integration/handlers/main.d.ts +1 -2
- package/out/modules/integration/handlers/main.js +1 -1
- package/out/modules/integration/handlers/oauth-login.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-login.js +1 -1
- package/out/modules/integration/handlers/oauth-polling.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-polling.js +1 -1
- package/out/modules/integration/handlers/oauth-url.d.ts +1 -2
- package/out/modules/integration/handlers/oauth-url.js +1 -1
- package/out/modules/integration/handlers/settings-save.d.ts +1 -2
- package/out/modules/integration/handlers/settings-save.js +1 -1
- package/out/modules/integration/handlers/settings.d.ts +1 -2
- package/out/modules/integration/handlers/settings.js +1 -1
- package/out/modules/integration/handlers/subscription-info.js +1 -1
- package/out/modules/integration/handlers/sync-settings-save.d.ts +1 -2
- package/out/modules/integration/handlers/sync-settings-save.js +1 -1
- package/out/modules/integration/handlers/sync-settings.d.ts +1 -2
- package/out/modules/integration/handlers/sync-settings.js +1 -1
- package/out/modules/integration/handlers/user-errors.d.ts +1 -2
- package/out/modules/integration/handlers/user-errors.js +1 -1
- package/out/modules/integration/handlers/users.d.ts +1 -2
- package/out/modules/integration/handlers/users.js +4 -5
- package/out/modules/integration/index.js +1 -2
- package/out/modules/integration/types.js +4 -4
- package/out/modules/integration/util/cron.js +46 -37
- package/out/modules/integration/util/defaults.js +33 -24
- package/out/modules/integration/util/files.js +29 -30
- package/out/modules/integration/util/job.js +29 -20
- package/out/modules/integration/util/snapshot.js +7 -8
- package/out/modules/integration/util/types.js +3 -3
- package/out/modules/integration/util/webhooks.js +54 -44
- package/out/modules/manifest.js +1 -1
- package/out/modules/modal/index.js +1 -2
- package/out/modules/organization-menu/index.js +1 -2
- package/out/modules/organization-settings-menu/index.js +1 -2
- package/out/modules/profile-resources-menu/index.js +1 -2
- package/out/modules/profile-settings-menu/index.js +1 -2
- package/out/modules/project-menu/index.js +1 -2
- package/out/modules/project-menu-crowdsource/index.js +1 -2
- package/out/modules/project-reports/index.js +1 -2
- package/out/modules/project-tools/index.js +1 -2
- package/out/modules/status.d.ts +1 -2
- package/out/modules/status.js +1 -1
- package/out/modules/subscription-paid.d.ts +1 -2
- package/out/modules/subscription-paid.js +1 -1
- package/out/modules/uninstall.d.ts +1 -2
- package/out/modules/uninstall.js +1 -1
- package/out/modules/webhooks/handlers/webhook-handler.d.ts +1 -2
- package/out/modules/webhooks/handlers/webhook-handler.js +18 -9
- package/out/modules/webhooks/index.js +1 -2
- package/out/modules/workflow-step-type/handlers/delete-step.d.ts +1 -2
- package/out/modules/workflow-step-type/handlers/delete-step.js +18 -8
- package/out/modules/workflow-step-type/handlers/step-settings-save.d.ts +1 -2
- package/out/modules/workflow-step-type/handlers/step-settings-save.js +18 -8
- package/out/modules/workflow-step-type/index.js +1 -2
- package/out/modules/workflow-step-type/types.js +1 -1
- package/out/modules/workflow-step-type/util/index.js +2 -3
- package/out/static/ui/error.bundle.js +446 -379
- package/out/static/ui/error.bundle.js.map +1 -1
- package/out/static/ui/form.bundle.js +29793 -29989
- package/out/static/ui/form.bundle.js.map +1 -1
- package/out/static/ui/install.bundle.js +446 -379
- package/out/static/ui/install.bundle.js.map +1 -1
- package/out/static/ui/login.bundle.js +448 -379
- package/out/static/ui/login.bundle.js.map +1 -1
- package/out/static/ui/main.bundle.js +448 -379
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/static/ui/oauth.bundle.js +448 -379
- package/out/static/ui/oauth.bundle.js.map +1 -1
- package/out/storage/d1.js +9 -9
- package/out/storage/index.js +24 -10
- package/out/storage/mysql.js +31 -31
- package/out/storage/postgre.js +31 -31
- package/out/storage/sqlite.js +8 -8
- package/out/types.d.ts +0 -2
- package/out/types.js +8 -8
- package/out/util/connection.js +34 -25
- package/out/util/credentials-masker.d.ts +1 -2
- package/out/util/credentials-masker.js +3 -4
- package/out/util/cron.js +20 -10
- package/out/util/form-schema.js +2 -3
- package/out/util/index.js +38 -28
- package/out/util/jsx-renderer.js +2 -3
- package/out/util/logger.js +41 -31
- package/out/util/static-files.d.ts +0 -1
- package/out/util/static-files.js +2 -3
- package/out/util/subscription.js +11 -12
- package/out/views/FormPage.js +3 -3
- package/package.json +28 -33
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
12
13
|
const util_1 = require("../../util");
|
|
13
14
|
const logger_1 = require("../../util/logger");
|
|
14
15
|
const BUFFERING_FLAG = '~buffering~';
|
|
@@ -70,4 +71,3 @@ function handle(module, canHandleStream = false) {
|
|
|
70
71
|
}
|
|
71
72
|
}));
|
|
72
73
|
}
|
|
73
|
-
exports.default = handle;
|
|
@@ -3,27 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.AiRequestProcessorModuleWithoutStream = exports.AiRequestProcessorModuleWithStream = void 0;
|
|
7
|
+
exports.generateModuleSlugFromType = generateModuleSlugFromType;
|
|
8
|
+
exports.register = register;
|
|
7
9
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
8
10
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
9
11
|
const handler_1 = __importDefault(require("./handler"));
|
|
10
12
|
var AiRequestProcessorModuleWithStream;
|
|
11
13
|
(function (AiRequestProcessorModuleWithStream) {
|
|
12
14
|
AiRequestProcessorModuleWithStream["aiRequestPreParse"] = "aiRequestPreParse";
|
|
13
|
-
})(AiRequestProcessorModuleWithStream
|
|
15
|
+
})(AiRequestProcessorModuleWithStream || (exports.AiRequestProcessorModuleWithStream = AiRequestProcessorModuleWithStream = {}));
|
|
14
16
|
var AiRequestProcessorModuleWithoutStream;
|
|
15
17
|
(function (AiRequestProcessorModuleWithoutStream) {
|
|
16
18
|
AiRequestProcessorModuleWithoutStream["aiRequestPreCompile"] = "aiRequestPreCompile";
|
|
17
19
|
AiRequestProcessorModuleWithoutStream["aiRequestPostCompile"] = "aiRequestPostCompile";
|
|
18
20
|
AiRequestProcessorModuleWithoutStream["aiRequestPostParse"] = "aiRequestPostParse";
|
|
19
|
-
})(AiRequestProcessorModuleWithoutStream
|
|
21
|
+
})(AiRequestProcessorModuleWithoutStream || (exports.AiRequestProcessorModuleWithoutStream = AiRequestProcessorModuleWithoutStream = {}));
|
|
20
22
|
function generateModuleSlugFromType(moduleType) {
|
|
21
23
|
return moduleType
|
|
22
24
|
.split(/\.?(?=[A-Z])/)
|
|
23
25
|
.join('-')
|
|
24
26
|
.toLowerCase();
|
|
25
27
|
}
|
|
26
|
-
exports.generateModuleSlugFromType = generateModuleSlugFromType;
|
|
27
28
|
function registerProcessorModuleByTypeKey(moduleKey, { config, app }) {
|
|
28
29
|
const module = config[moduleKey];
|
|
29
30
|
if (!module) {
|
|
@@ -42,4 +43,3 @@ function register({ config, app }) {
|
|
|
42
43
|
...Object.values(AiRequestProcessorModuleWithStream),
|
|
43
44
|
].forEach((moduleTypeKey) => registerProcessorModuleByTypeKey(moduleTypeKey, { config, app }));
|
|
44
45
|
}
|
|
45
|
-
exports.register = register;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { AiTool } from '../types';
|
|
5
|
-
export default function handle(aiTool: AiTool): (req: import("express").Request
|
|
4
|
+
export default function handle(aiTool: AiTool): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
const logger_1 = require("../../../util/logger");
|
|
14
15
|
function handle(aiTool) {
|
|
@@ -49,4 +50,3 @@ function handle(aiTool) {
|
|
|
49
50
|
}
|
|
50
51
|
}));
|
|
51
52
|
}
|
|
52
|
-
exports.default = handle;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.registerAiTools = registerAiTools;
|
|
7
|
+
exports.registerAiToolWidgets = registerAiToolWidgets;
|
|
7
8
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
8
9
|
const tool_calls_1 = __importDefault(require("./handlers/tool-calls"));
|
|
9
10
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
@@ -29,7 +30,6 @@ function registerAiTools({ config, app }) {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
exports.registerAiTools = registerAiTools;
|
|
33
33
|
function registerAiToolWidgets({ config, app }) {
|
|
34
34
|
if (!config.aiToolsWidget) {
|
|
35
35
|
return;
|
|
@@ -44,4 +44,3 @@ function registerAiToolWidgets({ config, app }) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.registerAiToolWidgets = registerAiToolWidgets;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isUniqueFunctionName = isUniqueFunctionName;
|
|
4
|
+
exports.getAiToolName = getAiToolName;
|
|
5
|
+
exports.getAiToolUrl = getAiToolUrl;
|
|
6
|
+
exports.getAiToolWidgetUrl = getAiToolWidgetUrl;
|
|
4
7
|
const uniqueNames = [];
|
|
5
8
|
function isUniqueFunctionName(tool) {
|
|
6
9
|
if (uniqueNames.includes(tool.function.name)) {
|
|
@@ -9,17 +12,13 @@ function isUniqueFunctionName(tool) {
|
|
|
9
12
|
uniqueNames.push(tool.function.name);
|
|
10
13
|
return true;
|
|
11
14
|
}
|
|
12
|
-
exports.isUniqueFunctionName = isUniqueFunctionName;
|
|
13
15
|
function getAiToolName(tool) {
|
|
14
16
|
return tool.function.name;
|
|
15
17
|
}
|
|
16
|
-
exports.getAiToolName = getAiToolName;
|
|
17
18
|
function getAiToolUrl(tool) {
|
|
18
19
|
return `/ai-tools/${getAiToolName(tool)}`;
|
|
19
20
|
}
|
|
20
|
-
exports.getAiToolUrl = getAiToolUrl;
|
|
21
21
|
function getAiToolWidgetUrl(tool, isFull = false) {
|
|
22
22
|
const suffix = isFull ? `/${tool.fileName || 'index.html'}` : '';
|
|
23
23
|
return `/ai-tools-widget/${getAiToolName(tool)}${suffix}`;
|
|
24
24
|
}
|
|
25
|
-
exports.getAiToolWidgetUrl = getAiToolWidgetUrl;
|
package/out/modules/api/api.js
CHANGED
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getApiManifest = getApiManifest;
|
|
7
|
+
exports.updateCrowdinContext = updateCrowdinContext;
|
|
8
|
+
exports.addDefaultApiEndpoints = addDefaultApiEndpoints;
|
|
9
|
+
exports.addSwagerApiDocumentation = addSwagerApiDocumentation;
|
|
7
10
|
const path_1 = __importDefault(require("path"));
|
|
8
11
|
const swagger_jsdoc_1 = __importDefault(require("swagger-jsdoc"));
|
|
9
12
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
@@ -38,7 +41,6 @@ function getApiManifest(config, apiModule) {
|
|
|
38
41
|
}
|
|
39
42
|
return apiModuleManifest;
|
|
40
43
|
}
|
|
41
|
-
exports.getApiManifest = getApiManifest;
|
|
42
44
|
function generateModuleKey(moduleName) {
|
|
43
45
|
return moduleName.toLowerCase().split(' ').join('-') + '-api';
|
|
44
46
|
}
|
|
@@ -168,7 +170,6 @@ function updateCrowdinContext(req, context) {
|
|
|
168
170
|
}
|
|
169
171
|
return context;
|
|
170
172
|
}
|
|
171
|
-
exports.updateCrowdinContext = updateCrowdinContext;
|
|
172
173
|
function getFormFields(fields) {
|
|
173
174
|
const formFields = [];
|
|
174
175
|
for (const field of fields) {
|
|
@@ -649,7 +650,6 @@ function addDefaultApiEndpoints(app, config) {
|
|
|
649
650
|
}
|
|
650
651
|
}
|
|
651
652
|
}
|
|
652
|
-
exports.addDefaultApiEndpoints = addDefaultApiEndpoints;
|
|
653
653
|
function addSwagerApiDocumentation(app, config) {
|
|
654
654
|
var _a, _b, _c;
|
|
655
655
|
const options = {
|
|
@@ -711,4 +711,3 @@ function addSwagerApiDocumentation(app, config) {
|
|
|
711
711
|
app.get('/api-docs/swagger.json', (req, res) => res.send(swaggerSpec));
|
|
712
712
|
app.use('/api-docs', (req, res) => res.send((0, redoc_html_template_1.default)({ title: `${config.name} Application API`, specUrl: '/api-docs/swagger.json' })));
|
|
713
713
|
}
|
|
714
|
-
exports.addSwagerApiDocumentation = addSwagerApiDocumentation;
|
package/out/modules/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.register =
|
|
3
|
+
exports.register = register;
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
function register({ config, app }) {
|
|
6
6
|
if (!config.api) {
|
|
@@ -11,4 +11,3 @@ function register({ config, app }) {
|
|
|
11
11
|
}
|
|
12
12
|
(0, api_1.addSwagerApiDocumentation)(app, config);
|
|
13
13
|
}
|
|
14
|
-
exports.register = register;
|
package/out/modules/api/types.js
CHANGED
|
@@ -8,4 +8,4 @@ var RequestMethods;
|
|
|
8
8
|
RequestMethods["PUT"] = "PUT";
|
|
9
9
|
RequestMethods["PATCH"] = "PATCH";
|
|
10
10
|
RequestMethods["DELETE"] = "DELETE";
|
|
11
|
-
})(RequestMethods
|
|
11
|
+
})(RequestMethods || (exports.RequestMethods = RequestMethods = {}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { AuthGuardModule } from '../types';
|
|
5
|
-
export default function verifyHandler(authGuardModules: AuthGuardModule[]): (req: import("express").Request
|
|
4
|
+
export default function verifyHandler(authGuardModules: AuthGuardModule[]): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = verifyHandler;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
function verifyHandler(authGuardModules) {
|
|
14
15
|
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -54,4 +55,3 @@ function verifyHandler(authGuardModules) {
|
|
|
54
55
|
}
|
|
55
56
|
}));
|
|
56
57
|
}
|
|
57
|
-
exports.default = verifyHandler;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
8
8
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
9
9
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
@@ -33,4 +33,3 @@ function register({ config, app }) {
|
|
|
33
33
|
moduleKey: authGuardModules.map((m, i) => m.key || `${config.identifier}-auth-guard-${i}`),
|
|
34
34
|
}), (0, verify_1.default)(authGuardModules));
|
|
35
35
|
}
|
|
36
|
-
exports.register = register;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { AutomationActionModule } from '../types';
|
|
5
|
-
export default function getExecuteHandler(automationAction: AutomationActionModule): (req: import("express").Request
|
|
4
|
+
export default function getExecuteHandler(automationAction: AutomationActionModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = getExecuteHandler;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
const logger_1 = require("../../../util/logger");
|
|
14
15
|
const validate_input_1 = require("../util/validate-input");
|
|
@@ -75,4 +76,3 @@ function getExecuteHandler(automationAction) {
|
|
|
75
76
|
}
|
|
76
77
|
}));
|
|
77
78
|
}
|
|
78
|
-
exports.default = getExecuteHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { AutomationActionModule } from '../types';
|
|
4
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
5
|
-
export default function getInputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request
|
|
4
|
+
export default function getInputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = getInputSchemaHandler;
|
|
12
13
|
const logger_1 = require("../../../util/logger");
|
|
13
14
|
const util_1 = require("../../../util");
|
|
14
15
|
function getInputSchemaHandler(automationAction) {
|
|
@@ -26,4 +27,3 @@ function getInputSchemaHandler(automationAction) {
|
|
|
26
27
|
}
|
|
27
28
|
}));
|
|
28
29
|
}
|
|
29
|
-
exports.default = getInputSchemaHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { AutomationActionModule } from '../types';
|
|
4
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
5
|
-
export default function getOutputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request
|
|
4
|
+
export default function getOutputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = getOutputSchemaHandler;
|
|
12
13
|
const logger_1 = require("../../../util/logger");
|
|
13
14
|
const util_1 = require("../../../util");
|
|
14
15
|
function getOutputSchemaHandler(automationAction) {
|
|
@@ -26,4 +27,3 @@ function getOutputSchemaHandler(automationAction) {
|
|
|
26
27
|
}
|
|
27
28
|
}));
|
|
28
29
|
}
|
|
29
|
-
exports.default = getOutputSchemaHandler;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { AutomationActionModule } from '../types';
|
|
4
3
|
import { CrowdinClientRequest } from '../../../types';
|
|
5
|
-
export default function getInputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request
|
|
4
|
+
export default function getInputSchemaHandler(automationAction: AutomationActionModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = getInputSchemaHandler;
|
|
12
13
|
const logger_1 = require("../../../util/logger");
|
|
13
14
|
const util_1 = require("../../../util");
|
|
14
15
|
function getInputSchemaHandler(automationAction) {
|
|
@@ -32,4 +33,3 @@ function getInputSchemaHandler(automationAction) {
|
|
|
32
33
|
}
|
|
33
34
|
}));
|
|
34
35
|
}
|
|
35
|
-
exports.default = getInputSchemaHandler;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const cors_1 = __importDefault(require("cors"));
|
|
8
8
|
const output_schema_1 = __importDefault(require("./handlers/output-schema"));
|
|
9
9
|
const input_schema_1 = __importDefault(require("./handlers/input-schema"));
|
|
@@ -42,4 +42,3 @@ function register({ config, app }) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
exports.register = register;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAutomationActionKey = getAutomationActionKey;
|
|
4
|
+
exports.getAutomationActionUrl = getAutomationActionUrl;
|
|
4
5
|
const util_1 = require("../../../util");
|
|
5
6
|
function getAutomationActionKey(automationAction) {
|
|
6
7
|
return (0, util_1.kebabCase)(automationAction.name);
|
|
7
8
|
}
|
|
8
|
-
exports.getAutomationActionKey = getAutomationActionKey;
|
|
9
9
|
function getAutomationActionUrl(path, automationAction) {
|
|
10
10
|
return `${path}/${automationAction.key}`;
|
|
11
11
|
}
|
|
12
|
-
exports.getAutomationActionUrl = getAutomationActionUrl;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateAutomationData =
|
|
6
|
+
exports.validateAutomationData = validateAutomationData;
|
|
7
7
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
8
|
const ajv = new ajv_1.default({ allErrors: true, strict: false, coerceTypes: true });
|
|
9
9
|
function formatAjvErrors(errors = []) {
|
|
@@ -57,4 +57,3 @@ function validateAutomationData({ data, schema, preserveEmptyArrays = false, })
|
|
|
57
57
|
data: cleaned,
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
exports.validateAutomationData = validateAutomationData;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
@@ -27,4 +27,3 @@ function register({ config, app }) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.register = register;
|
|
@@ -9,10 +9,10 @@ var ContextOptionsLocations;
|
|
|
9
9
|
ContextOptionsLocations["SCREENSHOT"] = "screenshot";
|
|
10
10
|
ContextOptionsLocations["SOURCE_FILE"] = "source_file";
|
|
11
11
|
ContextOptionsLocations["TRANSLATED_FILE"] = "translated_file";
|
|
12
|
-
})(ContextOptionsLocations
|
|
12
|
+
})(ContextOptionsLocations || (exports.ContextOptionsLocations = ContextOptionsLocations = {}));
|
|
13
13
|
var ContextOptionsTypes;
|
|
14
14
|
(function (ContextOptionsTypes) {
|
|
15
15
|
ContextOptionsTypes["MODAL"] = "modal";
|
|
16
16
|
ContextOptionsTypes["NEW_TAB"] = "new_tab";
|
|
17
17
|
ContextOptionsTypes["REDIRECT"] = "redirect";
|
|
18
|
-
})(ContextOptionsTypes
|
|
18
|
+
})(ContextOptionsTypes || (exports.ContextOptionsTypes = ContextOptionsTypes = {}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { CustomMTHandleOptions } from '../types';
|
|
5
|
-
export default function handle({ baseUrl, folder, config, fileStore }: CustomMTHandleOptions): (req: import("express").Request
|
|
4
|
+
export default function handle({ baseUrl, folder, config, fileStore }: CustomMTHandleOptions): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -12,6 +12,7 @@ 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.default = handle;
|
|
15
16
|
const fs_1 = __importDefault(require("fs"));
|
|
16
17
|
const path_1 = __importDefault(require("path"));
|
|
17
18
|
const util_1 = require("../../../util");
|
|
@@ -97,4 +98,3 @@ function handle({ baseUrl, folder, config, fileStore }) {
|
|
|
97
98
|
}
|
|
98
99
|
}));
|
|
99
100
|
}
|
|
100
|
-
exports.default = handle;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
8
8
|
const util_1 = require("../../util");
|
|
9
9
|
const file_download_1 = __importDefault(require("../file-processing/handlers/file-download"));
|
|
@@ -29,4 +29,3 @@ function register({ config, app }) {
|
|
|
29
29
|
}), (0, translate_1.default)({ baseUrl: config.baseUrl, folder, config: config.customMT, fileStore: config.fileStore }));
|
|
30
30
|
// END TEMPORARY CODE
|
|
31
31
|
}
|
|
32
|
-
exports.register = register;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { CustomSpellcheckerModule } from '../types';
|
|
5
|
-
export default function handle(customSpellchecker: CustomSpellcheckerModule): (req: import("express").Request
|
|
4
|
+
export default function handle(customSpellchecker: CustomSpellcheckerModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
const logger_1 = require("../../../util/logger");
|
|
14
15
|
function handle(customSpellchecker) {
|
|
@@ -28,4 +29,3 @@ function handle(customSpellchecker) {
|
|
|
28
29
|
}
|
|
29
30
|
}));
|
|
30
31
|
}
|
|
31
|
-
exports.default = handle;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { CustomSpellcheckerModule } from '../types';
|
|
5
|
-
export default function handle(customSpellchecker: CustomSpellcheckerModule): (req: import("express").Request
|
|
4
|
+
export default function handle(customSpellchecker: CustomSpellcheckerModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
const logger_1 = require("../../../util/logger");
|
|
14
15
|
function handle(customSpellchecker) {
|
|
@@ -33,4 +34,3 @@ function handle(customSpellchecker) {
|
|
|
33
34
|
}
|
|
34
35
|
}));
|
|
35
36
|
}
|
|
36
|
-
exports.default = handle;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
8
8
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
9
9
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
@@ -61,4 +61,3 @@ function register({ config, app }) {
|
|
|
61
61
|
app.post('/spellcheck', json_response_1.default, (0, spell_check_1.default)(config.customSpellchecker));
|
|
62
62
|
// END TEMPORARY CODE
|
|
63
63
|
}
|
|
64
|
-
exports.register = register;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const util_1 = require("../../util");
|
|
@@ -14,4 +14,3 @@ function register({ config, app }) {
|
|
|
14
14
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
15
|
app.use('/editor-panels', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.editorRightPanel.key }), (0, render_ui_module_1.default)(config.editorRightPanel, config));
|
|
16
16
|
}
|
|
17
|
-
exports.register = register;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest } from '../../../types';
|
|
4
3
|
import { ExternalQaCheckModule } from '../types';
|
|
5
|
-
export default function handle(externalQaCheck: ExternalQaCheckModule): (req: import("express").Request
|
|
4
|
+
export default function handle(externalQaCheck: ExternalQaCheckModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
12
13
|
const util_1 = require("../../../util");
|
|
13
14
|
const logger_1 = require("../../../util/logger");
|
|
14
15
|
function handle(externalQaCheck) {
|
|
@@ -40,4 +41,3 @@ function handle(externalQaCheck) {
|
|
|
40
41
|
}
|
|
41
42
|
}));
|
|
42
43
|
}
|
|
43
|
-
exports.default = handle;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.register =
|
|
6
|
+
exports.register = register;
|
|
7
7
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
8
8
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
9
9
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
@@ -44,4 +44,3 @@ function register({ config, app }) {
|
|
|
44
44
|
// END TEMPORARY CODE
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.register = register;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Response } from 'express';
|
|
3
2
|
import { CrowdinClientRequest, FileStore } from '../../../types';
|
|
4
3
|
import { CustomFileFormatLogic } from '../types';
|
|
@@ -7,4 +6,4 @@ export default function handle({ baseUrl, folder, config, fileStore, }: {
|
|
|
7
6
|
folder: string;
|
|
8
7
|
config: CustomFileFormatLogic;
|
|
9
8
|
fileStore?: FileStore;
|
|
10
|
-
}): (req: import("express").Request
|
|
9
|
+
}): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -12,6 +12,7 @@ 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.default = handle;
|
|
15
16
|
const fs_1 = __importDefault(require("fs"));
|
|
16
17
|
const path_1 = __importDefault(require("path"));
|
|
17
18
|
const util_1 = require("../../../util");
|
|
@@ -80,9 +81,8 @@ function handle({ baseUrl, folder, config, fileStore, }) {
|
|
|
80
81
|
res.send({ data: response, error: error ? { message: error } : undefined });
|
|
81
82
|
}));
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
function
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
function handleBuildFile(_a) {
|
|
85
|
+
return __awaiter(this, arguments, void 0, function* ({ baseUrl, dataFolder, config, req, client, context, projectId, file, fileStore, }) {
|
|
86
86
|
const response = {};
|
|
87
87
|
if (!req.strings && !req.stringsUrl) {
|
|
88
88
|
throw new Error('Bad payload received: No strings found');
|
|
@@ -95,12 +95,12 @@ function handleBuildFile({ baseUrl, dataFolder, config, req, client, context, pr
|
|
|
95
95
|
strings = yield (0, files_1.getFileStrings)(req.stringsUrl);
|
|
96
96
|
}
|
|
97
97
|
let res;
|
|
98
|
-
if (
|
|
99
|
-
res = yield config.exportStrings({ request: req, strings, client, context, projectId });
|
|
100
|
-
}
|
|
101
|
-
else if (file && config.buildFile) {
|
|
98
|
+
if (file && config.buildFile) {
|
|
102
99
|
res = yield config.buildFile({ fileContent: file, request: req, strings, client, context, projectId });
|
|
103
100
|
}
|
|
101
|
+
else if (config.exportStrings) {
|
|
102
|
+
res = yield config.exportStrings({ request: req, strings, client, context, projectId });
|
|
103
|
+
}
|
|
104
104
|
else {
|
|
105
105
|
return { response };
|
|
106
106
|
}
|
|
@@ -128,8 +128,8 @@ function handleBuildFile({ baseUrl, dataFolder, config, req, client, context, pr
|
|
|
128
128
|
return { response, error: res.error };
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
function handleParseFile(
|
|
132
|
-
return __awaiter(this,
|
|
131
|
+
function handleParseFile(_a) {
|
|
132
|
+
return __awaiter(this, arguments, void 0, function* ({ baseUrl, dataFolder, config, req, client, context, projectId, file, fileStore, }) {
|
|
133
133
|
const response = {};
|
|
134
134
|
if (!config.parseFile || !file) {
|
|
135
135
|
return { response };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="qs" />
|
|
2
1
|
import { Request, Response } from 'express';
|
|
3
2
|
import { Config } from '../../../types';
|
|
4
3
|
import { FileProcessLogic } from '../types';
|
|
5
|
-
export default function handle(config: Config, processingConfig: FileProcessLogic, folderName: string): (req: Request
|
|
4
|
+
export default function handle(config: Config, processingConfig: FileProcessLogic, folderName: string): (req: Request | import("../../../types").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -12,6 +12,7 @@ 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.default = handle;
|
|
15
16
|
const fs_1 = __importDefault(require("fs"));
|
|
16
17
|
const path_1 = __importDefault(require("path"));
|
|
17
18
|
const util_1 = require("../../../util");
|
|
@@ -36,4 +37,3 @@ function handle(config, processingConfig, folderName) {
|
|
|
36
37
|
});
|
|
37
38
|
}));
|
|
38
39
|
}
|
|
39
|
-
exports.default = handle;
|