@crowdin/app-project-module 0.67.0 → 0.68.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 (37) hide show
  1. package/out/index.js +25 -10
  2. package/out/middlewares/crowdin-client.d.ts +13 -2
  3. package/out/middlewares/crowdin-client.js +17 -3
  4. package/out/middlewares/ui-module.d.ts +5 -1
  5. package/out/middlewares/ui-module.js +5 -1
  6. package/out/modules/ai-prompt-provider/index.js +7 -2
  7. package/out/modules/ai-provider/index.js +13 -3
  8. package/out/modules/ai-provider/types.d.ts +2 -2
  9. package/out/modules/ai-tools/index.js +7 -2
  10. package/out/modules/ai-tools/types.d.ts +2 -2
  11. package/out/modules/api/api.js +66 -11
  12. package/out/modules/context-menu/index.js +1 -1
  13. package/out/modules/custom-mt/index.js +6 -1
  14. package/out/modules/custom-mt/types.d.ts +4 -2
  15. package/out/modules/custom-spell-check/index.js +14 -4
  16. package/out/modules/custom-spell-check/types.d.ts +2 -2
  17. package/out/modules/editor-right-panel/index.js +1 -1
  18. package/out/modules/external-qa-check/index.js +7 -2
  19. package/out/modules/external-qa-check/types.d.ts +2 -2
  20. package/out/modules/file-processing/index.js +30 -5
  21. package/out/modules/file-processing/types.d.ts +3 -2
  22. package/out/modules/file-processing/util/files.d.ts +1 -0
  23. package/out/modules/integration/index.js +108 -18
  24. package/out/modules/integration/types.d.ts +2 -2
  25. package/out/modules/manifest.js +48 -22
  26. package/out/modules/modal/index.js +1 -1
  27. package/out/modules/organization-menu/index.js +1 -1
  28. package/out/modules/profile-resources-menu/index.js +1 -1
  29. package/out/modules/project-menu/index.js +1 -1
  30. package/out/modules/project-menu-crowdsource/index.js +1 -1
  31. package/out/modules/project-reports/index.js +1 -1
  32. package/out/modules/project-tools/index.js +1 -1
  33. package/out/static/js/form.js +10 -10
  34. package/out/types.d.ts +8 -2
  35. package/out/util/index.d.ts +0 -1
  36. package/out/util/index.js +1 -9
  37. package/package.json +10 -10
package/out/types.d.ts CHANGED
@@ -318,7 +318,7 @@ interface ModuleContent {
318
318
  url?: string;
319
319
  }
320
320
  export interface CrowdinAppUtilities extends CrowdinMetadataStore {
321
- establishCrowdinConnection: (authRequest: string | CrowdinClientRequest) => Promise<{
321
+ establishCrowdinConnection: (authRequest: string | CrowdinClientRequest, moduleKey: string[] | string | undefined) => Promise<{
322
322
  context: CrowdinContextInfo;
323
323
  client?: Crowdin;
324
324
  }>;
@@ -340,7 +340,7 @@ export interface CrowdinMetadataStore {
340
340
  */
341
341
  getUserSettings: (clientId: string) => Promise<any | undefined>;
342
342
  }
343
- export interface UiModule {
343
+ export interface UiModule extends ModuleKey {
344
344
  /**
345
345
  * Form schema for react-jsonschema-doc to be used as front-end
346
346
  * https://rjsf-team.github.io/react-jsonschema-form/docs
@@ -377,6 +377,12 @@ export interface UiModule {
377
377
  */
378
378
  maskPasswords?: boolean;
379
379
  }
380
+ export interface ModuleKey {
381
+ /**
382
+ * key to identify module
383
+ */
384
+ key?: string;
385
+ }
380
386
  export interface ImagePath {
381
387
  /**
382
388
  * path to app logo (e.g. {@example join(__dirname, 'logo.png')})
@@ -10,7 +10,6 @@ export declare function decryptData(config: Config, data: string): string;
10
10
  export declare function executeWithRetry<T>(func: () => Promise<T>, numOfRetries?: number): Promise<T>;
11
11
  export declare function getLogoUrl(moduleConfig?: ImagePath, modulePath?: string): string;
12
12
  export declare function isAuthorizedConfig(config: Config | UnauthorizedConfig): config is Config;
13
- export declare function hasFormSchema(moduleConfig: any): boolean;
14
13
  export declare function isJson(string: string): boolean;
15
14
  export declare function getPreviousDate(days: number): Date;
16
15
  export declare function prepareFormDataMetadataId(req: CrowdinClientRequest, config: Config): Promise<string>;
package/out/util/index.js CHANGED
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
32
  });
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.prepareFormDataMetadataId = exports.getPreviousDate = exports.isJson = exports.hasFormSchema = exports.isAuthorizedConfig = exports.getLogoUrl = exports.executeWithRetry = exports.decryptData = exports.encryptData = exports.runAsyncWrapper = exports.CodeError = void 0;
35
+ exports.prepareFormDataMetadataId = exports.getPreviousDate = exports.isJson = exports.isAuthorizedConfig = exports.getLogoUrl = exports.executeWithRetry = exports.decryptData = exports.encryptData = exports.runAsyncWrapper = exports.CodeError = void 0;
36
36
  const crypto = __importStar(require("crypto-js"));
37
37
  const storage_1 = require("../storage");
38
38
  const types_1 = require("../types");
@@ -119,14 +119,6 @@ function isAuthorizedConfig(config) {
119
119
  return !!config.clientId && !!config.clientSecret && config.authenticationType !== types_1.AuthenticationType.NONE;
120
120
  }
121
121
  exports.isAuthorizedConfig = isAuthorizedConfig;
122
- function hasFormSchema(moduleConfig) {
123
- var _a;
124
- if (typeof moduleConfig === 'object' && moduleConfig !== null) {
125
- return moduleConfig.formSchema || ((_a = moduleConfig.settingsUiModule) === null || _a === void 0 ? void 0 : _a.formSchema);
126
- }
127
- return false;
128
- }
129
- exports.hasFormSchema = hasFormSchema;
130
122
  function isJson(string) {
131
123
  try {
132
124
  JSON.parse(string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.67.0",
3
+ "version": "0.68.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",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@aws-sdk/client-s3": "^3.606.0",
22
22
  "@aws-sdk/s3-request-presigner": "^3.598.0",
23
- "@crowdin/crowdin-apps-functions": "0.8.1",
23
+ "@crowdin/crowdin-apps-functions": "0.9.0",
24
24
  "@crowdin/logs-formatter": "^2.1.6",
25
25
  "@godaddy/terminus": "^4.12.1",
26
26
  "amqplib": "^0.10.4",
@@ -31,7 +31,7 @@
31
31
  "lodash.uniqby": "^4.7.0",
32
32
  "mysql2": "^3.10.2",
33
33
  "node-cron": "^3.0.3",
34
- "pg": "^8.11.5",
34
+ "pg": "^8.13.0",
35
35
  "redoc-express": "^2.1.0",
36
36
  "sqlite3": "^5.1.7",
37
37
  "swagger-jsdoc": "^6.2.8",
@@ -43,14 +43,14 @@
43
43
  "@emotion/styled": "^11.11.5",
44
44
  "@mui/icons-material": "^5.16.7",
45
45
  "@mui/material": "^5.16.7",
46
- "@rjsf/core": "^5.20.1",
47
- "@rjsf/mui": "^5.20.1",
48
- "@rjsf/utils": "^5.18.4",
49
- "@rjsf/validator-ajv8": "^5.20.1",
46
+ "@rjsf/core": "^5.21.1",
47
+ "@rjsf/mui": "^5.21.1",
48
+ "@rjsf/utils": "^5.21.1",
49
+ "@rjsf/validator-ajv8": "^5.21.1",
50
50
  "@rollup/plugin-babel": "^6.0.4",
51
51
  "@rollup/plugin-commonjs": "^24.1.0",
52
52
  "@rollup/plugin-json": "^6.1.0",
53
- "@rollup/plugin-node-resolve": "^15.2.3",
53
+ "@rollup/plugin-node-resolve": "^15.3.0",
54
54
  "@rollup/plugin-replace": "^5.0.7",
55
55
  "@rollup/plugin-terser": "^0.4.3",
56
56
  "@types/amqplib": "^0.10.4",
@@ -60,9 +60,9 @@
60
60
  "@types/jest": "^29.5.12",
61
61
  "@types/lodash.get": "^4.4.9",
62
62
  "@types/lodash.uniqby": "^4.7.9",
63
- "@types/node": "^16.18.101",
63
+ "@types/node": "^16.18.112",
64
64
  "@types/node-cron": "^3.0.11",
65
- "@types/pg": "^8.11.6",
65
+ "@types/pg": "^8.11.10",
66
66
  "@types/swagger-jsdoc": "^6.0.4",
67
67
  "@types/uuid": "^9.0.7",
68
68
  "@typescript-eslint/eslint-plugin": "^2.3.1",