@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.
Files changed (112) hide show
  1. package/out/index.js +8 -15
  2. package/out/middlewares/auto-credentials-masker.js +5 -2
  3. package/out/middlewares/crowdin-client.d.ts +1 -1
  4. package/out/middlewares/crowdin-client.js +1 -1
  5. package/out/middlewares/export.d.ts +2 -2
  6. package/out/middlewares/export.js +4 -35
  7. package/out/middlewares/json-response.d.ts +1 -1
  8. package/out/middlewares/json-response.js +1 -1
  9. package/out/modules/ai-prompt-provider/index.js +6 -6
  10. package/out/modules/ai-provider/index.js +7 -7
  11. package/out/modules/ai-provider/types.d.ts +10 -0
  12. package/out/modules/ai-provider/types.js +12 -0
  13. package/out/modules/ai-provider/util/index.d.ts +0 -10
  14. package/out/modules/ai-provider/util/index.js +2 -13
  15. package/out/modules/ai-request-processors/index.js +4 -4
  16. package/out/modules/api/api.js +18 -18
  17. package/out/modules/auth-guard/index.js +4 -5
  18. package/out/modules/automation-action/index.js +4 -6
  19. package/out/modules/context-menu/index.js +4 -13
  20. package/out/modules/custom-mt/index.js +4 -4
  21. package/out/modules/custom-spell-check/index.js +11 -11
  22. package/out/modules/editor-right-panel/index.js +1 -1
  23. package/out/modules/external-qa-check/index.js +7 -7
  24. package/out/modules/file-processing/index.js +14 -14
  25. package/out/modules/integration/index.js +26 -26
  26. package/out/modules/integration/types.d.ts +4 -4
  27. package/out/modules/integration/util/files.js +1 -1
  28. package/out/modules/integration/util/types.d.ts +1 -1
  29. package/out/modules/integration/util/webhooks.js +69 -54
  30. package/out/modules/manifest.js +70 -281
  31. package/out/modules/modal/index.js +4 -13
  32. package/out/modules/organization-menu/index.js +1 -1
  33. package/out/modules/organization-settings-menu/index.js +1 -1
  34. package/out/modules/profile-resources-menu/index.js +1 -1
  35. package/out/modules/profile-settings-menu/index.js +1 -1
  36. package/out/modules/project-menu/index.js +1 -1
  37. package/out/modules/project-menu-crowdsource/index.js +1 -1
  38. package/out/modules/project-reports/index.js +1 -1
  39. package/out/modules/project-tools/index.js +1 -1
  40. package/out/modules/webhooks/index.js +3 -6
  41. package/out/modules/workflow-step-type/index.js +6 -6
  42. package/out/static/ui/error.bundle.js +9 -9
  43. package/out/static/ui/error.bundle.js.map +1 -1
  44. package/out/static/ui/form.bundle.js +125 -125
  45. package/out/static/ui/form.bundle.js.map +1 -1
  46. package/out/static/ui/install.bundle.js +9 -9
  47. package/out/static/ui/install.bundle.js.map +1 -1
  48. package/out/static/ui/login.bundle.js +9 -9
  49. package/out/static/ui/login.bundle.js.map +1 -1
  50. package/out/static/ui/main.bundle.js +9 -9
  51. package/out/static/ui/main.bundle.js.map +1 -1
  52. package/out/static/ui/oauth.bundle.js +9 -9
  53. package/out/static/ui/oauth.bundle.js.map +1 -1
  54. package/out/storage/drizzle/d1/index.d.ts +7 -0
  55. package/out/storage/drizzle/d1/index.js +48 -0
  56. package/out/storage/drizzle/d1/migrations/init.d.ts +2 -0
  57. package/out/storage/drizzle/d1/migrations/init.js +122 -0
  58. package/out/storage/drizzle/d1/types.d.ts +13 -0
  59. package/out/storage/drizzle/d1/types.js +38 -0
  60. package/out/storage/{sqlite.d.ts → drizzle/index.d.ts} +37 -58
  61. package/out/storage/drizzle/index.js +939 -0
  62. package/out/storage/drizzle/postgresql/config.d.ts +5 -0
  63. package/out/storage/drizzle/postgresql/config.js +11 -0
  64. package/out/storage/drizzle/postgresql/index.d.ts +14 -0
  65. package/out/storage/drizzle/postgresql/index.js +144 -0
  66. package/out/storage/drizzle/postgresql/migrations/0000_init.sql +113 -0
  67. package/out/storage/drizzle/postgresql/migrations/0001_init_indexes.sql +28 -0
  68. package/out/storage/drizzle/postgresql/migrations/meta/0000_snapshot.json +646 -0
  69. package/out/storage/drizzle/postgresql/migrations/meta/0001_snapshot.json +646 -0
  70. package/out/storage/drizzle/postgresql/migrations/meta/_journal.json +20 -0
  71. package/out/storage/drizzle/postgresql/schema.d.ts +1410 -0
  72. package/out/storage/drizzle/postgresql/schema.js +106 -0
  73. package/out/storage/drizzle/sqlite/config.d.ts +5 -0
  74. package/out/storage/drizzle/sqlite/config.js +11 -0
  75. package/out/storage/drizzle/sqlite/index.d.ts +8 -0
  76. package/out/storage/drizzle/sqlite/index.js +63 -0
  77. package/out/storage/drizzle/sqlite/migrations/0000_init.sql +113 -0
  78. package/out/storage/drizzle/sqlite/migrations/meta/0000_snapshot.json +687 -0
  79. package/out/storage/drizzle/sqlite/migrations/meta/_journal.json +13 -0
  80. package/out/storage/drizzle/sqlite/schema.d.ts +1544 -0
  81. package/out/storage/drizzle/sqlite/schema.js +106 -0
  82. package/out/storage/index.d.ts +2 -88
  83. package/out/storage/index.js +12 -128
  84. package/out/storage/internal/backup.d.ts +3 -0
  85. package/out/storage/internal/backup.js +94 -0
  86. package/out/storage/types.d.ts +66 -0
  87. package/out/types.d.ts +43 -47
  88. package/out/util/credentials-masker.js +2 -2
  89. package/out/util/export.d.ts +1 -0
  90. package/out/util/export.js +2 -1
  91. package/out/util/index.d.ts +2 -1
  92. package/out/util/index.js +12 -9
  93. package/out/util/normalize-module.d.ts +0 -1
  94. package/out/util/normalize-module.js +0 -4
  95. package/package.json +19 -24
  96. package/out/modules/ai-tools/handlers/tool-calls.d.ts +0 -4
  97. package/out/modules/ai-tools/handlers/tool-calls.js +0 -52
  98. package/out/modules/ai-tools/index.d.ts +0 -10
  99. package/out/modules/ai-tools/index.js +0 -46
  100. package/out/modules/ai-tools/types.d.ts +0 -63
  101. package/out/modules/ai-tools/types.js +0 -2
  102. package/out/modules/ai-tools/util/index.d.ts +0 -5
  103. package/out/modules/ai-tools/util/index.js +0 -24
  104. package/out/storage/d1.d.ts +0 -107
  105. package/out/storage/d1.js +0 -837
  106. package/out/storage/export.d.ts +0 -1
  107. package/out/storage/export.js +0 -2
  108. package/out/storage/mysql.d.ts +0 -109
  109. package/out/storage/mysql.js +0 -984
  110. package/out/storage/postgre.d.ts +0 -124
  111. package/out/storage/postgre.js +0 -1027
  112. package/out/storage/sqlite.js +0 -786
@@ -14,7 +14,7 @@ function register({ config, app }) {
14
14
  if (!config.profileResourcesMenu) {
15
15
  return;
16
16
  }
17
- const items = (0, normalize_module_1.normalizeToArray)(config.profileResourcesMenu);
17
+ const items = config.profileResourcesMenu;
18
18
  const isSingle = items.length === 1;
19
19
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
20
20
  for (const [index, item] of items.entries()) {
@@ -14,7 +14,7 @@ function register({ config, app }) {
14
14
  if (!config.profileSettingsMenu) {
15
15
  return;
16
16
  }
17
- const items = (0, normalize_module_1.normalizeToArray)(config.profileSettingsMenu);
17
+ const items = config.profileSettingsMenu;
18
18
  const isSingle = items.length === 1;
19
19
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
20
20
  for (const [index, item] of items.entries()) {
@@ -13,7 +13,7 @@ function register({ config, app }) {
13
13
  if (!config.projectMenu) {
14
14
  return;
15
15
  }
16
- const items = (0, normalize_module_1.normalizeToArray)(config.projectMenu);
16
+ const items = config.projectMenu;
17
17
  const isSingle = items.length === 1;
18
18
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
19
19
  for (const [index, item] of items.entries()) {
@@ -13,7 +13,7 @@ function register({ config, app }) {
13
13
  if (!config.projectMenuCrowdsource) {
14
14
  return;
15
15
  }
16
- const items = (0, normalize_module_1.normalizeToArray)(config.projectMenuCrowdsource);
16
+ const items = config.projectMenuCrowdsource;
17
17
  const isSingle = items.length === 1;
18
18
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
19
19
  for (const [index, item] of items.entries()) {
@@ -14,7 +14,7 @@ function register({ config, app }) {
14
14
  if (!config.projectReports) {
15
15
  return;
16
16
  }
17
- const items = (0, normalize_module_1.normalizeToArray)(config.projectReports);
17
+ const items = config.projectReports;
18
18
  const isSingle = items.length === 1;
19
19
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
20
20
  for (const [index, item] of items.entries()) {
@@ -14,7 +14,7 @@ function register({ config, app }) {
14
14
  if (!config.projectTools) {
15
15
  return;
16
16
  }
17
- const items = (0, normalize_module_1.normalizeToArray)(config.projectTools);
17
+ const items = config.projectTools;
18
18
  const isSingle = items.length === 1;
19
19
  const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
20
20
  for (const [index, item] of items.entries()) {
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.register = register;
7
- const json_response_1 = __importDefault(require("../../middlewares/json-response"));
4
+ const json_response_1 = require("../../middlewares/json-response");
8
5
  const webhook_handler_1 = require("./handlers/webhook-handler");
9
6
  function register({ config, app }) {
10
7
  if (!config.webhooks) {
11
8
  return;
12
9
  }
13
- const webhooks = Array.isArray(config.webhooks) ? config.webhooks : [config.webhooks];
10
+ const webhooks = config.webhooks;
14
11
  if (webhooks.length) {
15
- app.post('/webhooks', json_response_1.default, (0, webhook_handler_1.webhookHandler)(config, webhooks));
12
+ app.post('/webhooks', json_response_1.handle, (0, webhook_handler_1.webhookHandler)(config, webhooks));
16
13
  }
17
14
  }
@@ -7,7 +7,7 @@ exports.register = register;
7
7
  const ui_module_1 = __importDefault(require("../../middlewares/ui-module"));
8
8
  const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-module"));
9
9
  const util_1 = require("./util");
10
- const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
10
+ const crowdin_client_1 = require("../../middlewares/crowdin-client");
11
11
  const step_settings_save_1 = __importDefault(require("./handlers/step-settings-save"));
12
12
  const delete_step_1 = __importDefault(require("./handlers/delete-step"));
13
13
  const util_2 = require("../../util");
@@ -15,27 +15,27 @@ function register({ config, app }) {
15
15
  if (!config.workflowStepType) {
16
16
  return;
17
17
  }
18
- const workflowSteps = Array.isArray(config.workflowStepType) ? config.workflowStepType : [config.workflowStepType];
18
+ const workflowSteps = config.workflowStepType;
19
19
  for (const workflowStep of workflowSteps) {
20
- app.post((0, util_1.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), (0, crowdin_client_1.default)({
20
+ app.post((0, util_1.getWorkflowStepUrl)('/workflow-step/settings', workflowStep), (0, crowdin_client_1.handle)({
21
21
  config,
22
22
  optional: true,
23
23
  checkSubscriptionExpiration: false,
24
24
  moduleKey: workflowStep.key,
25
25
  }), (0, step_settings_save_1.default)(workflowStep));
26
- app.delete((0, util_1.getWorkflowStepUrl)('/workflow-step/delete', workflowStep), (0, crowdin_client_1.default)({
26
+ app.delete((0, util_1.getWorkflowStepUrl)('/workflow-step/delete', workflowStep), (0, crowdin_client_1.handle)({
27
27
  config,
28
28
  optional: true,
29
29
  checkSubscriptionExpiration: false,
30
30
  moduleKey: workflowStep.key,
31
31
  }), (0, delete_step_1.default)(workflowStep));
32
32
  // TEMPORARY CODE: it needs to support old path
33
- app.post((0, util_1.getWorkflowStepUrl)('/settings', workflowStep), (0, crowdin_client_1.default)({
33
+ app.post((0, util_1.getWorkflowStepUrl)('/settings', workflowStep), (0, crowdin_client_1.handle)({
34
34
  config,
35
35
  optional: true,
36
36
  checkSubscriptionExpiration: false,
37
37
  }), (0, step_settings_save_1.default)(workflowStep));
38
- app.delete((0, util_1.getWorkflowStepUrl)('/delete', workflowStep), (0, crowdin_client_1.default)({
38
+ app.delete((0, util_1.getWorkflowStepUrl)('/delete', workflowStep), (0, crowdin_client_1.handle)({
39
39
  config,
40
40
  optional: true,
41
41
  checkSubscriptionExpiration: false,
@@ -115,17 +115,17 @@
115
115
  function requireScheduler_production_min () {
116
116
  if (hasRequiredScheduler_production_min) return scheduler_production_min;
117
117
  hasRequiredScheduler_production_min = 1;
118
- (function (exports$1) {
118
+ (function (exports) {
119
119
  function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}
120
- function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports$1.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports$1.unstable_now=function(){return p.now()-q};}var r=[],t=[],u=1,v=null,y=3,z=false,A=false,B=false,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;
120
+ function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};}var r=[],t=[],u=1,v=null,y=3,z=false,A=false,B=false,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;
121
121
  "undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t);}}function H(a){B=false;G(a);if(!A)if(null!==h(r))A=true,I(J);else {var b=h(t);null!==b&&K(H,b.startTime-a);}}
122
- function J(a,b){A=false;B&&(B=false,E(L),L=-1);z=true;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports$1.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b);}else k(r);v=h(r);}if(null!==v)var w=!0;else {var m=h(t);null!==m&&K(H,m.startTime-b);w=!1;}return w}finally{v=null,y=c,z=false;}}var N=false,O=null,L=-1,P=5,Q=-1;
123
- function M(){return exports$1.unstable_now()-Q<P?false:true}function R(){if(null!==O){var a=exports$1.unstable_now();Q=a;var b=true;try{b=O(!0,a);}finally{b?S():(N=false,O=null);}}else N=false;}var S;if("function"===typeof F)S=function(){F(R);};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null);};}else S=function(){D(R,0);};function I(a){O=a;N||(N=true,S());}function K(a,b){L=D(function(){a(exports$1.unstable_now());},b);}
124
- exports$1.unstable_IdlePriority=5;exports$1.unstable_ImmediatePriority=1;exports$1.unstable_LowPriority=4;exports$1.unstable_NormalPriority=3;exports$1.unstable_Profiling=null;exports$1.unstable_UserBlockingPriority=2;exports$1.unstable_cancelCallback=function(a){a.callback=null;};exports$1.unstable_continueExecution=function(){A||z||(A=true,I(J));};
125
- exports$1.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5;};exports$1.unstable_getCurrentPriorityLevel=function(){return y};exports$1.unstable_getFirstCallbackNode=function(){return h(r)};exports$1.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y;}var c=y;y=b;try{return a()}finally{y=c;}};exports$1.unstable_pauseExecution=function(){};
126
- exports$1.unstable_requestPaint=function(){};exports$1.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=y;y=a;try{return b()}finally{y=c;}};
127
- exports$1.unstable_scheduleCallback=function(a,b,c){var d=exports$1.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3;}e=c+e;a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=true,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=true,I(J)));return a};
128
- exports$1.unstable_shouldYield=M;exports$1.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c;}}};
122
+ function J(a,b){A=false;B&&(B=false,E(L),L=-1);z=true;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b);}else k(r);v=h(r);}if(null!==v)var w=!0;else {var m=h(t);null!==m&&K(H,m.startTime-b);w=!1;}return w}finally{v=null,y=c,z=false;}}var N=false,O=null,L=-1,P=5,Q=-1;
123
+ function M(){return exports.unstable_now()-Q<P?false:true}function R(){if(null!==O){var a=exports.unstable_now();Q=a;var b=true;try{b=O(!0,a);}finally{b?S():(N=false,O=null);}}else N=false;}var S;if("function"===typeof F)S=function(){F(R);};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null);};}else S=function(){D(R,0);};function I(a){O=a;N||(N=true,S());}function K(a,b){L=D(function(){a(exports.unstable_now());},b);}
124
+ exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null;};exports.unstable_continueExecution=function(){A||z||(A=true,I(J));};
125
+ exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5;};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y;}var c=y;y=b;try{return a()}finally{y=c;}};exports.unstable_pauseExecution=function(){};
126
+ exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=y;y=a;try{return b()}finally{y=c;}};
127
+ exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3;}e=c+e;a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=true,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=true,I(J)));return a};
128
+ exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c;}}};
129
129
  } (scheduler_production_min));
130
130
  return scheduler_production_min;
131
131
  }