@crowdin/app-project-module 0.18.0 → 0.18.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.
@@ -4,7 +4,7 @@ export interface SQLiteStorageConfig {
4
4
  dbFolder: string;
5
5
  }
6
6
  export declare class SQLiteStorage implements Storage<SQLiteStorageConfig> {
7
- private db?;
7
+ private db;
8
8
  private _res?;
9
9
  private _rej?;
10
10
  private dbPromise;
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/camelcase */
3
3
  /* eslint-disable @typescript-eslint/ban-ts-ignore */
4
4
  /* eslint-disable no-unused-expressions */
5
+ /* eslint-disable @typescript-eslint/no-var-requires */
5
6
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
7
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
8
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -11,13 +12,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
12
  step((generator = generator.apply(thisArg, _arguments || [])).next());
12
13
  });
13
14
  };
14
- var __importDefault = (this && this.__importDefault) || function (mod) {
15
- return (mod && mod.__esModule) ? mod : { "default": mod };
16
- };
17
15
  Object.defineProperty(exports, "__esModule", { value: true });
18
16
  exports.SQLiteStorage = void 0;
19
17
  const path_1 = require("path");
20
- const sqlite3_1 = __importDefault(require("sqlite3"));
21
18
  class SQLiteStorage {
22
19
  constructor() {
23
20
  this.dbPromise = new Promise((res, rej) => {
@@ -29,6 +26,7 @@ class SQLiteStorage {
29
26
  return __awaiter(this, void 0, void 0, function* () {
30
27
  yield new Promise((res, rej) => {
31
28
  var _a;
29
+ //@ts-ignore
32
30
  (_a = this.db) === null || _a === void 0 ? void 0 : _a.run(query, params, err => {
33
31
  if (err) {
34
32
  rej(err);
@@ -45,6 +43,7 @@ class SQLiteStorage {
45
43
  yield this.dbPromise;
46
44
  yield new Promise((res, rej) => {
47
45
  var _a;
46
+ //@ts-ignore
48
47
  (_a = this.db) === null || _a === void 0 ? void 0 : _a.run(query, params, err => {
49
48
  if (err) {
50
49
  rej(err);
@@ -61,6 +60,7 @@ class SQLiteStorage {
61
60
  yield this.dbPromise;
62
61
  return new Promise((res, rej) => {
63
62
  var _a;
63
+ //@ts-ignore
64
64
  (_a = this.db) === null || _a === void 0 ? void 0 : _a.get(query, params, (err, row) => {
65
65
  if (err) {
66
66
  rej(err);
@@ -78,7 +78,9 @@ class SQLiteStorage {
78
78
  return new Promise((res, rej) => {
79
79
  var _a;
80
80
  const result = [];
81
- (_a = this.db) === null || _a === void 0 ? void 0 : _a.each(query, params, (err, row) => {
81
+ (_a = this.db) === null || _a === void 0 ? void 0 : _a.each(query, params,
82
+ //@ts-ignore
83
+ (err, row) => {
82
84
  if (err) {
83
85
  rej(err);
84
86
  }
@@ -113,7 +115,9 @@ class SQLiteStorage {
113
115
  _connection_res = res;
114
116
  _connection_rej = rej;
115
117
  });
116
- this.db = new sqlite3_1.default.Database((0, path_1.join)(config.dbFolder, 'app.sqlite'), error => {
118
+ const sqlite = require('sqlite3');
119
+ //@ts-ignore
120
+ this.db = new sqlite.Database((0, path_1.join)(config.dbFolder, 'app.sqlite'), error => {
117
121
  if (error) {
118
122
  _connection_rej(error);
119
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.18.0",
3
+ "version": "0.18.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",