@crowdin/app-project-module 1.0.2 → 1.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.
@@ -6,5 +6,9 @@ declare function getRequestCredentialsMasker({ moduleConfig, dataPath, }: {
6
6
  moduleConfig?: UiModule;
7
7
  dataPath?: string;
8
8
  }): (req: Request | CrowdinClientRequest, res: Response, next: Function) => any;
9
- declare function postRequestCredentialsMasker(moduleConfig?: UiModule, credentialsExtractor?: Function): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
9
+ declare function postRequestCredentialsMasker({ secret, moduleConfig, credentialsExtractor, }: {
10
+ secret: string;
11
+ moduleConfig: UiModule;
12
+ credentialsExtractor?: Function;
13
+ }): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | CrowdinClientRequest, res: Response<any, Record<string, any>>, next: Function) => void;
10
14
  export { getRequestCredentialsMasker, maskKey, postRequestCredentialsMasker };
@@ -62,7 +62,7 @@ function getRequestCredentialsMasker({ moduleConfig, dataPath = 'formData', }) {
62
62
  };
63
63
  }
64
64
  exports.getRequestCredentialsMasker = getRequestCredentialsMasker;
65
- function postRequestCredentialsMasker(moduleConfig, credentialsExtractor) {
65
+ function postRequestCredentialsMasker({ secret, moduleConfig, credentialsExtractor, }) {
66
66
  return (0, index_2.runAsyncWrapper)((req, res, next) => __awaiter(this, void 0, void 0, function* () {
67
67
  var _a;
68
68
  if (req.__credentialsMaskerApplied) {
@@ -80,7 +80,7 @@ function postRequestCredentialsMasker(moduleConfig, credentialsExtractor) {
80
80
  else {
81
81
  // most common way of storing data
82
82
  const jwtToken = (0, crowdin_client_1.getToken)(req) || '';
83
- const jwtPayload = yield (0, crowdin_apps_functions_1.validateJwtToken)(jwtToken, process.env.CROWDIN_CLIENT_SECRET || '');
83
+ const jwtPayload = yield (0, crowdin_apps_functions_1.validateJwtToken)(jwtToken, secret);
84
84
  const crowdinId = `${jwtPayload.context.organization_id}`;
85
85
  unmaskedFields = yield index_1.metadataStore.getMetadata(`form-data-${crowdinId}`);
86
86
  }
@@ -24,5 +24,5 @@ const FormPage = ({ formGetDataUrl, formPostDataUrl, formPatchDataUrl, formSchem
24
24
  var formUiSchema = ${formUiSchema};
25
25
  `,
26
26
  } }),
27
- react_1.default.createElement("script", { src: "/assets/js/form.js" }))));
27
+ react_1.default.createElement("script", { src: "/assets/ui/form.bundle.js" }))));
28
28
  exports.FormPage = FormPage;
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "1.0.2",
3
+ "version": "1.1.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",
7
7
  "scripts": {
8
- "build": "npm run build-main && npm run build-form && npm run build-ui",
8
+ "build": "npm run build-main && npm run build-ui",
9
9
  "build-main": "tsc -p ./ && cp -R static out && cp logo.png out",
10
- "build-form": "rollup -c rollup-form.config.mjs",
11
10
  "build-ui": "rollup -c rollup-ui.config.mjs",
12
11
  "watch-main": "tsc --watch -p ./ && cp -R static out && cp logo.png out",
13
12
  "lint": "eslint --fix \"{src,tests,ui}/**/*.{js,ts,tsx}\"",
@@ -65,13 +64,10 @@
65
64
  "@rjsf/mui": "^5.24.3",
66
65
  "@rjsf/utils": "^5.24.3",
67
66
  "@rjsf/validator-ajv8": "^5.24.3",
68
- "@rollup/plugin-babel": "^6.0.4",
69
67
  "@rollup/plugin-commonjs": "^24.1.0",
70
68
  "@rollup/plugin-json": "^6.1.0",
71
- "@rollup/plugin-multi-entry": "^6.0.1",
72
69
  "@rollup/plugin-node-resolve": "^15.3.1",
73
70
  "@rollup/plugin-replace": "^5.0.7",
74
- "@rollup/plugin-terser": "^0.4.4",
75
71
  "@rollup/plugin-typescript": "12.3.0",
76
72
  "@types/amqplib": "^0.10.7",
77
73
  "@types/crypto-js": "^4.2.2",
@@ -94,7 +90,6 @@
94
90
  "jest-junit": "^15.0.0",
95
91
  "prettier": "^3.7.4",
96
92
  "rollup": "^3.29.4",
97
- "rollup-plugin-delete": "^2.1.0",
98
93
  "ts-jest": "^29.2.5",
99
94
  "typescript": "^4.9.5",
100
95
  "crypto-js": "^4.2.0"