@crowdin/app-project-module 0.28.1 → 0.28.2

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.
@@ -157,7 +157,7 @@ function handle(config) {
157
157
  {
158
158
  key: config.identifier + '-modal',
159
159
  name: config.name,
160
- url: config.modal.url,
160
+ url: config.modal.url || '/modal/' + (config.modal.fileName || 'index.html'),
161
161
  environments: config.modal.environments,
162
162
  },
163
163
  ];
@@ -174,7 +174,7 @@ function handle(config) {
174
174
  [config.contextMenu.module]: modules[config.contextMenu.module][0].key,
175
175
  },
176
176
  }
177
- : {})), { url: config.contextMenu.url }),
177
+ : {})), { url: '/context/' + (config.contextMenu.fileName || 'index.html') }),
178
178
  environments: config.contextMenu.environments,
179
179
  },
180
180
  ];
package/out/index.js CHANGED
@@ -82,7 +82,7 @@ const webhooks_1 = require("./util/webhooks");
82
82
  var models_2 = require("./models");
83
83
  Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return models_2.Scope; } });
84
84
  function addCrowdinEndpoints(app, clientConfig) {
85
- var _a, _b, _c;
85
+ var _a, _b, _c, _d, _e, _f, _g;
86
86
  const config = (0, defaults_1.convertClientConfig)(clientConfig);
87
87
  if (!config.disableGlobalErrorHandling) {
88
88
  handleUncaughtErrors(config);
@@ -222,6 +222,12 @@ function addCrowdinEndpoints(app, clientConfig) {
222
222
  app.get('/logo/reports/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.projectReports) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath); });
223
223
  app.use('/reports', (0, ui_module_1.default)(config, config.projectReports.allowUnauthorized), (0, render_ui_module_1.default)(config, config.projectReports));
224
224
  }
225
+ if (((_d = config.modal) === null || _d === void 0 ? void 0 : _d.uiPath) || ((_e = config.modal) === null || _e === void 0 ? void 0 : _e.formSchema)) {
226
+ app.use('/modal', (0, ui_module_1.default)(config, config.modal.allowUnauthorized), (0, render_ui_module_1.default)(config, config.modal));
227
+ }
228
+ if (((_f = config.contextMenu) === null || _f === void 0 ? void 0 : _f.uiPath) || ((_g = config.contextMenu) === null || _g === void 0 ? void 0 : _g.formSchema)) {
229
+ app.use('/context', (0, ui_module_1.default)(config, config.contextMenu.allowUnauthorized), (0, render_ui_module_1.default)(config, config.contextMenu));
230
+ }
225
231
  if (Object.keys(config).some((moduleKey) => {
226
232
  const moduleConfig = config[moduleKey];
227
233
  return typeof moduleConfig === 'object' && moduleConfig.hasOwnProperty('formSchema');
@@ -107,11 +107,11 @@ export interface ClientConfig extends ImagePath {
107
107
  /**
108
108
  * context menu module
109
109
  */
110
- contextMenu?: ContextModule & ModuleContent & Environments;
110
+ contextMenu?: ContextModule & UiModule & Environments;
111
111
  /**
112
112
  * modal module
113
113
  */
114
- modal?: ModuleContent & Environments;
114
+ modal?: ModuleContent & UiModule & Environments;
115
115
  /**
116
116
  * Uninstall hook for cleanup logic
117
117
  */