@crowdin/app-project-module 0.76.2 → 0.78.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/middlewares/integration-credentials.js +12 -4
- package/out/modules/ai-provider/index.js +14 -2
- package/out/modules/custom-mt/index.js +8 -1
- package/out/modules/custom-spell-check/index.js +26 -4
- package/out/modules/external-qa-check/index.js +17 -2
- package/out/modules/file-processing/index.js +8 -1
- package/out/modules/integration/handlers/crowdin-update.js +10 -4
- package/out/modules/integration/handlers/integration-update.js +21 -7
- package/out/modules/integration/handlers/main.js +1 -0
- package/out/modules/integration/types.d.ts +15 -1
- package/out/modules/integration/util/defaults.js +1 -0
- package/out/modules/integration/util/files.d.ts +8 -1
- package/out/modules/integration/util/files.js +24 -1
- package/out/modules/manifest.js +84 -34
- package/out/modules/organization-menu/index.js +5 -1
- package/out/modules/organization-settings-menu/index.js +5 -1
- package/out/modules/profile-resources-menu/index.js +6 -2
- package/out/modules/profile-settings-menu/index.js +6 -2
- package/out/modules/workflow-step-type/index.js +14 -2
- package/out/static/js/form.js +12 -12
- package/out/views/main.handlebars +89 -5
- package/package.json +12 -12
package/out/modules/manifest.js
CHANGED
|
@@ -16,7 +16,8 @@ function handle(config) {
|
|
|
16
16
|
var _a, _b;
|
|
17
17
|
const modules = {};
|
|
18
18
|
if (config.projectIntegration) {
|
|
19
|
-
|
|
19
|
+
// prevent possible overrides of the other modules
|
|
20
|
+
config.projectIntegration = Object.assign(Object.assign({}, config.projectIntegration), { key: config.identifier + '-int' });
|
|
20
21
|
modules['project-integrations'] = [
|
|
21
22
|
Object.assign({ key: config.projectIntegration.key, name: config.name, description: config.description, logo: (0, util_1.getLogoUrl)(config.projectIntegration, '/integration'), url: '/' }, (!!config.projectIntegration.environments && {
|
|
22
23
|
environments: normalizeEnvironments(config.projectIntegration.environments),
|
|
@@ -24,7 +25,8 @@ function handle(config) {
|
|
|
24
25
|
];
|
|
25
26
|
}
|
|
26
27
|
if (config.customFileFormat) {
|
|
27
|
-
|
|
28
|
+
// prevent possible overrides of the other modules
|
|
29
|
+
config.customFileFormat = Object.assign(Object.assign({}, config.customFileFormat), { key: config.identifier + '-ff' });
|
|
28
30
|
modules['custom-file-format'] = [
|
|
29
31
|
{
|
|
30
32
|
key: config.customFileFormat.key,
|
|
@@ -35,12 +37,13 @@ function handle(config) {
|
|
|
35
37
|
extensions: config.customFileFormat.extensions,
|
|
36
38
|
signaturePatterns: config.customFileFormat.signaturePatterns,
|
|
37
39
|
multilingualExport: config.customFileFormat.multilingualExport,
|
|
38
|
-
url: '/process',
|
|
40
|
+
url: '/file/process',
|
|
39
41
|
},
|
|
40
42
|
];
|
|
41
43
|
}
|
|
42
44
|
if (config.filePreImport) {
|
|
43
|
-
|
|
45
|
+
// prevent possible overrides of the other modules
|
|
46
|
+
config.filePreImport = Object.assign(Object.assign({}, config.filePreImport), { key: config.identifier + '-pri' });
|
|
44
47
|
modules['file-pre-import'] = [
|
|
45
48
|
{
|
|
46
49
|
key: config.filePreImport.key,
|
|
@@ -50,7 +53,8 @@ function handle(config) {
|
|
|
50
53
|
];
|
|
51
54
|
}
|
|
52
55
|
if (config.filePostImport) {
|
|
53
|
-
|
|
56
|
+
// prevent possible overrides of the other modules
|
|
57
|
+
config.filePostImport = Object.assign(Object.assign({}, config.filePostImport), { key: config.identifier + '-poi' });
|
|
54
58
|
modules['file-post-import'] = [
|
|
55
59
|
{
|
|
56
60
|
key: config.filePostImport.key,
|
|
@@ -60,7 +64,8 @@ function handle(config) {
|
|
|
60
64
|
];
|
|
61
65
|
}
|
|
62
66
|
if (config.filePreExport) {
|
|
63
|
-
|
|
67
|
+
// prevent possible overrides of the other modules
|
|
68
|
+
config.filePreExport = Object.assign(Object.assign({}, config.filePreExport), { key: config.identifier + '-pre' });
|
|
64
69
|
modules['file-pre-export'] = [
|
|
65
70
|
{
|
|
66
71
|
key: config.filePreExport.key,
|
|
@@ -70,7 +75,8 @@ function handle(config) {
|
|
|
70
75
|
];
|
|
71
76
|
}
|
|
72
77
|
if (config.filePostExport) {
|
|
73
|
-
|
|
78
|
+
// prevent possible overrides of the other modules
|
|
79
|
+
config.filePostExport = Object.assign(Object.assign({}, config.filePostExport), { key: config.identifier + '-poe' });
|
|
74
80
|
modules['file-post-export'] = [
|
|
75
81
|
{
|
|
76
82
|
key: config.filePostExport.key,
|
|
@@ -80,9 +86,10 @@ function handle(config) {
|
|
|
80
86
|
];
|
|
81
87
|
}
|
|
82
88
|
if (config.customMT) {
|
|
83
|
-
|
|
89
|
+
// prevent possible overrides of the other modules
|
|
90
|
+
config.customMT = Object.assign(Object.assign({}, config.customMT), { key: config.identifier + '-mt' });
|
|
84
91
|
modules['custom-mt'] = [
|
|
85
|
-
Object.assign(Object.assign(Object.assign({ key: config.customMT.key, name: config.name, logo: (0, util_1.getLogoUrl)(config.customMT, '/mt'), url: '/translate', withContext: !!config.customMT.withContext }, (config.customMT.batchSize !== null && {
|
|
92
|
+
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 && {
|
|
86
93
|
batchSize: config.customMT.batchSize,
|
|
87
94
|
})), (config.customMT.maskEntities !== null && {
|
|
88
95
|
maskEntities: config.customMT.maskEntities,
|
|
@@ -92,45 +99,50 @@ function handle(config) {
|
|
|
92
99
|
];
|
|
93
100
|
}
|
|
94
101
|
if (config.organizationMenu) {
|
|
95
|
-
|
|
102
|
+
// prevent possible overrides of the other modules
|
|
103
|
+
config.organizationMenu = Object.assign(Object.assign({}, config.organizationMenu), { key: config.identifier + '-resources' });
|
|
96
104
|
modules['organization-menu'] = [
|
|
97
105
|
{
|
|
98
106
|
key: config.organizationMenu.key,
|
|
99
107
|
name: config.organizationMenu.name || config.name,
|
|
100
|
-
url: '/
|
|
108
|
+
url: '/organization-menu/' + (config.organizationMenu.fileName || 'index.html'),
|
|
101
109
|
icon: (0, util_1.getLogoUrl)(config.organizationMenu, '/resources'),
|
|
102
110
|
},
|
|
103
111
|
];
|
|
104
112
|
}
|
|
105
113
|
if (config.organizationSettingsMenu) {
|
|
106
|
-
|
|
114
|
+
// prevent possible overrides of the other modules
|
|
115
|
+
config.organizationSettingsMenu = Object.assign(Object.assign({}, config.organizationSettingsMenu), { key: config.identifier + '-organization-settings-menu' });
|
|
107
116
|
modules['organization-settings-menu'] = [
|
|
108
117
|
{
|
|
109
118
|
key: config.organizationSettingsMenu.key,
|
|
110
119
|
name: config.organizationSettingsMenu.name || config.name,
|
|
111
|
-
url: '/settings/' + (config.organizationSettingsMenu.fileName || 'index.html'),
|
|
112
|
-
icon: (0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/settings'),
|
|
120
|
+
url: '/organization-settings/' + (config.organizationSettingsMenu.fileName || 'index.html'),
|
|
121
|
+
icon: (0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/organization-settings'),
|
|
113
122
|
},
|
|
114
123
|
];
|
|
115
124
|
}
|
|
116
125
|
if (config.profileResourcesMenu) {
|
|
117
|
-
|
|
126
|
+
// prevent possible overrides of the other modules
|
|
127
|
+
config.profileResourcesMenu = Object.assign(Object.assign({}, config.profileResourcesMenu), { key: config.identifier + '-profile-resources-menu' });
|
|
118
128
|
modules['profile-resources-menu'] = [
|
|
119
|
-
Object.assign({ key: config.profileResourcesMenu.key, name: config.profileResourcesMenu.name || config.name, url: '/resources/' + (config.profileResourcesMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileResourcesMenu, '/resources') }, (!!config.profileResourcesMenu.environments && {
|
|
129
|
+
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 && {
|
|
120
130
|
environments: normalizeEnvironments(config.profileResourcesMenu.environments),
|
|
121
131
|
})),
|
|
122
132
|
];
|
|
123
133
|
}
|
|
124
134
|
if (config.profileSettingsMenu) {
|
|
125
|
-
|
|
135
|
+
// prevent possible overrides of the other modules
|
|
136
|
+
config.profileSettingsMenu = Object.assign(Object.assign({}, config.profileSettingsMenu), { key: config.identifier + '-profile-settings-menu' });
|
|
126
137
|
modules['profile-settings-menu'] = [
|
|
127
|
-
Object.assign({ key: config.profileSettingsMenu.key, name: config.profileSettingsMenu.name || config.name, url: '/settings/' + (config.profileSettingsMenu.fileName || 'index.html'), icon: (0, util_1.getLogoUrl)(config.profileSettingsMenu, '/settings') }, (!!config.profileSettingsMenu.environments && {
|
|
138
|
+
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 && {
|
|
128
139
|
environments: normalizeEnvironments(config.profileSettingsMenu.environments),
|
|
129
140
|
})),
|
|
130
141
|
];
|
|
131
142
|
}
|
|
132
143
|
if (config.editorRightPanel) {
|
|
133
|
-
|
|
144
|
+
// prevent possible overrides of the other modules
|
|
145
|
+
config.editorRightPanel = Object.assign(Object.assign({}, config.editorRightPanel), { key: config.identifier + '-editor-panels' });
|
|
134
146
|
modules['editor-right-panel'] = [
|
|
135
147
|
Object.assign({ key: config.editorRightPanel.key, name: config.editorRightPanel.name || config.name, url: '/editor-panels/' + (config.editorRightPanel.fileName || 'index.html'), modes: config.editorRightPanel.modes }, (!!config.editorRightPanel.environments && {
|
|
136
148
|
environments: normalizeEnvironments(config.editorRightPanel.environments),
|
|
@@ -138,7 +150,8 @@ function handle(config) {
|
|
|
138
150
|
];
|
|
139
151
|
}
|
|
140
152
|
if (config.projectMenu) {
|
|
141
|
-
|
|
153
|
+
// prevent possible overrides of the other modules
|
|
154
|
+
config.projectMenu = Object.assign(Object.assign({}, config.projectMenu), { key: config.identifier + '-project-menu' });
|
|
142
155
|
modules['project-menu'] = [
|
|
143
156
|
Object.assign({ key: config.projectMenu.key, name: config.projectMenu.name || config.name, url: '/project-menu/' + (config.projectMenu.fileName || 'index.html') }, (!!config.projectMenu.environments && {
|
|
144
157
|
environments: normalizeEnvironments(config.projectMenu.environments),
|
|
@@ -146,7 +159,8 @@ function handle(config) {
|
|
|
146
159
|
];
|
|
147
160
|
}
|
|
148
161
|
if (config.projectMenuCrowdsource) {
|
|
149
|
-
|
|
162
|
+
// prevent possible overrides of the other modules
|
|
163
|
+
config.projectMenuCrowdsource = Object.assign(Object.assign({}, config.projectMenuCrowdsource), { key: config.identifier + '-project-menu-crowdsource' });
|
|
150
164
|
modules['project-menu-crowdsource'] = [
|
|
151
165
|
{
|
|
152
166
|
key: config.projectMenuCrowdsource.key,
|
|
@@ -156,7 +170,8 @@ function handle(config) {
|
|
|
156
170
|
];
|
|
157
171
|
}
|
|
158
172
|
if (config.projectTools) {
|
|
159
|
-
|
|
173
|
+
// prevent possible overrides of the other modules
|
|
174
|
+
config.projectTools = Object.assign(Object.assign({}, config.projectTools), { key: config.identifier + '-tools' });
|
|
160
175
|
modules['project-tools'] = [
|
|
161
176
|
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 && {
|
|
162
177
|
environments: normalizeEnvironments(config.projectTools.environments),
|
|
@@ -164,7 +179,8 @@ function handle(config) {
|
|
|
164
179
|
];
|
|
165
180
|
}
|
|
166
181
|
if (config.projectReports) {
|
|
167
|
-
|
|
182
|
+
// prevent possible overrides of the other modules
|
|
183
|
+
config.projectReports = Object.assign(Object.assign({}, config.projectReports), { key: config.identifier + '-project-reports' });
|
|
168
184
|
modules['project-reports'] = [
|
|
169
185
|
{
|
|
170
186
|
key: config.projectReports.key,
|
|
@@ -176,13 +192,15 @@ function handle(config) {
|
|
|
176
192
|
];
|
|
177
193
|
}
|
|
178
194
|
if (config.modal) {
|
|
179
|
-
|
|
195
|
+
// prevent possible overrides of the other modules
|
|
196
|
+
config.modal = Object.assign(Object.assign({}, config.modal), { key: config.identifier + '-modal' });
|
|
180
197
|
modules['modal'] = [
|
|
181
198
|
Object.assign({ key: config.modal.key, name: config.modal.name || config.name, url: config.modal.url || '/modal/' + (config.modal.fileName || 'index.html') }, (!!config.modal.environments && { environments: normalizeEnvironments(config.modal.environments) })),
|
|
182
199
|
];
|
|
183
200
|
}
|
|
184
201
|
if (config.contextMenu) {
|
|
185
|
-
|
|
202
|
+
// prevent possible overrides of the other modules
|
|
203
|
+
config.contextMenu = Object.assign(Object.assign({}, config.contextMenu), { key: config.identifier + '-context-menu' });
|
|
186
204
|
modules['context-menu'] = [
|
|
187
205
|
Object.assign({ key: config.contextMenu.key, name: config.contextMenu.name || config.name, description: config.description, options: Object.assign(Object.assign({ location: config.contextMenu.location, type: config.contextMenu.type }, (config.contextMenu.module
|
|
188
206
|
? {
|
|
@@ -199,25 +217,28 @@ function handle(config) {
|
|
|
199
217
|
modules['api'] = (0, api_1.getApiManifest)(config, config.api);
|
|
200
218
|
}
|
|
201
219
|
if (config.customSpellchecker) {
|
|
202
|
-
|
|
220
|
+
// prevent possible overrides of the other modules
|
|
221
|
+
config.customSpellchecker = Object.assign(Object.assign({}, config.customSpellchecker), { key: config.identifier + '-spellchecker' });
|
|
203
222
|
const uiModule = config.customSpellchecker.settingsUiModule;
|
|
204
223
|
modules['custom-spellchecker'] = [
|
|
205
|
-
Object.assign(Object.assign({ key: config.customSpellchecker.key, name: config.customSpellchecker.name || config.name, description: config.customSpellchecker.description || config.description, listSupportedLanguagesUrl: '/languages', checkSpellingUrl: '/spellcheck' }, (!!config.customSpellchecker.environments && {
|
|
224
|
+
Object.assign(Object.assign({ key: config.customSpellchecker.key, name: config.customSpellchecker.name || config.name, description: config.customSpellchecker.description || config.description, listSupportedLanguagesUrl: '/spellchecker/languages', checkSpellingUrl: '/spellchecker/spellcheck' }, (!!config.customSpellchecker.environments && {
|
|
206
225
|
environments: normalizeEnvironments(config.customSpellchecker.environments),
|
|
207
|
-
})), (uiModule ? { url: '/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
226
|
+
})), (uiModule ? { url: '/spellchecker/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
208
227
|
];
|
|
209
228
|
}
|
|
210
229
|
if (config.aiProvider) {
|
|
211
|
-
|
|
230
|
+
// prevent possible overrides of the other modules
|
|
231
|
+
config.aiProvider = Object.assign(Object.assign({}, config.aiProvider), { key: config.identifier + '-aiprovider' });
|
|
212
232
|
const uiModule = config.aiProvider.settingsUiModule;
|
|
213
233
|
modules['ai-provider'] = [
|
|
214
|
-
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: '/completions', modelsUrl: '/models' }, (!!config.aiProvider.environments && {
|
|
234
|
+
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 && {
|
|
215
235
|
environments: normalizeEnvironments(config.aiProvider.environments),
|
|
216
236
|
})), (uiModule ? { url: '/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
217
237
|
];
|
|
218
238
|
}
|
|
219
239
|
if (config.aiPromptProvider) {
|
|
220
|
-
|
|
240
|
+
// prevent possible overrides of the other modules
|
|
241
|
+
config.aiPromptProvider = Object.assign(Object.assign({}, config.aiPromptProvider), { key: config.identifier + '-ai-prompt-provider' });
|
|
221
242
|
modules['ai-prompt-provider'] = [
|
|
222
243
|
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
|
|
223
244
|
? {
|
|
@@ -227,6 +248,13 @@ function handle(config) {
|
|
|
227
248
|
];
|
|
228
249
|
}
|
|
229
250
|
if (config.aiTools) {
|
|
251
|
+
// prevent possible overrides of the other modules
|
|
252
|
+
if (Array.isArray(config.aiTools)) {
|
|
253
|
+
config.aiTools = config.aiTools.map((aiTool) => (Object.assign({}, aiTool)));
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
config.aiTools = Object.assign({}, config.aiTools);
|
|
257
|
+
}
|
|
230
258
|
const tools = Array.isArray(config.aiTools) ? config.aiTools : [config.aiTools];
|
|
231
259
|
modules['ai-tools'] = [];
|
|
232
260
|
for (const tool of tools) {
|
|
@@ -237,6 +265,13 @@ function handle(config) {
|
|
|
237
265
|
}
|
|
238
266
|
}
|
|
239
267
|
if (config.aiToolsWidget) {
|
|
268
|
+
// prevent possible overrides of the other modules
|
|
269
|
+
if (Array.isArray(config.aiToolsWidget)) {
|
|
270
|
+
config.aiToolsWidget = config.aiToolsWidget.map((aiToolWidget) => (Object.assign({}, aiToolWidget)));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
config.aiToolsWidget = Object.assign({}, config.aiToolsWidget);
|
|
274
|
+
}
|
|
240
275
|
const tools = Array.isArray(config.aiToolsWidget) ? config.aiToolsWidget : [config.aiToolsWidget];
|
|
241
276
|
modules['ai-tools-widget'] = [];
|
|
242
277
|
for (const tool of tools) {
|
|
@@ -247,6 +282,13 @@ function handle(config) {
|
|
|
247
282
|
}
|
|
248
283
|
}
|
|
249
284
|
if (config.webhooks) {
|
|
285
|
+
// prevent possible overrides of the other modules
|
|
286
|
+
if (Array.isArray(config.webhooks)) {
|
|
287
|
+
config.webhooks = config.webhooks.map((webhook) => (Object.assign({}, webhook)));
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
config.webhooks = Object.assign({}, config.webhooks);
|
|
291
|
+
}
|
|
250
292
|
const webhooks = Array.isArray(config.webhooks) ? config.webhooks : [config.webhooks];
|
|
251
293
|
modules['webhook'] = [];
|
|
252
294
|
for (let i = 0; i < webhooks.length; i++) {
|
|
@@ -259,13 +301,21 @@ function handle(config) {
|
|
|
259
301
|
}
|
|
260
302
|
}
|
|
261
303
|
if (config.externalQaCheck) {
|
|
262
|
-
|
|
304
|
+
// prevent possible overrides of the other modules
|
|
305
|
+
config.externalQaCheck = Object.assign(Object.assign({}, config.externalQaCheck), { key: config.identifier + '-qa-check' });
|
|
263
306
|
const uiModule = config.externalQaCheck.settingsUiModule;
|
|
264
307
|
modules['external-qa-check'] = [
|
|
265
|
-
Object.assign(Object.assign({ key: config.externalQaCheck.key, name: config.externalQaCheck.name || config.name, description: config.externalQaCheck.description || config.description, runQaCheckUrl: '/validate' }, (config.externalQaCheck.batchSize ? { getBatchSizeUrl: '/batch-size' } : {})), (uiModule ? { url: '/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
308
|
+
Object.assign(Object.assign({ key: config.externalQaCheck.key, name: config.externalQaCheck.name || config.name, description: config.externalQaCheck.description || config.description, runQaCheckUrl: '/qa-check/validate' }, (config.externalQaCheck.batchSize ? { getBatchSizeUrl: '/qa-check/batch-size' } : {})), (uiModule ? { url: '/qa-check/settings/' + (uiModule.fileName || 'index.html') } : {})),
|
|
266
309
|
];
|
|
267
310
|
}
|
|
268
311
|
if (config.workflowStepType) {
|
|
312
|
+
// prevent possible overrides of the other modules
|
|
313
|
+
if (Array.isArray(config.workflowStepType)) {
|
|
314
|
+
config.workflowStepType = config.workflowStepType.map((workflowStep) => (Object.assign({}, workflowStep)));
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
config.workflowStepType = Object.assign({}, config.workflowStepType);
|
|
318
|
+
}
|
|
269
319
|
const workflowSteps = Array.isArray(config.workflowStepType)
|
|
270
320
|
? config.workflowStepType
|
|
271
321
|
: [config.workflowStepType];
|
|
@@ -275,7 +325,7 @@ function handle(config) {
|
|
|
275
325
|
workflowStep.key = config.identifier + '-' + (0, util_3.getWorkflowStepKey)(workflowStep);
|
|
276
326
|
}
|
|
277
327
|
const uiModule = ((_a = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _a === void 0 ? void 0 : _a.formSchema) || ((_b = workflowStep === null || workflowStep === void 0 ? void 0 : workflowStep.settingsUiModule) === null || _b === void 0 ? void 0 : _b.fileName);
|
|
278
|
-
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)('/settings', workflowStep), deleteSettingsUrl: (0, util_3.getWorkflowStepUrl)('/delete', workflowStep) }), (uiModule ? { url: (0, util_3.getWorkflowStepUrl)('/workflow-step', workflowStep) } : {})));
|
|
328
|
+
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) } : {})));
|
|
279
329
|
}
|
|
280
330
|
}
|
|
281
331
|
const events = {
|
|
@@ -12,7 +12,11 @@ function register({ config, app }) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
+
app.get((0, util_1.getLogoUrl)(config.organizationMenu, '/organization-menu'), (req, res) => { var _a; return res.sendFile(((_a = config.organizationMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
16
|
+
app.use('/organization-menu', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationMenu.key }), (0, render_ui_module_1.default)(config.organizationMenu));
|
|
17
|
+
// TEMPORARY CODE: it needs to support old path
|
|
15
18
|
app.get((0, util_1.getLogoUrl)(config.organizationMenu, '/resources'), (req, res) => { var _a; return res.sendFile(((_a = config.organizationMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
16
|
-
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized
|
|
19
|
+
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationMenu));
|
|
20
|
+
// END TEMPORARY CODE
|
|
17
21
|
}
|
|
18
22
|
exports.register = register;
|
|
@@ -12,7 +12,11 @@ function register({ config, app }) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
15
|
+
app.get((0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/organization-settings'), (req, res) => { var _a; return res.sendFile(((_a = config.organizationSettingsMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
16
|
+
app.use('/organization-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.organizationSettingsMenu.key }), (0, render_ui_module_1.default)(config.organizationSettingsMenu));
|
|
17
|
+
// TEMPORARY CODE: it needs to support old path
|
|
15
18
|
app.get((0, util_1.getLogoUrl)(config.organizationSettingsMenu, '/settings'), (req, res) => { var _a; return res.sendFile(((_a = config.organizationSettingsMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
16
|
-
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized
|
|
19
|
+
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.organizationSettingsMenu));
|
|
20
|
+
// END TEMPORARY CODE
|
|
17
21
|
}
|
|
18
22
|
exports.register = register;
|
|
@@ -11,8 +11,12 @@ function register({ config, app }) {
|
|
|
11
11
|
if (!config.profileResourcesMenu) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
app.get((0, util_1.getLogoUrl)(config.profileResourcesMenu, '/resources'), (req, res) => { var _a; return res.sendFile(((_a = config.profileResourcesMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
14
|
+
app.get((0, util_1.getLogoUrl)(config.profileResourcesMenu, '/profile-resources'), (req, res) => { var _a; return res.sendFile(((_a = config.profileResourcesMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
15
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
16
|
-
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileResourcesMenu.key }), (0, render_ui_module_1.default)(config.profileResourcesMenu));
|
|
16
|
+
app.use('/profile-resources', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileResourcesMenu.key }), (0, render_ui_module_1.default)(config.profileResourcesMenu));
|
|
17
|
+
// TEMPORARY CODE: it needs to support old path
|
|
18
|
+
app.get((0, util_1.getLogoUrl)(config.profileResourcesMenu, '/resources'), (req, res) => { var _a; return res.sendFile(((_a = config.profileResourcesMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
19
|
+
app.use('/resources', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileResourcesMenu));
|
|
20
|
+
// END TEMPORARY CODE
|
|
17
21
|
}
|
|
18
22
|
exports.register = register;
|
|
@@ -11,8 +11,12 @@ function register({ config, app }) {
|
|
|
11
11
|
if (!config.profileSettingsMenu) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
app.get((0, util_1.getLogoUrl)(config.profileSettingsMenu, '/settings'), (req, res) => { var _a; return res.sendFile(((_a = config.profileSettingsMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
14
|
+
app.get((0, util_1.getLogoUrl)(config.profileSettingsMenu, '/profile-settings'), (req, res) => { var _a; return res.sendFile(((_a = config.profileSettingsMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
15
15
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
16
|
-
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileSettingsMenu.key }), (0, render_ui_module_1.default)(config.profileSettingsMenu));
|
|
16
|
+
app.use('/profile-settings', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.profileSettingsMenu.key }), (0, render_ui_module_1.default)(config.profileSettingsMenu));
|
|
17
|
+
// TEMPORARY CODE: it needs to support old path
|
|
18
|
+
app.get((0, util_1.getLogoUrl)(config.profileSettingsMenu, '/settings'), (req, res) => { var _a; return res.sendFile(((_a = config.profileSettingsMenu) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
|
|
19
|
+
app.use('/settings', (0, ui_module_1.default)({ config, allowUnauthorized }), (0, render_ui_module_1.default)(config.profileSettingsMenu));
|
|
20
|
+
// END TEMPORARY CODE
|
|
17
21
|
}
|
|
18
22
|
exports.register = register;
|
|
@@ -17,18 +17,30 @@ function register({ config, app }) {
|
|
|
17
17
|
}
|
|
18
18
|
const workflowSteps = Array.isArray(config.workflowStepType) ? config.workflowStepType : [config.workflowStepType];
|
|
19
19
|
for (const workflowStep of workflowSteps) {
|
|
20
|
-
app.post((0, util_1.getWorkflowStepUrl)('/settings', workflowStep), (0, crowdin_client_1.default)({
|
|
20
|
+
app.post((0, util_1.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), (0, crowdin_client_1.default)({
|
|
21
21
|
config,
|
|
22
22
|
optional: true,
|
|
23
23
|
checkSubscriptionExpiration: false,
|
|
24
24
|
moduleKey: workflowStep.key,
|
|
25
25
|
}), (0, step_settings_save_1.default)(workflowStep));
|
|
26
|
-
app.delete((0, util_1.getWorkflowStepUrl)('/delete', workflowStep), (0, crowdin_client_1.default)({
|
|
26
|
+
app.delete((0, util_1.getWorkflowStepUrl)('/workflow-step/delete', workflowStep), (0, crowdin_client_1.default)({
|
|
27
27
|
config,
|
|
28
28
|
optional: true,
|
|
29
29
|
checkSubscriptionExpiration: false,
|
|
30
30
|
moduleKey: workflowStep.key,
|
|
31
31
|
}), (0, delete_step_1.default)(workflowStep));
|
|
32
|
+
// TEMPORARY CODE: it needs to support old path
|
|
33
|
+
app.post((0, util_1.getWorkflowStepUrl)('/settings', workflowStep), (0, crowdin_client_1.default)({
|
|
34
|
+
config,
|
|
35
|
+
optional: true,
|
|
36
|
+
checkSubscriptionExpiration: false,
|
|
37
|
+
}), (0, step_settings_save_1.default)(workflowStep));
|
|
38
|
+
app.delete((0, util_1.getWorkflowStepUrl)('/delete', workflowStep), (0, crowdin_client_1.default)({
|
|
39
|
+
config,
|
|
40
|
+
optional: true,
|
|
41
|
+
checkSubscriptionExpiration: false,
|
|
42
|
+
}), (0, delete_step_1.default)(workflowStep));
|
|
43
|
+
// END TEMPORARY CODE
|
|
32
44
|
if (workflowStep.imagePath) {
|
|
33
45
|
app.get((0, util_2.getLogoUrl)(workflowStep, `-${workflowStep.key}`), (req, res) => res.sendFile(workflowStep.imagePath || config.imagePath));
|
|
34
46
|
}
|