@crowdin/app-project-module 0.98.0-cf-16 → 0.98.0-cf-18
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.js +2 -1
- package/out/modules/about.js +1 -1
- package/out/modules/ai-prompt-provider/index.js +1 -3
- package/out/modules/ai-provider/index.js +1 -3
- package/out/modules/custom-mt/index.js +1 -3
- package/out/modules/file-processing/util/defaults.js +50 -6
- package/out/modules/integration/index.js +2 -2
- package/out/modules/manifest.js +12 -12
- package/out/modules/organization-menu/index.js +3 -4
- package/out/modules/organization-settings-menu/index.js +3 -4
- package/out/modules/profile-resources-menu/index.js +3 -4
- package/out/modules/profile-settings-menu/index.js +3 -4
- package/out/modules/project-reports/index.js +2 -3
- package/out/modules/project-tools/index.js +2 -3
- package/out/modules/workflow-step-type/index.js +1 -2
- package/out/static/js/form.js +33 -33
- package/out/util/index.d.ts +9 -1
- package/out/util/index.js +37 -5
- package/package.json +15 -3
package/out/index.js
CHANGED
|
@@ -65,6 +65,7 @@ Object.defineProperty(exports, "getRequestCredentialsMasker", { enumerable: true
|
|
|
65
65
|
Object.defineProperty(exports, "postRequestCredentialsMasker", { enumerable: true, get: function () { return credentials_masker_1.postRequestCredentialsMasker; } });
|
|
66
66
|
Object.defineProperty(exports, "maskKey", { enumerable: true, get: function () { return credentials_masker_1.maskKey; } });
|
|
67
67
|
const static_files_1 = require("./util/static-files");
|
|
68
|
+
const util_2 = require("./util");
|
|
68
69
|
//apps
|
|
69
70
|
const apiApp = __importStar(require("./modules/api"));
|
|
70
71
|
const contextMenuApp = __importStar(require("./modules/context-menu"));
|
|
@@ -175,7 +176,7 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
175
176
|
app.use(logsFormatter.expressMiddleware());
|
|
176
177
|
}
|
|
177
178
|
app.use('/assets', (0, static_files_1.serveStatic)(config, config.assetsPath || 'static'));
|
|
178
|
-
app.
|
|
179
|
+
app.use('/', (0, util_2.serveLogo)(config));
|
|
179
180
|
app.get('/manifest.json', json_response_1.default, (0, manifest_1.default)(config));
|
|
180
181
|
app.get('/', (0, about_1.default)(config));
|
|
181
182
|
if (((_a = config === null || config === void 0 ? void 0 : config.enableStatusPage) === null || _a === void 0 ? void 0 : _a.database) || ((_b = config === null || config === void 0 ? void 0 : config.enableStatusPage) === null || _b === void 0 ? void 0 : _b.filesystem)) {
|
package/out/modules/about.js
CHANGED
|
@@ -32,7 +32,7 @@ function getAboutPageOptions(config) {
|
|
|
32
32
|
}
|
|
33
33
|
return {
|
|
34
34
|
name: config.name,
|
|
35
|
-
logo: (0, util_1.getLogoUrl)(),
|
|
35
|
+
logo: (0, util_1.getLogoUrl)(config),
|
|
36
36
|
manifest: config.baseUrl + '/manifest.json',
|
|
37
37
|
storeLink: (config === null || config === void 0 ? void 0 : config.detailPage) || detailPage,
|
|
38
38
|
showDebugLink: process.env.SHOW_DEBUG_LINK === 'true',
|
|
@@ -8,11 +8,9 @@ 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"));
|
|
10
10
|
const util_1 = require("../../util");
|
|
11
|
-
const static_files_1 = require("../../util/static-files");
|
|
12
11
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
13
12
|
const compile_1 = __importDefault(require("./handlers/compile"));
|
|
14
13
|
function register({ config, app }) {
|
|
15
|
-
var _a;
|
|
16
14
|
if (!config.aiPromptProvider) {
|
|
17
15
|
return;
|
|
18
16
|
}
|
|
@@ -25,6 +23,6 @@ function register({ config, app }) {
|
|
|
25
23
|
if (config.aiPromptProvider.formSchema || config.aiPromptProvider.uiPath) {
|
|
26
24
|
app.use('/prompt-provider/settings', (0, ui_module_1.default)({ config, allowUnauthorized: true, moduleType: config.aiPromptProvider.key }), (0, render_ui_module_1.default)(config.aiPromptProvider, config));
|
|
27
25
|
}
|
|
28
|
-
app.
|
|
26
|
+
app.use('/logo/ai-prompt-provider', (0, util_1.serveLogo)(config, config.aiPromptProvider));
|
|
29
27
|
}
|
|
30
28
|
exports.register = register;
|
|
@@ -10,17 +10,15 @@ const chat_completions_1 = __importDefault(require("./handlers/chat-completions"
|
|
|
10
10
|
const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
|
|
11
11
|
const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
|
|
12
12
|
const util_1 = require("../../util");
|
|
13
|
-
const static_files_1 = require("../../util/static-files");
|
|
14
13
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
15
14
|
function register({ config, app }) {
|
|
16
|
-
var _a;
|
|
17
15
|
if (!config.aiProvider) {
|
|
18
16
|
return;
|
|
19
17
|
}
|
|
20
18
|
if (config.aiProvider.settingsUiModule) {
|
|
21
19
|
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized: true, moduleType: config.aiProvider.key }), (0, render_ui_module_1.default)(config.aiProvider.settingsUiModule, config));
|
|
22
20
|
}
|
|
23
|
-
app.
|
|
21
|
+
app.use('/logo/aiprovider', (0, util_1.serveLogo)(config, config.aiProvider));
|
|
24
22
|
app.get('/ai-provider/models', json_response_1.default, (0, crowdin_client_1.default)({
|
|
25
23
|
config,
|
|
26
24
|
optional: false,
|
|
@@ -6,14 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.register = void 0;
|
|
7
7
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
8
8
|
const util_1 = require("../../util");
|
|
9
|
-
const static_files_1 = require("../../util/static-files");
|
|
10
9
|
const translate_1 = __importDefault(require("./handlers/translate"));
|
|
11
10
|
function register({ config, app }) {
|
|
12
|
-
var _a;
|
|
13
11
|
if (!config.customMT) {
|
|
14
12
|
return;
|
|
15
13
|
}
|
|
16
|
-
app.
|
|
14
|
+
app.use('/logo/mt', (0, util_1.serveLogo)(config, config.customMT));
|
|
17
15
|
app.post('/mt/translate', (0, crowdin_client_1.default)({
|
|
18
16
|
config,
|
|
19
17
|
optional: false,
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,20 +33,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
33
|
};
|
|
11
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
35
|
exports.applyFileProcessorsModuleDefaults = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
36
|
+
function loadAwsSdk() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
const [s3Client, s3Presigner] = yield Promise.all([
|
|
40
|
+
Promise.resolve().then(() => __importStar(require('@aws-sdk/client-s3'))),
|
|
41
|
+
Promise.resolve().then(() => __importStar(require('@aws-sdk/s3-request-presigner'))),
|
|
42
|
+
]);
|
|
43
|
+
return {
|
|
44
|
+
S3Client: s3Client.S3Client,
|
|
45
|
+
GetObjectCommand: s3Client.GetObjectCommand,
|
|
46
|
+
PutObjectCommand: s3Client.PutObjectCommand,
|
|
47
|
+
getSignedUrl: s3Presigner.getSignedUrl,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (_a) {
|
|
51
|
+
throw new Error('AWS SDK is not installed. To use S3 file storage, install required packages:\n' +
|
|
52
|
+
'npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner');
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
15
56
|
function applyFileProcessorsModuleDefaults(config, fileModule) {
|
|
16
57
|
var _a, _b;
|
|
17
58
|
const AWS_TMP_BUCKET_NAME = (_a = config.awsConfig) === null || _a === void 0 ? void 0 : _a.tmpBucketName;
|
|
18
59
|
const AWS_REGION = (_b = config.awsConfig) === null || _b === void 0 ? void 0 : _b.region;
|
|
19
60
|
if (AWS_TMP_BUCKET_NAME && AWS_REGION && !fileModule.storeFile) {
|
|
20
|
-
|
|
61
|
+
let initPromise = null;
|
|
62
|
+
const getS3 = () => (initPromise !== null && initPromise !== void 0 ? initPromise : (initPromise = loadAwsSdk().then(sdk => ({ sdk, s3: new sdk.S3Client({ region: AWS_REGION }) }))));
|
|
21
63
|
fileModule.storeFile = (content) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const { sdk, s3 } = yield getS3();
|
|
65
|
+
const { GetObjectCommand, PutObjectCommand, getSignedUrl } = sdk;
|
|
22
66
|
const fileName = `file-${config.identifier}-${Date.now()}`;
|
|
23
|
-
const command = new
|
|
67
|
+
const command = new PutObjectCommand({ Bucket: AWS_TMP_BUCKET_NAME, Key: fileName, Body: content });
|
|
24
68
|
yield s3.send(command);
|
|
25
|
-
const getObjectCommand = new
|
|
26
|
-
return
|
|
69
|
+
const getObjectCommand = new GetObjectCommand({ Bucket: AWS_TMP_BUCKET_NAME, Key: fileName });
|
|
70
|
+
return getSignedUrl(s3, getObjectCommand, { expiresIn: 3600 });
|
|
27
71
|
});
|
|
28
72
|
}
|
|
29
73
|
}
|
|
@@ -17,7 +17,7 @@ const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-clie
|
|
|
17
17
|
const integration_credentials_1 = __importDefault(require("../../middlewares/integration-credentials"));
|
|
18
18
|
const json_response_1 = __importDefault(require("../../middlewares/json-response"));
|
|
19
19
|
const util_1 = require("../../util");
|
|
20
|
-
const
|
|
20
|
+
const util_2 = require("../../util");
|
|
21
21
|
const cron_1 = require("../../util/cron");
|
|
22
22
|
const defaults_1 = require("./util/defaults");
|
|
23
23
|
const webhooks_1 = require("./util/webhooks");
|
|
@@ -53,7 +53,7 @@ function register({ config, app }) {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
(0, defaults_1.applyIntegrationModuleDefaults)(config, integrationLogic);
|
|
56
|
-
app.
|
|
56
|
+
app.use('/logo/integration', (0, util_2.serveLogo)(config, integrationLogic));
|
|
57
57
|
app.get('/', (0, crowdin_client_1.default)({
|
|
58
58
|
config,
|
|
59
59
|
optional: true,
|
package/out/modules/manifest.js
CHANGED
|
@@ -20,7 +20,7 @@ function handle(config) {
|
|
|
20
20
|
// prevent possible overrides of the other modules
|
|
21
21
|
config.projectIntegration = Object.assign(Object.assign({}, config.projectIntegration), { key: config.identifier + '-int' });
|
|
22
22
|
modules['project-integrations'] = [
|
|
23
|
-
Object.assign({ key: config.projectIntegration.key, name: config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config.projectIntegration, '/integration'), url: '/' }, (!!config.projectIntegration.environments && {
|
|
23
|
+
Object.assign({ key: config.projectIntegration.key, name: config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config, config.projectIntegration, '/integration'), url: '/' }, (!!config.projectIntegration.environments && {
|
|
24
24
|
environments: normalizeEnvironments(config.projectIntegration.environments),
|
|
25
25
|
})),
|
|
26
26
|
];
|
|
@@ -90,7 +90,7 @@ function handle(config) {
|
|
|
90
90
|
// prevent possible overrides of the other modules
|
|
91
91
|
config.customMT = Object.assign(Object.assign({}, config.customMT), { key: config.identifier + '-mt' });
|
|
92
92
|
modules['custom-mt'] = [
|
|
93
|
-
Object.assign(Object.assign(Object.assign({ key: config.customMT.key, name: config.name, logo: (0, util_1.getLogoUrl)(config.customMT, '/mt'), url: '/mt/translate', withContext: !!config.customMT.withContext }, (config.customMT.batchSize !== null && {
|
|
93
|
+
Object.assign(Object.assign(Object.assign({ key: config.customMT.key, name: config.name, logo: (0, util_1.getLogoUrl)(config, config.customMT, '/mt'), url: '/mt/translate', withContext: !!config.customMT.withContext }, (config.customMT.batchSize !== null && {
|
|
94
94
|
batchSize: config.customMT.batchSize,
|
|
95
95
|
})), (config.customMT.maskEntities !== null && {
|
|
96
96
|
maskEntities: config.customMT.maskEntities,
|
|
@@ -107,7 +107,7 @@ function handle(config) {
|
|
|
107
107
|
key: config.organizationMenu.key,
|
|
108
108
|
name: config.organizationMenu.name || config.name,
|
|
109
109
|
url: '/organization-menu/' + (config.organizationMenu.fileName || 'index.html'),
|
|
110
|
-
icon: (0, util_1.getLogoUrl)(config.organizationMenu, '/resources'),
|
|
110
|
+
icon: (0, util_1.getLogoUrl)(config, config.organizationMenu, '/resources'),
|
|
111
111
|
},
|
|
112
112
|
];
|
|
113
113
|
}
|
|
@@ -119,7 +119,7 @@ function handle(config) {
|
|
|
119
119
|
key: config.organizationSettingsMenu.key,
|
|
120
120
|
name: config.organizationSettingsMenu.name || config.name,
|
|
121
121
|
url: '/organization-settings/' + (config.organizationSettingsMenu.fileName || 'index.html'),
|
|
122
|
-
icon: (0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/organization-settings'),
|
|
122
|
+
icon: (0, util_1.getLogoUrl)(config, config.organizationSettingsMenu, '/organization-settings'),
|
|
123
123
|
},
|
|
124
124
|
];
|
|
125
125
|
}
|
|
@@ -127,7 +127,7 @@ function handle(config) {
|
|
|
127
127
|
// prevent possible overrides of the other modules
|
|
128
128
|
config.profileResourcesMenu = Object.assign(Object.assign({}, config.profileResourcesMenu), { key: config.identifier + '-profile-resources-menu' });
|
|
129
129
|
modules['profile-resources-menu'] = [
|
|
130
|
-
Object.assign({ key: config.profileResourcesMenu.key, name: config.profileResourcesMenu.name || config.name, url: '/profile-resources/' + (config.profileResourcesMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileResourcesMenu, '/profile-resources') }, (!!config.profileResourcesMenu.environments && {
|
|
130
|
+
Object.assign({ key: config.profileResourcesMenu.key, name: config.profileResourcesMenu.name || config.name, url: '/profile-resources/' + (config.profileResourcesMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config, config.profileResourcesMenu, '/profile-resources') }, (!!config.profileResourcesMenu.environments && {
|
|
131
131
|
environments: normalizeEnvironments(config.profileResourcesMenu.environments),
|
|
132
132
|
})),
|
|
133
133
|
];
|
|
@@ -136,7 +136,7 @@ function handle(config) {
|
|
|
136
136
|
// prevent possible overrides of the other modules
|
|
137
137
|
config.profileSettingsMenu = Object.assign(Object.assign({}, config.profileSettingsMenu), { key: config.identifier + '-profile-settings-menu' });
|
|
138
138
|
modules['profile-settings-menu'] = [
|
|
139
|
-
Object.assign({ key: config.profileSettingsMenu.key, name: config.profileSettingsMenu.name || config.name, url: '/profile-settings/' + (config.profileSettingsMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileSettingsMenu, '/profile-settings') }, (!!config.profileSettingsMenu.environments && {
|
|
139
|
+
Object.assign({ key: config.profileSettingsMenu.key, name: config.profileSettingsMenu.name || config.name, url: '/profile-settings/' + (config.profileSettingsMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config, config.profileSettingsMenu, '/profile-settings') }, (!!config.profileSettingsMenu.environments && {
|
|
140
140
|
environments: normalizeEnvironments(config.profileSettingsMenu.environments),
|
|
141
141
|
})),
|
|
142
142
|
];
|
|
@@ -174,7 +174,7 @@ function handle(config) {
|
|
|
174
174
|
// prevent possible overrides of the other modules
|
|
175
175
|
config.projectTools = Object.assign(Object.assign({}, config.projectTools), { key: config.identifier + '-tools' });
|
|
176
176
|
modules['project-tools'] = [
|
|
177
|
-
Object.assign({ key: config.projectTools.key, name: config.projectTools.name || config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config.projectTools, '/tools'), url: '/tools/' + (config.projectTools.fileName || 'index.html') }, (!!config.projectTools.environments && {
|
|
177
|
+
Object.assign({ key: config.projectTools.key, name: config.projectTools.name || config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config, config.projectTools, '/tools'), url: '/tools/' + (config.projectTools.fileName || 'index.html') }, (!!config.projectTools.environments && {
|
|
178
178
|
environments: normalizeEnvironments(config.projectTools.environments),
|
|
179
179
|
})),
|
|
180
180
|
];
|
|
@@ -187,7 +187,7 @@ function handle(config) {
|
|
|
187
187
|
key: config.projectReports.key,
|
|
188
188
|
name: config.projectReports.name || config.name,
|
|
189
189
|
description: config.description,
|
|
190
|
-
logo: (0, util_1.getLogoUrl)(config.projectReports, '/reports'),
|
|
190
|
+
logo: (0, util_1.getLogoUrl)(config, config.projectReports, '/reports'),
|
|
191
191
|
url: '/reports/' + (config.projectReports.fileName || 'index.html'),
|
|
192
192
|
},
|
|
193
193
|
];
|
|
@@ -258,7 +258,7 @@ function handle(config) {
|
|
|
258
258
|
config.aiProvider = Object.assign(Object.assign({}, config.aiProvider), { key: config.identifier + '-aiprovider' });
|
|
259
259
|
const uiModule = config.aiProvider.settingsUiModule;
|
|
260
260
|
modules['ai-provider'] = [
|
|
261
|
-
Object.assign(Object.assign({ key: config.aiProvider.key, name: config.aiProvider.name || config.name, description: config.aiProvider.description || config.description, logo: (0, util_1.getLogoUrl)(config.aiProvider, '/aiprovider'), chatCompletionsUrl: '/ai-provider/completions', modelsUrl: '/ai-provider/models' }, (!!config.aiProvider.environments && {
|
|
261
|
+
Object.assign(Object.assign({ key: config.aiProvider.key, name: config.aiProvider.name || config.name, description: config.aiProvider.description || config.description, logo: (0, util_1.getLogoUrl)(config, config.aiProvider, '/aiprovider'), chatCompletionsUrl: '/ai-provider/completions', modelsUrl: '/ai-provider/models' }, (!!config.aiProvider.environments && {
|
|
262
262
|
environments: normalizeEnvironments(config.aiProvider.environments),
|
|
263
263
|
})), (uiModule ? { url: '/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
264
264
|
];
|
|
@@ -283,7 +283,7 @@ function handle(config) {
|
|
|
283
283
|
// prevent possible overrides of the other modules
|
|
284
284
|
config.aiPromptProvider = Object.assign(Object.assign({}, config.aiPromptProvider), { key: config.identifier + '-ai-prompt-provider' });
|
|
285
285
|
modules['ai-prompt-provider'] = [
|
|
286
|
-
Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, (config.aiPromptProvider.formSchema || config.aiPromptProvider.uiPath
|
|
286
|
+
Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config, config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, (config.aiPromptProvider.formSchema || config.aiPromptProvider.uiPath
|
|
287
287
|
? {
|
|
288
288
|
configuratorUrl: '/prompt-provider/settings/' + (config.aiPromptProvider.fileName || 'index.html'),
|
|
289
289
|
}
|
|
@@ -368,7 +368,7 @@ function handle(config) {
|
|
|
368
368
|
workflowStep.key = config.identifier + '-' + (0, util_3.getWorkflowStepKey)(workflowStep);
|
|
369
369
|
}
|
|
370
370
|
const uiModule = ((_b = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _b === void 0 ? void 0 : _b.formSchema) || ((_c = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _c === void 0 ? void 0 : _c.fileName);
|
|
371
|
-
modules['workflow-step-type'].push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key: workflowStep.key, name: workflowStep.name || config.name }, ((workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.imagePath) ? { logo: (0, util_1.getLogoUrl)(workflowStep, `-${workflowStep.key}`) } : {})), { description: workflowStep.description || config.description, boundaries: workflowStep.boundaries }), (workflowStep.editorMode ? { editorMode: workflowStep.editorMode } : {})), { updateSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), deleteSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/delete', workflowStep) }), (uiModule ? { url: (0, util_3.getWorkflowStepUrl)('/workflow-step', workflowStep) } : {})));
|
|
371
|
+
modules['workflow-step-type'].push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key: workflowStep.key, name: workflowStep.name || config.name }, ((workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.imagePath) ? { logo: (0, util_1.getLogoUrl)(config, workflowStep, `-${workflowStep.key}`) } : {})), { description: workflowStep.description || config.description, boundaries: workflowStep.boundaries }), (workflowStep.editorMode ? { editorMode: workflowStep.editorMode } : {})), { updateSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), deleteSettingsUrl: (0, util_3.getWorkflowStepUrl)('/workflow-step/delete', workflowStep) }), (uiModule ? { url: (0, util_3.getWorkflowStepUrl)('/workflow-step', workflowStep) } : {})));
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
const events = {
|
|
@@ -379,7 +379,7 @@ function handle(config) {
|
|
|
379
379
|
events['subscription_paid'] = '/subscription-paid';
|
|
380
380
|
}
|
|
381
381
|
return (_req, res) => {
|
|
382
|
-
const manifest = Object.assign(Object.assign(Object.assign(Object.assign({ identifier: config.identifier, name: config.name, logo: (0, util_1.getLogoUrl)(), baseUrl: config.baseUrl, authentication: {
|
|
382
|
+
const manifest = Object.assign(Object.assign(Object.assign(Object.assign({ identifier: config.identifier, name: config.name, logo: (0, util_1.getLogoUrl)(config), baseUrl: config.baseUrl, authentication: {
|
|
383
383
|
type: config.authenticationType || types_1.AuthenticationType.APP,
|
|
384
384
|
clientId: config.clientId,
|
|
385
385
|
}, restrictAiToSameApp: config.restrictAiToSameApp }, (config.agent && { agent: config.agent })), { events, scopes: config.scopes ? config.scopes : [types_1.Scope.PROJECTS] }), (config.defaultPermissions && { default_permissions: config.defaultPermissions })), { modules });
|
|
@@ -7,17 +7,16 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
if (!config.organizationMenu) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
17
|
-
app.
|
|
16
|
+
app.use('/logo/organization-menu', (0, util_2.serveLogo)(config, config.organizationMenu));
|
|
18
17
|
app.use('/organization-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationMenu.key }), (0, render_ui_module_1.default)(config.organizationMenu, config));
|
|
19
18
|
// TEMPORARY CODE: it needs to support old path
|
|
20
|
-
app.
|
|
19
|
+
app.use('/logo/resources', (0, util_2.serveLogo)(config, config.organizationMenu));
|
|
21
20
|
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationMenu, config));
|
|
22
21
|
// END TEMPORARY CODE
|
|
23
22
|
}
|
|
@@ -7,17 +7,16 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
if (!config.organizationSettingsMenu) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
17
|
-
app.
|
|
16
|
+
app.use('/logo/organization-settings', (0, util_2.serveLogo)(config, config.organizationSettingsMenu));
|
|
18
17
|
app.use('/organization-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationSettingsMenu.key }), (0, render_ui_module_1.default)(config.organizationSettingsMenu, config));
|
|
19
18
|
// TEMPORARY CODE: it needs to support old path
|
|
20
|
-
app.
|
|
19
|
+
app.use('/logo/settings', (0, util_2.serveLogo)(config, config.organizationSettingsMenu));
|
|
21
20
|
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationSettingsMenu, config));
|
|
22
21
|
// END TEMPORARY CODE
|
|
23
22
|
}
|
|
@@ -7,17 +7,16 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
if (!config.profileResourcesMenu) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
app.
|
|
15
|
+
app.use('/logo/profile-resources', (0, util_2.serveLogo)(config, config.profileResourcesMenu));
|
|
17
16
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
18
17
|
app.use('/profile-resources', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileResourcesMenu.key }), (0, render_ui_module_1.default)(config.profileResourcesMenu, config));
|
|
19
18
|
// TEMPORARY CODE: it needs to support old path
|
|
20
|
-
app.
|
|
19
|
+
app.use('/logo/resources', (0, util_2.serveLogo)(config, config.profileResourcesMenu));
|
|
21
20
|
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileResourcesMenu, config));
|
|
22
21
|
// END TEMPORARY CODE
|
|
23
22
|
}
|
|
@@ -7,17 +7,16 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a, _b;
|
|
13
12
|
if (!config.profileSettingsMenu) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
app.
|
|
15
|
+
app.use('/logo/profile-settings', (0, util_2.serveLogo)(config, config.profileSettingsMenu));
|
|
17
16
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
18
17
|
app.use('/profile-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileSettingsMenu.key }), (0, render_ui_module_1.default)(config.profileSettingsMenu, config));
|
|
19
18
|
// TEMPORARY CODE: it needs to support old path
|
|
20
|
-
app.
|
|
19
|
+
app.use('/logo/settings', (0, util_2.serveLogo)(config, config.profileSettingsMenu));
|
|
21
20
|
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileSettingsMenu, config));
|
|
22
21
|
// END TEMPORARY CODE
|
|
23
22
|
}
|
|
@@ -7,14 +7,13 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a;
|
|
13
12
|
if (!config.projectReports) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
17
|
-
app.
|
|
16
|
+
app.use('/logo/reports', (0, util_2.serveLogo)(config, config.projectReports));
|
|
18
17
|
app.use('/reports', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectReports.key }), (0, render_ui_module_1.default)(config.projectReports, config));
|
|
19
18
|
}
|
|
20
19
|
exports.register = register;
|
|
@@ -7,14 +7,13 @@ exports.register = void 0;
|
|
|
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");
|
|
10
|
-
const
|
|
10
|
+
const util_2 = require("../../util");
|
|
11
11
|
function register({ config, app }) {
|
|
12
|
-
var _a;
|
|
13
12
|
if (!config.projectTools) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
17
|
-
app.
|
|
16
|
+
app.use('/logo/tools', (0, util_2.serveLogo)(config, config.projectTools));
|
|
18
17
|
app.use('/tools', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.projectTools.key }), (0, render_ui_module_1.default)(config.projectTools, config));
|
|
19
18
|
}
|
|
20
19
|
exports.register = register;
|
|
@@ -11,7 +11,6 @@ const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-clie
|
|
|
11
11
|
const step_settings_save_1 = __importDefault(require("./handlers/step-settings-save"));
|
|
12
12
|
const delete_step_1 = __importDefault(require("./handlers/delete-step"));
|
|
13
13
|
const util_2 = require("../../util");
|
|
14
|
-
const static_files_1 = require("../../util/static-files");
|
|
15
14
|
function register({ config, app }) {
|
|
16
15
|
if (!config.workflowStepType) {
|
|
17
16
|
return;
|
|
@@ -43,7 +42,7 @@ function register({ config, app }) {
|
|
|
43
42
|
}), (0, delete_step_1.default)(workflowStep));
|
|
44
43
|
// END TEMPORARY CODE
|
|
45
44
|
if (workflowStep.imagePath) {
|
|
46
|
-
app.
|
|
45
|
+
app.use(`/logo-${workflowStep.key}`, (0, util_2.serveLogo)(config, workflowStep));
|
|
47
46
|
}
|
|
48
47
|
if (workflowStep.settingsUiModule) {
|
|
49
48
|
app.use((0, util_1.getWorkflowStepUrl)('/workflow-step', workflowStep), (0, ui_module_1.default)({ config, moduleType: workflowStep.key }), (0, render_ui_module_1.default)(workflowStep.settingsUiModule, config));
|