@crowdin/app-project-module 0.58.4 → 0.59.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
@@ -64,7 +64,6 @@ const aiProvider = __importStar(require("./modules/ai-provider"));
64
64
  const aiPromptProvider = __importStar(require("./modules/ai-prompt-provider"));
65
65
  const aiTools = __importStar(require("./modules/ai-tools"));
66
66
  const editorRightPanelApp = __importStar(require("./modules/editor-right-panel"));
67
- const editorThemesApp = __importStar(require("./modules/editor-themes"));
68
67
  const externalQaCheck = __importStar(require("./modules/external-qa-check"));
69
68
  const fileProcessingApps = __importStar(require("./modules/file-processing"));
70
69
  const integrationApp = __importStar(require("./modules/integration"));
@@ -159,7 +158,6 @@ function addCrowdinEndpoints(app, clientConfig) {
159
158
  * /handlers -> for http handlers
160
159
  */
161
160
  integrationApp.register({ config, app });
162
- editorThemesApp.register({ config, app });
163
161
  customMTApp.register({ config, app });
164
162
  fileProcessingApps.registerCustomFileFormat({ config, app });
165
163
  fileProcessingApps.registerFilePreImport({ config, app });
@@ -157,17 +157,23 @@ function filesCron({ config, integration, period, }) {
157
157
  if (!integration.webhooks &&
158
158
  ((_a = integration.syncNewElements) === null || _a === void 0 ? void 0 : _a[syncSettings.provider]) &&
159
159
  intConfig[`new-${syncSettings.provider}-files`]) {
160
- newFiles = yield getAllNewFiles({
161
- config,
162
- integration,
163
- projectData,
164
- syncSettings,
165
- crowdinApiClient: crowdinClient,
166
- crowdinId: crowdinCredentials.id,
167
- integrationCredentials: apiCredentials,
168
- integrationId: integrationCredentials.id,
169
- integrationSettings: intConfig,
170
- });
160
+ try {
161
+ newFiles = yield getAllNewFiles({
162
+ config,
163
+ integration,
164
+ projectData,
165
+ syncSettings,
166
+ crowdinApiClient: crowdinClient,
167
+ crowdinId: crowdinCredentials.id,
168
+ integrationCredentials: apiCredentials,
169
+ integrationId: integrationCredentials.id,
170
+ integrationSettings: intConfig,
171
+ });
172
+ }
173
+ catch (e) {
174
+ (0, logger_1.logError)(e);
175
+ continue;
176
+ }
171
177
  }
172
178
  if (integration.webhooks) {
173
179
  const webhooks = yield (0, storage_1.getStorage)().getAllWebhooks(syncSettings.integrationId, syncSettings.crowdinId, syncSettings.provider);
@@ -375,17 +381,23 @@ function getOnlyTranslatedOrApprovedFiles({ projectId, crowdinFiles, crowdinClie
375
381
  return __awaiter(this, void 0, void 0, function* () {
376
382
  (0, logger_1.log)(`Filtering files to process only ${onlyApproved ? 'approved' : 'translated'} files`);
377
383
  const filesInfo = yield Promise.all(Object.keys(crowdinFiles).map((fileId) => __awaiter(this, void 0, void 0, function* () {
378
- const res = yield crowdinClient.translationStatusApi
379
- .withFetchAll()
380
- .getFileProgress(projectId, Number(fileId));
381
- return {
382
- id: fileId,
383
- info: res.data.map((e) => e.data),
384
- };
384
+ try {
385
+ const res = yield crowdinClient.translationStatusApi
386
+ .withFetchAll()
387
+ .getFileProgress(projectId, Number(fileId));
388
+ return {
389
+ id: fileId,
390
+ info: res.data.map((e) => e.data),
391
+ };
392
+ }
393
+ catch (e) {
394
+ delete crowdinFiles[fileId];
395
+ (0, logger_1.logError)(e);
396
+ }
385
397
  })));
386
398
  const filteredFiles = {};
387
399
  Object.keys(crowdinFiles).forEach((fileId) => {
388
- const fileInfo = filesInfo.find((info) => info.id === fileId);
400
+ const fileInfo = filesInfo.find((info) => (info === null || info === void 0 ? void 0 : info.id) === fileId);
389
401
  if (!fileInfo) {
390
402
  return;
391
403
  }
@@ -102,13 +102,6 @@ function handle(config) {
102
102
  })),
103
103
  ];
104
104
  }
105
- if (config.editorThemes) {
106
- modules['editor-themes'] = [
107
- Object.assign({ key: config.identifier + '-editor-themes', name: config.editorThemes.name || config.name, logo: (0, util_1.getLogoUrl)(config.editorThemes, '/editor-themes'), styles: config.editorThemes.styles, modes: config.editorThemes.modes }, (!!config.editorThemes.environments && {
108
- environments: normalizeEnvironments(config.editorThemes.environments),
109
- })),
110
- ];
111
- }
112
105
  if (config.projectMenu) {
113
106
  modules['project-menu'] = [
114
107
  Object.assign({ key: config.identifier + '-project-menu', name: config.projectMenu.name || config.name, url: '/project-menu/' + (config.projectMenu.fileName || 'index.html') }, (!!config.projectMenu.environments && {