@crowdin/app-project-module 0.43.0 → 0.43.1

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.
@@ -497,7 +497,7 @@ class MySQLStorage {
497
497
  const id = (0, uuid_1.v4)();
498
498
  yield this.dbPromise;
499
499
  yield this.executeQuery((connection) => connection.execute(`
500
- INSERT INTO jobs(id, integration_id, crowdin_id, type, payload, title, created_at)
500
+ INSERT INTO job(id, integration_id, crowdin_id, type, payload, title, created_at)
501
501
  VALUES (?, ?, ?, ?, ?, ?, ?)
502
502
  `, [id, integrationId, crowdinId, type, payload, title, Date.now().toString()]));
503
503
  return id;
@@ -167,10 +167,9 @@ class PostgreStorage {
167
167
  integration_id varchar not null,
168
168
  crowdin_id varchar not null,
169
169
  type varchar not null,
170
- payload varchar null,
171
170
  title varchar null,
172
- progress int 0,
173
- status varchar '${job_1.JobStatus.CREATED}',
171
+ progress int default 0,
172
+ status varchar default '${job_1.JobStatus.CREATED}',
174
173
  payload varchar null,
175
174
  info varchar null,
176
175
  data varchar null,
@@ -502,7 +501,10 @@ class PostgreStorage {
502
501
  updateIntegrationConfig(integrationId, config) {
503
502
  return __awaiter(this, void 0, void 0, function* () {
504
503
  yield this.dbPromise;
505
- yield this.executeQuery((client) => client.query('UPDATE integration_settings SET config = $1 WHERE id = $2', [config, integrationId]));
504
+ yield this.executeQuery((client) => client.query('UPDATE integration_settings SET config = $1 WHERE integration_id = $2', [
505
+ config,
506
+ integrationId,
507
+ ]));
506
508
  });
507
509
  }
508
510
  createJob({ integrationId, crowdinId, type, payload, title }) {
@@ -543,7 +545,7 @@ class PostgreStorage {
543
545
  }
544
546
  if (info) {
545
547
  updateFields.push('info = $' + updateParams.length.toString());
546
- updateParams.push(data);
548
+ updateParams.push(info);
547
549
  }
548
550
  updateParams.push(id);
549
551
  yield this.dbPromise;
@@ -561,7 +563,7 @@ class PostgreStorage {
561
563
  const res = yield client.query(`
562
564
  SELECT id, integration_id as integrationId, crowdin_id as crowdinId, type, payload, progress, status,
563
565
  title, info, payload, data, created_at as createdAt, updated_at as updatedAt, finished_at as finishedAt
564
- FROM jobs
566
+ FROM job
565
567
  WHERE id = $1
566
568
  `, [id]);
567
569
  return res === null || res === void 0 ? void 0 : res.rows[0];
@@ -575,7 +577,7 @@ class PostgreStorage {
575
577
  const res = yield client.query(`
576
578
  SELECT id, integration_id as integrationId, crowdin_id as crowdinId, type, payload, progress, status,
577
579
  title, info, payload, data, created_at as createdAt, updated_at as updatedAt, finished_at as finishedAt
578
- FROM jobs
580
+ FROM job
579
581
  WHERE integration_id = $1 AND crowdin_id = $2 AND finished_at is NULL
580
582
  `, [integrationId, crowdinId]);
581
583
  return (res === null || res === void 0 ? void 0 : res.rows) || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.43.0",
3
+ "version": "0.43.1",
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",