@crowdin/app-project-module 0.76.0 → 0.76.2

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.
@@ -123,7 +123,7 @@ function createDumpForMigration(config) {
123
123
  modifiedContent = modifiedContent.replace(/integer not null primary key autoincrement/gi, 'serial primary key');
124
124
  modifiedContent = modifiedContent.replace(/varchar not null primary key/gi, 'varchar primary key');
125
125
  // 6. Remove SQLite-specific function replace()
126
- modifiedContent = modifiedContent.replace(/replace\s*\('([^']+?)',\s*'?\\[rn]'?\s*,\s*char\s*\([0-9]+\)\s*\)/gi, "'$1'");
126
+ modifiedContent = modifiedContent.replace(/replace\s*\(\s*'([^']*(?:'{2}[^']*)*)',\s*'\\n',\s*char\s*\(\s*10\s*\)\s*\)/gi, "'$1'");
127
127
  fs_1.default.writeFileSync(dumpFilePath, modifiedContent, { encoding: 'utf8', flag: 'w' });
128
128
  }
129
129
  fs_1.default.renameSync(sqliteFilePath, backupFilePath);
@@ -532,7 +532,7 @@ class MySQLStorage {
532
532
  const updateParams = [Date.now().toString()];
533
533
  if (progress) {
534
534
  updateFields.push('progress = ?');
535
- updateParams.push(progress);
535
+ updateParams.push(Math.round(progress));
536
536
  if (progress >= 100) {
537
537
  updateFields.push('finished_at = ?');
538
538
  updateParams.push(Date.now().toString());
@@ -571,42 +571,51 @@ class PostgreStorage {
571
571
  }
572
572
  updateJob({ id, progress, status, info, data, attempt }) {
573
573
  return __awaiter(this, void 0, void 0, function* () {
574
- const updateFields = ['updated_at'];
574
+ let parametersPointer = 1;
575
+ const updateFields = [`updated_at = $${parametersPointer}`];
575
576
  const updateParams = [Date.now().toString()];
576
577
  if (progress) {
577
- updateFields.push('progress = $' + updateParams.length.toString());
578
- updateParams.push(progress);
578
+ parametersPointer++;
579
+ updateFields.push('progress = $' + parametersPointer);
580
+ updateParams.push(Math.round(progress));
579
581
  if (progress >= 100) {
580
- updateFields.push('finished_at = $' + updateParams.length.toString());
582
+ parametersPointer++;
583
+ updateFields.push('finished_at = $' + parametersPointer);
581
584
  updateParams.push(Date.now().toString());
582
585
  }
583
586
  }
584
587
  if (status) {
585
- updateFields.push('status = $' + updateParams.length.toString());
588
+ parametersPointer++;
589
+ updateFields.push('status = $' + parametersPointer);
586
590
  updateParams.push(status);
587
591
  if ((!progress || progress <= 100) && [types_2.JobStatus.FAILED, types_2.JobStatus.CANCELED].includes(status)) {
588
- updateFields.push('finished_at = $' + updateParams.length.toString());
592
+ parametersPointer++;
593
+ updateFields.push('finished_at = $' + parametersPointer);
589
594
  updateParams.push(Date.now().toString());
590
595
  }
591
596
  }
592
597
  if (data) {
593
- updateFields.push('data = $' + updateParams.length.toString());
598
+ parametersPointer++;
599
+ updateFields.push('data = $' + parametersPointer);
594
600
  updateParams.push(data);
595
601
  }
596
602
  if (info) {
597
- updateFields.push('info = $' + updateParams.length.toString());
603
+ parametersPointer++;
604
+ updateFields.push('info = $' + parametersPointer);
598
605
  updateParams.push(info);
599
606
  }
600
607
  if (attempt) {
601
- updateFields.push('attempt = $' + updateParams.length.toString());
608
+ parametersPointer++;
609
+ updateFields.push('attempt = $' + parametersPointer);
602
610
  updateParams.push(attempt);
603
611
  }
612
+ parametersPointer++;
604
613
  updateParams.push(id);
605
614
  yield this.dbPromise;
606
615
  yield this.executeQuery((client) => client.query(`
607
616
  UPDATE job
608
617
  SET ${updateFields.join(', ')}
609
- WHERE id = $${updateParams.length.toString()}
618
+ WHERE id = $${parametersPointer}
610
619
  `, updateParams));
611
620
  });
612
621
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.76.0",
3
+ "version": "0.76.2",
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",
@@ -43,14 +43,14 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@babel/preset-react": "^7.24.7",
46
- "@emotion/react": "^11.13.5",
47
- "@emotion/styled": "^11.11.5",
48
- "@mui/icons-material": "^5.16.13",
49
- "@mui/material": "^5.16.13",
50
- "@rjsf/core": "^5.23.2",
51
- "@rjsf/mui": "^5.23.2",
46
+ "@emotion/react": "^11.14.0",
47
+ "@emotion/styled": "^11.14.0",
48
+ "@mui/icons-material": "^5.16.14",
49
+ "@mui/material": "^5.16.14",
50
+ "@rjsf/core": "^5.24.2",
51
+ "@rjsf/mui": "^5.24.2",
52
52
  "@rjsf/utils": "^5.23.2",
53
- "@rjsf/validator-ajv8": "^5.23.2",
53
+ "@rjsf/validator-ajv8": "^5.24.2",
54
54
  "@rollup/plugin-babel": "^6.0.4",
55
55
  "@rollup/plugin-commonjs": "^24.1.0",
56
56
  "@rollup/plugin-json": "^6.1.0",