nest-knexjs 0.0.23 → 0.0.24

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.
@@ -39,6 +39,10 @@ jobs:
39
39
  uses: actions/setup-node@v4
40
40
  with:
41
41
  node-version: ${{ matrix.node-version }}
42
+ - name: Install Docker Compose
43
+ run: |
44
+ sudo apt-get update
45
+ sudo apt-get install -y docker-compose
42
46
  - name: Start Docker-Compose
43
47
  run: cd tests && docker-compose up -d
44
48
  - name: Install npm
@@ -51,4 +55,4 @@ jobs:
51
55
  - name: Run tests e2e
52
56
  run: npm run test:e2e
53
57
  - name: Stop Docker-Compose
54
- run: cd tests && docker-compose down
58
+ run: cd tests && docker-compose down
package/.husky/commit-msg CHANGED
@@ -1,4 +1,3 @@
1
1
  #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
2
 
4
3
  npx --no-install commitlint --edit $1
package/.husky/pre-commit CHANGED
@@ -1,4 +1,3 @@
1
1
  #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
2
 
4
3
  npx lint-staged
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateString = exports.getConnectionName = exports.handleRetry = exports.getConnectionPrefix = exports.getConnectionToken = exports.getModelToken = void 0;
3
+ exports.generateString = void 0;
4
+ exports.getModelToken = getModelToken;
5
+ exports.getConnectionToken = getConnectionToken;
6
+ exports.getConnectionPrefix = getConnectionPrefix;
7
+ exports.handleRetry = handleRetry;
8
+ exports.getConnectionName = getConnectionName;
4
9
  const knex_constants_1 = require("../knex.constants");
5
10
  const operators_1 = require("rxjs/operators");
6
11
  const node_crypto_1 = require("node:crypto");
@@ -20,14 +25,12 @@ function getModelToken(model, connection = knex_constants_1.DEFAULT_CONNECTION_N
20
25
  const connectionPrefix = getConnectionPrefix(connection);
21
26
  return `${connectionPrefix}${model.name}`;
22
27
  }
23
- exports.getModelToken = getModelToken;
24
28
  function getConnectionToken(connection = knex_constants_1.DEFAULT_CONNECTION_NAME) {
25
29
  if (typeof connection === 'string') {
26
30
  return connection;
27
31
  }
28
32
  return `${connection.name || knex_constants_1.DEFAULT_CONNECTION_NAME}`;
29
33
  }
30
- exports.getConnectionToken = getConnectionToken;
31
34
  /**
32
35
  * This function returns a Connection prefix based on the connection name
33
36
  * @param {KnexModuleOptions | string} [connection='default'] This optional parameter is either
@@ -46,7 +49,6 @@ function getConnectionPrefix(connection = knex_constants_1.DEFAULT_CONNECTION_NA
46
49
  }
47
50
  return connection.name + '_';
48
51
  }
49
- exports.getConnectionPrefix = getConnectionPrefix;
50
52
  function handleRetry(retryAttempts = 9, retryDelay = 3000) {
51
53
  return (source) => source.pipe((0, operators_1.retryWhen)((e) => e.pipe((0, operators_1.scan)((errorCount, error) => {
52
54
  logger.error(`Unable to connect to the database. Retrying (${errorCount + 1})...`, error.stack);
@@ -56,10 +58,8 @@ function handleRetry(retryAttempts = 9, retryDelay = 3000) {
56
58
  return errorCount + 1;
57
59
  }, 0), (0, operators_1.delay)(retryDelay))));
58
60
  }
59
- exports.handleRetry = handleRetry;
60
61
  function getConnectionName(options) {
61
62
  return options && options.name ? options.name : knex_constants_1.DEFAULT_CONNECTION_NAME;
62
63
  }
63
- exports.getConnectionName = getConnectionName;
64
64
  const generateString = () => (0, node_crypto_1.randomUUID)();
65
65
  exports.generateString = generateString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-knexjs",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Knexjs module for Nest framework (node.js) 😻",
5
5
  "author": "Tony133",
6
6
  "license": "MIT",
@@ -19,33 +19,33 @@
19
19
  "prepare": "husky"
20
20
  },
21
21
  "devDependencies": {
22
- "@commitlint/cli": "19.3.0",
23
- "@commitlint/config-angular": "19.3.0",
24
- "@nestjs/common": "10.3.9",
25
- "@nestjs/core": "10.3.9",
22
+ "@commitlint/cli": "19.5.0",
23
+ "@commitlint/config-angular": "19.5.0",
24
+ "@nestjs/common": "10.4.4",
25
+ "@nestjs/core": "10.4.4",
26
26
  "@nestjs/platform-fastify": "^10.3.7",
27
- "@nestjs/testing": "10.3.9",
28
- "@types/jest": "29.5.12",
29
- "@types/node": "20.14.2",
27
+ "@nestjs/testing": "10.4.4",
28
+ "@types/jest": "29.5.13",
29
+ "@types/node": "22.7.4",
30
30
  "@types/supertest": "6.0.2",
31
- "@typescript-eslint/eslint-plugin": "7.13.0",
32
- "@typescript-eslint/parser": "7.13.0",
33
- "eslint": "8.57.0",
31
+ "@typescript-eslint/eslint-plugin": "8.8.0",
32
+ "@typescript-eslint/parser": "8.8.0",
33
+ "eslint": "9.12.0",
34
34
  "eslint-config-prettier": "9.1.0",
35
- "eslint-plugin-import": "2.29.1",
36
- "husky": "9.0.11",
35
+ "eslint-plugin-import": "2.31.0",
36
+ "husky": "9.1.6",
37
37
  "jest": "29.7.0",
38
38
  "knex": "3.1.0",
39
39
  "mysql": "2.18.1",
40
- "prettier": "3.3.2",
40
+ "prettier": "3.3.3",
41
41
  "reflect-metadata": "0.2.2",
42
- "release-it": "17.3.0",
42
+ "release-it": "17.7.0",
43
43
  "rxjs": "7.8.1",
44
44
  "supertest": "7.0.0",
45
- "ts-jest": "29.1.4",
45
+ "ts-jest": "29.2.5",
46
46
  "ts-node": "10.9.2",
47
47
  "tsconfig-paths": "4.2.0",
48
- "typescript": "5.4.5"
48
+ "typescript": "5.6.2"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",