@crowdin/app-project-module 0.84.2 → 0.85.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.
@@ -92,12 +92,12 @@ function handle({ config, optional = false, checkSubscriptionExpiration = true,
92
92
  next();
93
93
  }
94
94
  catch (e) {
95
- (0, logger_1.logError)(e);
95
+ const errorMessage = (0, logger_1.getErrorMessage)(e);
96
96
  if (e instanceof util_1.CodeError) {
97
- throw e;
97
+ return res.status(402).send({ message: errorMessage || 'Error', code: e.code });
98
98
  }
99
- const message = (0, logger_1.getErrorMessage)(e);
100
- return res.status(403).send({ error: message || 'Error' });
99
+ (0, logger_1.logError)(e);
100
+ return res.status(403).send({ error: errorMessage || 'Error' });
101
101
  }
102
102
  }));
103
103
  }
@@ -4,4 +4,8 @@ export interface EditorPanels extends UiModule {
4
4
  * The Editor's mode list where the module will be available.
5
5
  */
6
6
  modes: EditorMode[];
7
+ /**
8
+ * Defines if the module supports multiple strings at once.
9
+ */
10
+ supportsMultipleStrings: boolean;
7
11
  }
@@ -14,7 +14,7 @@ function normalizeEnvironments(environments) {
14
14
  return [environments];
15
15
  }
16
16
  function handle(config) {
17
- var _a, _b;
17
+ var _a, _b, _c;
18
18
  const modules = {};
19
19
  if (config.projectIntegration) {
20
20
  // prevent possible overrides of the other modules
@@ -145,7 +145,7 @@ function handle(config) {
145
145
  // prevent possible overrides of the other modules
146
146
  config.editorRightPanel = Object.assign(Object.assign({}, config.editorRightPanel), { key: config.identifier + '-editor-panels' });
147
147
  modules['editor-right-panel'] = [
148
- 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 && {
148
+ Object.assign({ key: config.editorRightPanel.key, name: config.editorRightPanel.name || config.name, url: '/editor-panels/' + (config.editorRightPanel.fileName || 'index.html'), supportsMultipleStrings: (_a = config.editorRightPanel.supportsMultipleStrings) !== null && _a !== void 0 ? _a : false, modes: config.editorRightPanel.modes }, (!!config.editorRightPanel.environments && {
149
149
  environments: normalizeEnvironments(config.editorRightPanel.environments),
150
150
  })),
151
151
  ];
@@ -341,7 +341,7 @@ function handle(config) {
341
341
  if (!workflowStep.key) {
342
342
  workflowStep.key = config.identifier + '-' + (0, util_3.getWorkflowStepKey)(workflowStep);
343
343
  }
344
- 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);
344
+ 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);
345
345
  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) } : {})));
346
346
  }
347
347
  }
package/out/types.d.ts CHANGED
@@ -362,7 +362,10 @@ export declare enum EditorMode {
362
362
  ASSETS = "assets",
363
363
  REVIEW = "review",
364
364
  TRANSLATE = "TRANSLATE",
365
- PROOFREAD = "proofread"
365
+ PROOFREAD = "proofread",
366
+ COMFORTABLE = "comfortable",
367
+ SIDE_BY_SIDE = "side-by-side",
368
+ MULTILINGUAL = "multilingual"
366
369
  }
367
370
  interface ModuleContent {
368
371
  /**
package/out/types.js CHANGED
@@ -52,6 +52,9 @@ var EditorMode;
52
52
  EditorMode["REVIEW"] = "review";
53
53
  EditorMode["TRANSLATE"] = "TRANSLATE";
54
54
  EditorMode["PROOFREAD"] = "proofread";
55
+ EditorMode["COMFORTABLE"] = "comfortable";
56
+ EditorMode["SIDE_BY_SIDE"] = "side-by-side";
57
+ EditorMode["MULTILINGUAL"] = "multilingual";
55
58
  })(EditorMode = exports.EditorMode || (exports.EditorMode = {}));
56
59
  var UserPermissions;
57
60
  (function (UserPermissions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.84.2",
3
+ "version": "0.85.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",