@crowdin/app-project-module 1.16.0 → 2.1.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 +8 -15
- package/out/middlewares/auto-credentials-masker.js +5 -2
- package/out/middlewares/crowdin-client.d.ts +1 -1
- package/out/middlewares/crowdin-client.js +1 -1
- package/out/middlewares/export.d.ts +2 -2
- package/out/middlewares/export.js +4 -35
- package/out/middlewares/json-response.d.ts +1 -1
- package/out/middlewares/json-response.js +1 -1
- package/out/modules/ai-prompt-provider/index.js +6 -6
- package/out/modules/ai-provider/index.js +7 -7
- package/out/modules/ai-provider/types.d.ts +10 -0
- package/out/modules/ai-provider/types.js +12 -0
- package/out/modules/ai-provider/util/index.d.ts +0 -10
- package/out/modules/ai-provider/util/index.js +2 -13
- package/out/modules/ai-request-processors/index.js +4 -4
- package/out/modules/api/api.js +18 -18
- package/out/modules/auth-guard/index.js +4 -5
- package/out/modules/automation-action/index.js +4 -6
- package/out/modules/context-menu/index.js +4 -13
- package/out/modules/custom-mt/index.js +4 -4
- package/out/modules/custom-spell-check/index.js +11 -11
- package/out/modules/editor-right-panel/index.js +1 -1
- package/out/modules/external-qa-check/index.js +7 -7
- package/out/modules/file-processing/index.js +14 -14
- package/out/modules/integration/index.js +26 -26
- package/out/modules/integration/types.d.ts +4 -4
- package/out/modules/integration/util/files.js +1 -1
- package/out/modules/integration/util/types.d.ts +1 -1
- package/out/modules/integration/util/webhooks.js +69 -54
- package/out/modules/manifest.js +70 -281
- package/out/modules/modal/index.js +4 -13
- package/out/modules/organization-menu/index.js +1 -1
- package/out/modules/organization-settings-menu/index.js +1 -1
- package/out/modules/profile-resources-menu/index.js +1 -1
- package/out/modules/profile-settings-menu/index.js +1 -1
- package/out/modules/project-menu/index.js +1 -1
- package/out/modules/project-menu-crowdsource/index.js +1 -1
- package/out/modules/project-reports/index.js +1 -1
- package/out/modules/project-tools/index.js +1 -1
- package/out/modules/webhooks/index.js +3 -6
- package/out/modules/workflow-step-type/index.js +6 -6
- package/out/static/ui/error.bundle.js +9 -9
- package/out/static/ui/error.bundle.js.map +1 -1
- package/out/static/ui/form.bundle.js +125 -125
- package/out/static/ui/form.bundle.js.map +1 -1
- package/out/static/ui/install.bundle.js +9 -9
- package/out/static/ui/install.bundle.js.map +1 -1
- package/out/static/ui/login.bundle.js +9 -9
- package/out/static/ui/login.bundle.js.map +1 -1
- package/out/static/ui/main.bundle.js +9 -9
- package/out/static/ui/main.bundle.js.map +1 -1
- package/out/static/ui/oauth.bundle.js +9 -9
- package/out/static/ui/oauth.bundle.js.map +1 -1
- package/out/storage/drizzle/d1/index.d.ts +7 -0
- package/out/storage/drizzle/d1/index.js +48 -0
- package/out/storage/drizzle/d1/migrations/init.d.ts +2 -0
- package/out/storage/drizzle/d1/migrations/init.js +122 -0
- package/out/storage/drizzle/d1/types.d.ts +13 -0
- package/out/storage/drizzle/d1/types.js +38 -0
- package/out/storage/{sqlite.d.ts → drizzle/index.d.ts} +37 -58
- package/out/storage/drizzle/index.js +939 -0
- package/out/storage/drizzle/postgresql/config.d.ts +5 -0
- package/out/storage/drizzle/postgresql/config.js +11 -0
- package/out/storage/drizzle/postgresql/index.d.ts +14 -0
- package/out/storage/drizzle/postgresql/index.js +144 -0
- package/out/storage/drizzle/postgresql/migrations/0000_init.sql +113 -0
- package/out/storage/drizzle/postgresql/migrations/0001_init_indexes.sql +28 -0
- package/out/storage/drizzle/postgresql/migrations/meta/0000_snapshot.json +646 -0
- package/out/storage/drizzle/postgresql/migrations/meta/0001_snapshot.json +646 -0
- package/out/storage/drizzle/postgresql/migrations/meta/_journal.json +20 -0
- package/out/storage/drizzle/postgresql/schema.d.ts +1410 -0
- package/out/storage/drizzle/postgresql/schema.js +106 -0
- package/out/storage/drizzle/sqlite/config.d.ts +5 -0
- package/out/storage/drizzle/sqlite/config.js +11 -0
- package/out/storage/drizzle/sqlite/index.d.ts +8 -0
- package/out/storage/drizzle/sqlite/index.js +63 -0
- package/out/storage/drizzle/sqlite/migrations/0000_init.sql +113 -0
- package/out/storage/drizzle/sqlite/migrations/meta/0000_snapshot.json +687 -0
- package/out/storage/drizzle/sqlite/migrations/meta/_journal.json +13 -0
- package/out/storage/drizzle/sqlite/schema.d.ts +1544 -0
- package/out/storage/drizzle/sqlite/schema.js +106 -0
- package/out/storage/index.d.ts +2 -88
- package/out/storage/index.js +12 -128
- package/out/storage/internal/backup.d.ts +3 -0
- package/out/storage/internal/backup.js +94 -0
- package/out/storage/types.d.ts +66 -0
- package/out/types.d.ts +43 -47
- package/out/util/credentials-masker.js +2 -2
- package/out/util/export.d.ts +1 -0
- package/out/util/export.js +2 -1
- package/out/util/index.d.ts +2 -1
- package/out/util/index.js +12 -9
- package/out/util/normalize-module.d.ts +0 -1
- package/out/util/normalize-module.js +0 -4
- package/package.json +19 -24
- package/out/modules/ai-tools/handlers/tool-calls.d.ts +0 -4
- package/out/modules/ai-tools/handlers/tool-calls.js +0 -52
- package/out/modules/ai-tools/index.d.ts +0 -10
- package/out/modules/ai-tools/index.js +0 -46
- package/out/modules/ai-tools/types.d.ts +0 -63
- package/out/modules/ai-tools/types.js +0 -2
- package/out/modules/ai-tools/util/index.d.ts +0 -5
- package/out/modules/ai-tools/util/index.js +0 -24
- package/out/storage/d1.d.ts +0 -107
- package/out/storage/d1.js +0 -837
- package/out/storage/export.d.ts +0 -1
- package/out/storage/export.js +0 -2
- package/out/storage/mysql.d.ts +0 -109
- package/out/storage/mysql.js +0 -984
- package/out/storage/postgre.d.ts +0 -124
- package/out/storage/postgre.js +0 -1027
- package/out/storage/sqlite.js +0 -786
|
@@ -369,52 +369,71 @@ function updateCrowdinFromWebhookRequest(args) {
|
|
|
369
369
|
}
|
|
370
370
|
function listenQueueMessage(_a) {
|
|
371
371
|
return __awaiter(this, arguments, void 0, function* ({ config, integration, queueName, queueUrl, }) {
|
|
372
|
-
let
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
(0, logger_1.logError)('AMQP channel closed');
|
|
396
|
-
});
|
|
397
|
-
const onMessage = consumer({ channel, config, integration });
|
|
398
|
-
yield channel.consume(queueName, onMessage, { noAck: false });
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
catch (e) {
|
|
402
|
-
(0, logger_1.logError)(`Failed to connect to AMQP: ${e}`);
|
|
403
|
-
yield scheduleReconnect();
|
|
404
|
-
}
|
|
372
|
+
let parsedUrl;
|
|
373
|
+
try {
|
|
374
|
+
parsedUrl = new URL(queueUrl);
|
|
375
|
+
}
|
|
376
|
+
catch (err) {
|
|
377
|
+
(0, logger_1.logError)(`Invalid AMQP queueUrl: ${err}`);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
const setup = (model) => __awaiter(this, void 0, void 0, function* () {
|
|
381
|
+
const channel = yield model.createChannel();
|
|
382
|
+
yield channel.assertQueue(queueName, { durable: true });
|
|
383
|
+
yield channel.prefetch(prefetchCount);
|
|
384
|
+
channel.on('error', (err) => {
|
|
385
|
+
(0, logger_1.logError)(`AMQP channel error: ${err.message}`);
|
|
386
|
+
});
|
|
387
|
+
channel.on('close', () => {
|
|
388
|
+
(0, logger_1.logError)('AMQP channel closed');
|
|
389
|
+
});
|
|
390
|
+
channel.on('handler-error', (err, eventName) => {
|
|
391
|
+
(0, logger_1.logError)(`AMQP channel handler error on event '${eventName}': ${err}`);
|
|
392
|
+
});
|
|
393
|
+
const onMessage = consumer({ channel, config, integration });
|
|
394
|
+
yield channel.consume(queueName, onMessage, { noAck: false });
|
|
405
395
|
});
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
396
|
+
let connection;
|
|
397
|
+
try {
|
|
398
|
+
connection = yield amqplib_1.default.connect({
|
|
399
|
+
protocol: parsedUrl.protocol.replace(/:$/, ''),
|
|
400
|
+
hostname: parsedUrl.hostname,
|
|
401
|
+
port: parsedUrl.port ? Number(parsedUrl.port) : undefined,
|
|
402
|
+
username: parsedUrl.username || undefined,
|
|
403
|
+
password: parsedUrl.password || undefined,
|
|
404
|
+
vhost: parsedUrl.pathname && parsedUrl.pathname !== '/'
|
|
405
|
+
? decodeURIComponent(parsedUrl.pathname.slice(1))
|
|
406
|
+
: undefined,
|
|
407
|
+
heartbeat: connectionHeartbeat,
|
|
408
|
+
}, {
|
|
409
|
+
recovery: {
|
|
410
|
+
initialDelay: baseReconnectDelay,
|
|
411
|
+
maxDelay: 30000,
|
|
412
|
+
factor: 2,
|
|
413
|
+
maxRetries: maxReconnectAttempts,
|
|
414
|
+
setup,
|
|
415
|
+
},
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
catch (err) {
|
|
419
|
+
(0, logger_1.logError)(`Failed to connect to AMQP: ${err}`);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
connection.on('connect', () => {
|
|
423
|
+
(0, logger_1.log)('AMQP connection established');
|
|
424
|
+
});
|
|
425
|
+
connection.on('disconnect', (err) => {
|
|
426
|
+
(0, logger_1.logError)(`AMQP connection closed, attempting to reconnect: ${err === null || err === void 0 ? void 0 : err.message}`);
|
|
427
|
+
});
|
|
428
|
+
connection.on('reconnect-scheduled', ({ attempt, delay }) => {
|
|
429
|
+
(0, logger_1.logError)(`AMQP reconnecting (attempt ${attempt}, delay ${delay}ms)`);
|
|
430
|
+
});
|
|
431
|
+
connection.on('reconnect-failed', (err) => {
|
|
432
|
+
(0, logger_1.logError)(`AMQP max reconnection attempts (${maxReconnectAttempts}) reached: ${err}`);
|
|
433
|
+
});
|
|
434
|
+
connection.on('error', (err) => {
|
|
435
|
+
(0, logger_1.logError)(`AMQP connection error: ${err.message}`);
|
|
416
436
|
});
|
|
417
|
-
yield connect();
|
|
418
437
|
});
|
|
419
438
|
}
|
|
420
439
|
function consumer({ channel, config, integration, }) {
|
|
@@ -463,15 +482,11 @@ function consumer({ channel, config, integration, }) {
|
|
|
463
482
|
}
|
|
464
483
|
if (messagesCounter < prefetchCount) {
|
|
465
484
|
// if all messages are not received, wait 10 seconds to force process messages
|
|
466
|
-
timeoutId = setTimeout(() =>
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
messagesToAck,
|
|
472
|
-
});
|
|
473
|
-
resetStateVariables();
|
|
474
|
-
}), forceProcessDelay);
|
|
485
|
+
timeoutId = setTimeout(() => {
|
|
486
|
+
processMessages({ webhooksData, webhooksInfo, channel, messagesToAck })
|
|
487
|
+
.then(() => resetStateVariables())
|
|
488
|
+
.catch((err) => (0, logger_1.logError)(`Error in deferred message processing: ${err}`));
|
|
489
|
+
}, forceProcessDelay);
|
|
475
490
|
return;
|
|
476
491
|
}
|
|
477
492
|
clearTimeout(timeoutId);
|
|
@@ -542,7 +557,7 @@ function processMessages(_a) {
|
|
|
542
557
|
}
|
|
543
558
|
}
|
|
544
559
|
catch (e) {
|
|
545
|
-
(0, logger_1.
|
|
560
|
+
(0, logger_1.logError)(`Error in processMessages: ${e}`);
|
|
546
561
|
for (const msg of messagesToAck) {
|
|
547
562
|
try {
|
|
548
563
|
if (isRetryableError(e)) {
|