@crowdin/app-project-module 0.46.0 → 0.47.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/index.js CHANGED
@@ -141,7 +141,7 @@ function addCrowdinEndpoints(app, clientConfig) {
141
141
  contextMenuApp.register({ config, app });
142
142
  //other apps only work in authorized context
143
143
  if (!(0, util_1.isAuthorizedConfig)(config)) {
144
- return {};
144
+ return Object.assign({}, exports.metadataStore);
145
145
  }
146
146
  app.post('/installed', (0, install_1.default)(config));
147
147
  app.post('/uninstall', (0, uninstall_1.default)(config));
@@ -21,7 +21,9 @@ function handle(customSpellchecker) {
21
21
  res.send({ data });
22
22
  }
23
23
  catch (e) {
24
- req.logError(e);
24
+ if (req.logError) {
25
+ req.logError(e);
26
+ }
25
27
  res.send({ error: { message: (0, logger_1.getErrorMessage)(e) } });
26
28
  }
27
29
  }));
@@ -41,8 +41,8 @@ export interface CustomSpellcheckerModule extends Environments {
41
41
  * function to get list of supported languages that are supports by current spellchecker
42
42
  */
43
43
  getSupportedLanguage: ({ client, context, }: {
44
- client: Crowdin;
45
- context: CrowdinContextInfo;
44
+ client?: Crowdin;
45
+ context?: CrowdinContextInfo;
46
46
  }) => Promise<SupportedLanguage[]>;
47
47
  /**
48
48
  * function to check spelling
@@ -81,11 +81,11 @@ function runJob({ config, integration, job, }) {
81
81
  }
82
82
  exports.runJob = runJob;
83
83
  function filesCron({ config, integration, period, }) {
84
+ var _a;
84
85
  return __awaiter(this, void 0, void 0, function* () {
85
86
  (0, logger_1.log)(`Starting files cron job with period [${period}]`);
86
87
  const syncSettingsList = yield (0, storage_1.getStorage)().getAllSyncSettingsByType('schedule');
87
- yield Promise.all(syncSettingsList.map((syncSettings) => __awaiter(this, void 0, void 0, function* () {
88
- var _a;
88
+ for (const syncSettings of syncSettingsList) {
89
89
  let files = JSON.parse(syncSettings.files);
90
90
  let newFiles = [];
91
91
  const crowdinCredentials = yield (0, storage_1.getStorage)().getCrowdinCredentials(syncSettings.crowdinId);
@@ -264,7 +264,7 @@ function filesCron({ config, integration, period, }) {
264
264
  }
265
265
  (0, logger_1.log)(`updateCrowdin task for files cron job with period [${period}] for project ${projectId} completed`);
266
266
  }
267
- })));
267
+ }
268
268
  (0, logger_1.log)(`Files cron job with period [${period}] completed`);
269
269
  });
270
270
  }
@@ -195,15 +195,14 @@
195
195
  }
196
196
 
197
197
  .error-detail-table tr td:first-child {
198
- color: #263238;
199
198
  font-weight: 500;
200
199
  min-width: 200px;
201
200
  vertical-align: top;
202
201
  }
203
202
 
204
203
  .error-detail-table tr td:last-child {
205
- background: #f6f6f6;
206
- color: rgba(38,50,56,.87);
204
+ background: var(--crowdin-primary-blue-gray, #f6f6f6);
205
+ color: var(--crowdin-body-color, rgba(38, 50, 56, 0.87));
207
206
  word-break: break-all;
208
207
  }
209
208
 
package/out/types.d.ts CHANGED
@@ -213,10 +213,12 @@ export declare enum Scope {
213
213
  TRANSLATION_STATUS = "project.status",
214
214
  SOURCE_FILES_AND_STRINGS = "project.source",
215
215
  WEBHOOKS = "project.webhook",
216
+ ORGANIZATION_WEBHOOKS = "webhook",
216
217
  TRANSLATIONS = "project.translation",
217
218
  SCREENSHOTS = "project.screenshot",
218
219
  SECURITY_LOGS = "security-log",
219
- VENDORS = "vendor"
220
+ VENDORS = "vendor",
221
+ FIELDS = "field"
220
222
  }
221
223
  export interface CrowdinClientRequest extends Request {
222
224
  crowdinApiClient: Crowdin;
package/out/types.js CHANGED
@@ -23,10 +23,12 @@ var Scope;
23
23
  Scope["TRANSLATION_STATUS"] = "project.status";
24
24
  Scope["SOURCE_FILES_AND_STRINGS"] = "project.source";
25
25
  Scope["WEBHOOKS"] = "project.webhook";
26
+ Scope["ORGANIZATION_WEBHOOKS"] = "webhook";
26
27
  Scope["TRANSLATIONS"] = "project.translation";
27
28
  Scope["SCREENSHOTS"] = "project.screenshot";
28
29
  Scope["SECURITY_LOGS"] = "security-log";
29
30
  Scope["VENDORS"] = "vendor";
31
+ Scope["FIELDS"] = "field";
30
32
  })(Scope = exports.Scope || (exports.Scope = {}));
31
33
  var AccountType;
32
34
  (function (AccountType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.46.0",
3
+ "version": "0.47.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",