@crowdin/app-project-module 1.5.1 → 1.5.3

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.
@@ -20,4 +20,9 @@ export interface AiPromptProviderModule extends UiModule {
20
20
  * Represents a collection of supported actions. If not provided, all actions are supported.
21
21
  */
22
22
  actions?: PromptActions[] | `custom:${string}`[];
23
+ /**
24
+ * Disable Auto-retry on QA issues in user interface.
25
+ * Default: false
26
+ */
27
+ disallowRetryOnQaIssues?: boolean;
23
28
  }
@@ -196,6 +196,12 @@ export interface IntegrationLogic extends ModuleKey {
196
196
  * Enable integration folder open event
197
197
  */
198
198
  integrationOneLevelFetching?: boolean;
199
+ /**
200
+ * Concurrency limit for snapshot fetching when integrationOneLevelFetching is enabled.
201
+ * Controls how many folders are fetched in parallel at each level of the tree.
202
+ * @default 1
203
+ */
204
+ snapshotFetchConcurrency?: number;
199
205
  /**
200
206
  * Enable integration search event
201
207
  */
@@ -16,7 +16,7 @@ const types_1 = require("../types");
16
16
  const storage_1 = require("../../../storage");
17
17
  const defaults_1 = require("./defaults");
18
18
  const files_1 = require("./files");
19
- const SNAPSHOT_FETCH_CONCURRENCY = 5;
19
+ const DEFAULT_SNAPSHOT_FETCH_CONCURRENCY = 1;
20
20
  function getCrowdinSnapshot(config, integration, crowdinApiClient, projectId, integrationSettings) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  let files = [];
@@ -44,13 +44,15 @@ function getTreeItems(integrationData) {
44
44
  }
45
45
  function getOneLevelFetchingFiles(integration, integrationCredentials, integrationSettings, parentFiles, client, projectId) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
+ var _a;
47
48
  const folders = parentFiles.filter((file) => !file.type);
48
49
  if (folders.length === 0) {
49
50
  return parentFiles;
50
51
  }
52
+ const concurrency = (_a = integration.snapshotFetchConcurrency) !== null && _a !== void 0 ? _a : DEFAULT_SNAPSHOT_FETCH_CONCURRENCY;
51
53
  const results = [];
52
- for (let i = 0; i < folders.length; i += SNAPSHOT_FETCH_CONCURRENCY) {
53
- const batch = folders.slice(i, i + SNAPSHOT_FETCH_CONCURRENCY);
54
+ for (let i = 0; i < folders.length; i += concurrency) {
55
+ const batch = folders.slice(i, i + concurrency);
54
56
  const batchResults = yield Promise.all(batch.map((folder) => __awaiter(this, void 0, void 0, function* () {
55
57
  const childs = getTreeItems(yield integration.getIntegrationFiles({
56
58
  credentials: integrationCredentials,
@@ -298,7 +298,9 @@ function handle(config) {
298
298
  // prevent possible overrides of the other modules
299
299
  config.aiPromptProvider = Object.assign(Object.assign({}, config.aiPromptProvider), { key: config.identifier + '-ai-prompt-provider' });
300
300
  modules['ai-prompt-provider'] = [
301
- Object.assign(Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config, config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, (config.aiPromptProvider.actions
301
+ Object.assign(Object.assign(Object.assign({ key: config.aiPromptProvider.key, name: config.aiPromptProvider.name || config.name, logo: (0, util_1.getLogoUrl)(config, config.aiPromptProvider, '/ai-prompt-provider'), compileUrl: '/prompt-provider/compile' }, ((0, util_1.isDefined)(config.aiPromptProvider.disallowRetryOnQaIssues) && {
302
+ disallowRetryOnQaIssues: config.aiPromptProvider.disallowRetryOnQaIssues,
303
+ })), (config.aiPromptProvider.actions
302
304
  ? {
303
305
  actions: config.aiPromptProvider.actions,
304
306
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
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",