@crowdin/app-project-module 0.43.1 → 0.44.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 (150) hide show
  1. package/out/index.d.ts +1 -1
  2. package/out/index.js +57 -166
  3. package/out/middlewares/integration-credentials.d.ts +2 -1
  4. package/out/middlewares/ui-module.d.ts +2 -2
  5. package/out/middlewares/ui-module.js +4 -0
  6. package/out/models/index.d.ts +52 -698
  7. package/out/models/index.js +2 -26
  8. package/out/modules/context-menu/index.d.ts +6 -0
  9. package/out/modules/context-menu/index.js +17 -0
  10. package/out/{handlers/custom-mt → modules/custom-mt/handlers}/translate.d.ts +2 -1
  11. package/out/{handlers/custom-mt → modules/custom-mt/handlers}/translate.js +2 -2
  12. package/out/modules/custom-mt/index.d.ts +6 -0
  13. package/out/modules/custom-mt/index.js +17 -0
  14. package/out/modules/custom-mt/types.d.ts +22 -0
  15. package/out/modules/custom-mt/types.js +2 -0
  16. package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/get-languages-list.d.ts +2 -1
  17. package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/get-languages-list.js +2 -2
  18. package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/spell-check.d.ts +2 -1
  19. package/out/{handlers/custom-spell-check → modules/custom-spell-check/handlers}/spell-check.js +5 -3
  20. package/out/modules/custom-spell-check/index.d.ts +6 -0
  21. package/out/modules/custom-spell-check/index.js +32 -0
  22. package/out/modules/custom-spell-check/types.d.ts +56 -0
  23. package/out/modules/custom-spell-check/types.js +2 -0
  24. package/out/modules/editor-right-panel/index.d.ts +6 -0
  25. package/out/modules/editor-right-panel/index.js +17 -0
  26. package/out/modules/editor-right-panel/types.d.ts +7 -0
  27. package/out/modules/editor-right-panel/types.js +2 -0
  28. package/out/modules/editor-themes/index.d.ts +6 -0
  29. package/out/modules/editor-themes/index.js +11 -0
  30. package/out/{handlers/file-processing → modules/file-processing/handlers}/custom-file-format.d.ts +2 -1
  31. package/out/{handlers/file-processing → modules/file-processing/handlers}/custom-file-format.js +5 -5
  32. package/out/modules/file-processing/handlers/file-download.d.ts +5 -0
  33. package/out/{handlers/file-processing → modules/file-processing/handlers}/file-download.js +2 -2
  34. package/out/{handlers/file-processing → modules/file-processing/handlers}/pre-post-process.d.ts +2 -1
  35. package/out/{handlers/file-processing → modules/file-processing/handlers}/pre-post-process.js +8 -8
  36. package/out/modules/file-processing/index.d.ts +22 -0
  37. package/out/modules/file-processing/index.js +57 -0
  38. package/out/modules/file-processing/types.d.ts +133 -0
  39. package/out/modules/file-processing/types.js +12 -0
  40. package/out/{handlers/integration/crowdin-project.d.ts → modules/form-data-display.d.ts} +1 -1
  41. package/out/modules/form-data-save.d.ts +4 -0
  42. package/out/{handlers/integration → modules/integration/handlers}/crowdin-file-progress.d.ts +2 -1
  43. package/out/{handlers/integration → modules/integration/handlers}/crowdin-file-progress.js +2 -2
  44. package/out/modules/integration/handlers/crowdin-files.d.ts +5 -0
  45. package/out/{handlers/integration → modules/integration/handlers}/crowdin-files.js +3 -3
  46. package/out/modules/integration/handlers/crowdin-project.d.ts +4 -0
  47. package/out/{handlers/integration → modules/integration/handlers}/crowdin-project.js +1 -1
  48. package/out/modules/integration/handlers/crowdin-update.d.ts +5 -0
  49. package/out/{handlers/integration → modules/integration/handlers}/crowdin-update.js +6 -6
  50. package/out/modules/integration/handlers/crowdin-webhook.d.ts +5 -0
  51. package/out/{handlers/integration → modules/integration/handlers}/crowdin-webhook.js +7 -7
  52. package/out/modules/integration/handlers/integration-data.d.ts +4 -0
  53. package/out/{handlers/integration → modules/integration/handlers}/integration-data.js +4 -4
  54. package/out/{handlers/integration → modules/integration/handlers}/integration-login.d.ts +2 -1
  55. package/out/{handlers/integration → modules/integration/handlers}/integration-login.js +3 -3
  56. package/out/modules/integration/handlers/integration-logout.d.ts +5 -0
  57. package/out/{handlers/integration → modules/integration/handlers}/integration-logout.js +5 -5
  58. package/out/modules/integration/handlers/integration-update.d.ts +5 -0
  59. package/out/{handlers/integration → modules/integration/handlers}/integration-update.js +5 -5
  60. package/out/modules/integration/handlers/integration-webhook.d.ts +5 -0
  61. package/out/{handlers/integration → modules/integration/handlers}/integration-webhook.js +4 -4
  62. package/out/modules/integration/handlers/job-cancel.d.ts +3 -0
  63. package/out/{handlers/integration → modules/integration/handlers}/job-cancel.js +3 -3
  64. package/out/modules/integration/handlers/job-info.d.ts +3 -0
  65. package/out/{handlers/integration → modules/integration/handlers}/job-info.js +3 -3
  66. package/out/modules/integration/handlers/main.d.ts +5 -0
  67. package/out/{handlers/integration → modules/integration/handlers}/main.js +4 -4
  68. package/out/modules/integration/handlers/oauth-login.d.ts +5 -0
  69. package/out/{handlers/integration → modules/integration/handlers}/oauth-login.js +3 -3
  70. package/out/{handlers/integration → modules/integration/handlers}/oauth-url.d.ts +2 -1
  71. package/out/{handlers/integration → modules/integration/handlers}/oauth-url.js +2 -2
  72. package/out/modules/integration/handlers/settings-save.d.ts +5 -0
  73. package/out/{handlers/integration → modules/integration/handlers}/settings-save.js +10 -10
  74. package/out/modules/integration/handlers/settings.d.ts +3 -0
  75. package/out/{handlers/integration → modules/integration/handlers}/settings.js +1 -1
  76. package/out/{handlers/integration → modules/integration/handlers}/subscription-info.d.ts +1 -1
  77. package/out/{handlers/integration → modules/integration/handlers}/subscription-info.js +1 -1
  78. package/out/modules/integration/handlers/sync-settings-save.d.ts +5 -0
  79. package/out/{handlers/integration → modules/integration/handlers}/sync-settings-save.js +5 -5
  80. package/out/modules/integration/handlers/sync-settings.d.ts +3 -0
  81. package/out/{handlers/integration → modules/integration/handlers}/sync-settings.js +2 -2
  82. package/out/modules/integration/handlers/user-errors.d.ts +3 -0
  83. package/out/{handlers/integration → modules/integration/handlers}/user-errors.js +2 -2
  84. package/out/modules/integration/index.d.ts +6 -0
  85. package/out/modules/integration/index.js +113 -0
  86. package/out/modules/integration/types.d.ts +446 -0
  87. package/out/modules/integration/types.js +19 -0
  88. package/out/modules/manifest.d.ts +3 -0
  89. package/out/{handlers → modules}/manifest.js +16 -10
  90. package/out/modules/modal/index.d.ts +6 -0
  91. package/out/modules/modal/index.js +17 -0
  92. package/out/modules/organization-menu/index.d.ts +6 -0
  93. package/out/modules/organization-menu/index.js +19 -0
  94. package/out/modules/profile-resources-menu/index.d.ts +6 -0
  95. package/out/modules/profile-resources-menu/index.js +19 -0
  96. package/out/modules/project-menu/index.d.ts +6 -0
  97. package/out/modules/project-menu/index.js +17 -0
  98. package/out/modules/project-menu-crowdsource/index.d.ts +6 -0
  99. package/out/modules/project-menu-crowdsource/index.js +17 -0
  100. package/out/modules/project-reports/index.d.ts +6 -0
  101. package/out/modules/project-reports/index.js +19 -0
  102. package/out/modules/project-tools/index.d.ts +6 -0
  103. package/out/modules/project-tools/index.js +19 -0
  104. package/out/storage/index.d.ts +3 -2
  105. package/out/storage/mysql.d.ts +2 -1
  106. package/out/storage/postgre.d.ts +2 -1
  107. package/out/storage/sqlite.d.ts +2 -1
  108. package/out/util/api/api.d.ts +2 -2
  109. package/out/util/api/api.js +10 -10
  110. package/out/util/connection.d.ts +3 -2
  111. package/out/util/cron.d.ts +2 -1
  112. package/out/util/cron.js +6 -6
  113. package/out/util/defaults.d.ts +5 -2
  114. package/out/util/defaults.js +13 -3
  115. package/out/util/file-snapshot.d.ts +2 -1
  116. package/out/util/file-snapshot.js +5 -5
  117. package/out/util/files.d.ts +2 -1
  118. package/out/util/index.d.ts +2 -1
  119. package/out/util/logger.d.ts +2 -2
  120. package/out/util/webhooks.d.ts +2 -1
  121. package/out/util/webhooks.js +5 -5
  122. package/package.json +1 -1
  123. package/out/handlers/file-processing/file-download.d.ts +0 -4
  124. package/out/handlers/form-data-display.d.ts +0 -3
  125. package/out/handlers/form-data-save.d.ts +0 -3
  126. package/out/handlers/integration/crowdin-files.d.ts +0 -4
  127. package/out/handlers/integration/crowdin-update.d.ts +0 -4
  128. package/out/handlers/integration/crowdin-webhook.d.ts +0 -4
  129. package/out/handlers/integration/integration-data.d.ts +0 -4
  130. package/out/handlers/integration/integration-logout.d.ts +0 -4
  131. package/out/handlers/integration/integration-update.d.ts +0 -4
  132. package/out/handlers/integration/integration-webhook.d.ts +0 -4
  133. package/out/handlers/integration/job-cancel.d.ts +0 -3
  134. package/out/handlers/integration/job-info.d.ts +0 -3
  135. package/out/handlers/integration/main.d.ts +0 -4
  136. package/out/handlers/integration/oauth-login.d.ts +0 -4
  137. package/out/handlers/integration/settings-save.d.ts +0 -4
  138. package/out/handlers/integration/settings.d.ts +0 -3
  139. package/out/handlers/integration/sync-settings-save.d.ts +0 -4
  140. package/out/handlers/integration/sync-settings.d.ts +0 -3
  141. package/out/handlers/integration/user-errors.d.ts +0 -3
  142. package/out/handlers/manifest.d.ts +0 -3
  143. /package/out/{handlers → modules}/form-data-display.js +0 -0
  144. /package/out/{handlers → modules}/form-data-save.js +0 -0
  145. /package/out/{handlers → modules}/install.d.ts +0 -0
  146. /package/out/{handlers → modules}/install.js +0 -0
  147. /package/out/{handlers → modules}/subscription-paid.d.ts +0 -0
  148. /package/out/{handlers → modules}/subscription-paid.js +0 -0
  149. /package/out/{handlers → modules}/uninstall.d.ts +0 -0
  150. /package/out/{handlers → modules}/uninstall.js +0 -0
@@ -38,12 +38,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
38
  exports.listenQueueMessage = exports.updateCrowdinFromWebhookRequest = exports.prepareWebhookData = exports.unregisterAllCrowdinWebhooks = exports.unregisterCrowdinWebhooks = exports.updateCrowdinWebhooks = exports.registerCrowdinWebhook = exports.getAllCrowdinProjectWebhooks = exports.getCrowdinProjectWebhook = exports.unregisterWebhooks = exports.registerWebhooks = exports.makeCrowdinWebhookUrl = exports.decodedUrlParam = exports.encodedUrlParam = exports.HookEvents = void 0;
39
39
  const crowdinAppFunctions = __importStar(require("@crowdin/crowdin-apps-functions"));
40
40
  const amqplib_1 = __importDefault(require("amqplib"));
41
- const models_1 = require("../models");
42
41
  const storage_1 = require("../storage");
43
42
  const connection_1 = require("./connection");
44
43
  const defaults_1 = require("./defaults");
45
44
  const index_1 = require("./index");
46
45
  const logger_1 = require("./logger");
46
+ const types_1 = require("../modules/integration/types");
47
47
  const prefetchCount = 20;
48
48
  const forceProcessDelay = 5000;
49
49
  exports.HookEvents = {
@@ -83,7 +83,7 @@ exports.makeCrowdinWebhookUrl = makeCrowdinWebhookUrl;
83
83
  function registerWebhooks(config, integration, client, crowdinContext, apiCredentials, appSettings) {
84
84
  var _a, _b;
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
- const isWebhookSync = Number(appSettings.schedule) !== models_1.SyncSchedule.DISABLED;
86
+ const isWebhookSync = Number(appSettings.schedule) !== types_1.SyncSchedule.DISABLED;
87
87
  const projectId = crowdinContext.jwtPayload.context.project_id;
88
88
  const urlParam = encodedUrlParam(config, integration, crowdinContext);
89
89
  if ((_a = integration.webhooks) === null || _a === void 0 ? void 0 : _a.crowdinWebhooks) {
@@ -92,7 +92,7 @@ function registerWebhooks(config, integration, client, crowdinContext, apiCreden
92
92
  else {
93
93
  const webhookName = `${config.name} application hook ${crowdinContext.jwtPayload.sub}`;
94
94
  const webhookUrl = makeCrowdinWebhookUrl(config, integration, crowdinContext);
95
- const syncCondition = models_1.SyncCondition[Number(appSettings.condition)];
95
+ const syncCondition = types_1.SyncCondition[Number(appSettings.condition)];
96
96
  const events = [...HookConditionEvents[syncCondition]];
97
97
  const webhook = yield getCrowdinProjectWebhook(config, client, projectId, webhookName);
98
98
  if (appSettings['new-crowdin-files']) {
@@ -250,7 +250,7 @@ function prepareWebhookData(config, integration, webhookUrlParam, provider) {
250
250
  const preparedIntegrationCredentials = yield (0, connection_1.prepareIntegrationCredentials)(config, integration, integrationCredentials);
251
251
  if (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.config) {
252
252
  appSettings = JSON.parse(integrationConfig.config);
253
- const isWebhookSync = Number(appSettings.schedule) !== models_1.SyncSchedule.DISABLED;
253
+ const isWebhookSync = Number(appSettings.schedule) !== types_1.SyncSchedule.DISABLED;
254
254
  if (isWebhookSync) {
255
255
  syncSettings = (yield (0, storage_1.getStorage)().getSyncSettings(clientId, crowdinId, 'schedule', provider));
256
256
  rootFolder = yield (0, defaults_1.getRootFolder)(config, integration, crowdinClient.client, projectId);
@@ -350,7 +350,7 @@ function consumer(channel, config, integration) {
350
350
  webhooksInfo[clientId] = {};
351
351
  webhooksInfo[clientId].data = [data];
352
352
  webhooksInfo[clientId].integration = integration;
353
- webhooksData.push(prepareWebhookData(config, integration, webhookUrlParam, models_1.Provider.INTEGRATION).then((res) => {
353
+ webhooksData.push(prepareWebhookData(config, integration, webhookUrlParam, types_1.Provider.INTEGRATION).then((res) => {
354
354
  webhooksInfo[clientId].webhookData = res;
355
355
  }));
356
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.43.1",
3
+ "version": "0.44.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",
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Request, Response } from 'express';
3
- import { Config, FileProcessLogic } from '../../models';
4
- export default function handle(config: Config, processingConfig: FileProcessLogic, folderName: string): (req: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Request, Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { IntegrationLogic } from '../../models';
4
- export default function handle(integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Request, Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Request, Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,4 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- import { Config, IntegrationLogic } from '../../models';
4
- export default function handle(config: Config, integration: IntegrationLogic): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- /// <reference types="qs" />
2
- import { Response } from 'express';
3
- export default function handle(): (req: import("../../models").CrowdinClientRequest | import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: Function) => void;
@@ -1,3 +0,0 @@
1
- import { Request, Response } from 'express';
2
- import { Config } from '../models';
3
- export default function handle(config: Config): (_req: Request, res: Response) => void;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes