@rsdk/db.knex 4.0.0-next.2 → 4.0.0-next.3

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.0-next.3](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.2...v4.0.0-next.3) (2023-11-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ * all yarn peers dependency issues ([e0db9ef](https://github.com/R-Vision/rsdk/commit/e0db9ef1ab8a4df4e1f8ff6f6a9e3728f497549b))
11
+ * one HEALTH_CHECK_QUERY + log it with trace level ([c6765da](https://github.com/R-Vision/rsdk/commit/c6765daedfec2e74230cc99234609dc57e2f39c3))
12
+
6
13
  ## [4.0.0-next.2](https://github.com/R-Vision/rsdk/compare/v4.0.0-next.1...v4.0.0-next.2) (2023-11-10)
7
14
 
8
15
  **Note:** Version bump only for package @rsdk/db.knex
@@ -1,5 +1,9 @@
1
1
  import { ILogger } from '@rsdk/logging';
2
2
  import type { Knex } from 'knex';
3
+ /**
4
+ * TODO: Как здесь понять, что распечатываться будет HEALTH_CHECK_QUERY?
5
+ * Нужно потестить.
6
+ */
3
7
  export declare class KnexLoggerAdapter implements Knex.Logger {
4
8
  private readonly platformLogger;
5
9
  constructor(platformLogger: ILogger);
@@ -14,6 +14,10 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.KnexLoggerAdapter = void 0;
16
16
  const core_1 = require("@rsdk/core");
17
+ /**
18
+ * TODO: Как здесь понять, что распечатываться будет HEALTH_CHECK_QUERY?
19
+ * Нужно потестить.
20
+ */
17
21
  let KnexLoggerAdapter = class KnexLoggerAdapter {
18
22
  platformLogger;
19
23
  constructor(platformLogger) {
@@ -1 +1 @@
1
- {"version":3,"file":"knex-logger.adapter.js","sourceRoot":"","sources":["../../src/providers/knex-logger.adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAA0C;AAI1C,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAEwB;IADpD,YACoD,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QAEzE,4GAA4G;QAC5G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,OAAY;QACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,OAAY;QAChB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,OAAY;QAChB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,WAAmB;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,MAAM,UAAU,WAAW,EAAE,CAAC,CAAC;IACxE,CAAC;CACF,CAAA;AA3BY,8CAAiB;4BAAjB,iBAAiB;IAEzB,WAAA,IAAA,mBAAY,EAAC,iBAAiB,CAAC,CAAA;;GAFvB,iBAAiB,CA2B7B"}
1
+ {"version":3,"file":"knex-logger.adapter.js","sourceRoot":"","sources":["../../src/providers/knex-logger.adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCAA0C;AAI1C;;;GAGG;AAEH,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAEwB;IADpD,YACoD,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QAEzE,4GAA4G;QAC5G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,OAAY;QACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,OAAY;QAChB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,OAAY;QAChB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,CAAC,MAAc,EAAE,WAAmB;QAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,MAAM,UAAU,WAAW,EAAE,CAAC,CAAC;IACxE,CAAC;CACF,CAAA;AA3BY,8CAAiB;4BAAjB,iBAAiB;IAEzB,WAAA,IAAA,mBAAY,EAAC,iBAAiB,CAAC,CAAA;;GAFvB,iBAAiB,CA2B7B"}
@@ -14,7 +14,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.KnexIndicator = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
+ const common_2 = require("@rsdk/common");
17
18
  const core_1 = require("@rsdk/core");
19
+ const db_1 = require("@rsdk/db");
18
20
  const knex_1 = require("knex");
19
21
  const inject_knex_decorator_1 = require("../inject-knex.decorator");
20
22
  let KnexIndicator = class KnexIndicator {
@@ -24,10 +26,11 @@ let KnexIndicator = class KnexIndicator {
24
26
  }
25
27
  async check() {
26
28
  try {
27
- await this.knex.raw('SELECT 1');
28
- return core_1.CheckResult.up({});
29
+ await this.knex.raw(db_1.HEALTH_CHECK_QUERY);
30
+ return core_1.CheckResult.up({ query: db_1.HEALTH_CHECK_QUERY });
29
31
  }
30
32
  catch (error) {
33
+ common_2.Assert.isError(error);
31
34
  return core_1.CheckResult.down({ error: error.message });
32
35
  }
33
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"knex.indicator.js","sourceRoot":"","sources":["../../src/providers/knex.indicator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAE5C,qCAAoD;AACpD,+BAA4B;AAE5B,oEAAsD;AAI/C,IAAM,aAAa,GAAnB,MAAM,aAAa;IACmB;IAA3C,YAA2C,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAElD,KAAK,CAAC,KAAK;QAChB,IAAI;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAEhC,OAAO,kBAAW,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAc,EAAE;YACvB,OAAO,kBAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;SAC9D;IACH,CAAC;CACF,CAAA;AAZY,sCAAa;wBAAb,aAAa;IAFzB,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAS,EAAC,MAAM,CAAC;IAEH,WAAA,IAAA,kCAAU,GAAE,CAAA;;GADd,aAAa,CAYzB"}
1
+ {"version":3,"file":"knex.indicator.js","sourceRoot":"","sources":["../../src/providers/knex.indicator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yCAAsC;AAEtC,qCAAoD;AACpD,iCAA8C;AAC9C,+BAA4B;AAE5B,oEAAsD;AAI/C,IAAM,aAAa,GAAnB,MAAM,aAAa;IACmB;IAA3C,YAA2C,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAElD,KAAK,CAAC,KAAK;QAChB,IAAI;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAkB,CAAC,CAAC;YAExC,OAAO,kBAAW,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,uBAAkB,EAAE,CAAC,CAAC;SACtD;QAAC,OAAO,KAAc,EAAE;YACvB,eAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACtB,OAAO,kBAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;SACnD;IACH,CAAC;CACF,CAAA;AAbY,sCAAa;wBAAb,aAAa;IAFzB,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAS,EAAC,MAAM,CAAC;IAEH,WAAA,IAAA,kCAAU,GAAE,CAAA;;GADd,aAAa,CAazB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdk/db.knex",
3
- "version": "4.0.0-next.2",
3
+ "version": "4.0.0-next.3",
4
4
  "description": "Knex integration for platform",
5
5
  "license": "Apache License 2.0",
6
6
  "publishConfig": {
@@ -14,13 +14,15 @@
14
14
  "prepublishOnly": "npm run build"
15
15
  },
16
16
  "peerDependencies": {
17
- "@nestjs/common": "^10.1.3",
18
- "@nestjs/core": "^10.1.3",
19
- "@rsdk/common": "^4.0.0-next.2",
20
- "@rsdk/core": "^4.0.0-next.2",
21
- "@rsdk/db": "^4.0.0-next.2",
22
- "@rsdk/logging": "^4.0.0-next.2",
23
- "knex": "^2.4.2"
17
+ "@nestjs/common": "^10.0.0",
18
+ "@nestjs/core": "^10.0.0",
19
+ "@rsdk/common": "^4.0.0-next.3",
20
+ "@rsdk/core": "^4.0.0-next.3",
21
+ "@rsdk/db": "^4.0.0-next.3",
22
+ "@rsdk/logging": "^4.0.0-next.3",
23
+ "knex": "^2.4.2",
24
+ "reflect-metadata": "^0.1.13",
25
+ "rxjs": "^7.0.0"
24
26
  },
25
- "gitHead": "442be21d7300bdf6f3596a6fc3d9c2cd0a5e8ef3"
27
+ "gitHead": "313c39a379ea9ace9d94939223a53c46c12d77f9"
26
28
  }
@@ -2,6 +2,11 @@ import { InjectLogger } from '@rsdk/core';
2
2
  import { ILogger } from '@rsdk/logging';
3
3
  import type { Knex } from 'knex';
4
4
 
5
+ /**
6
+ * TODO: Как здесь понять, что распечатываться будет HEALTH_CHECK_QUERY?
7
+ * Нужно потестить.
8
+ */
9
+
5
10
  export class KnexLoggerAdapter implements Knex.Logger {
6
11
  constructor(
7
12
  @InjectLogger(KnexLoggerAdapter) private readonly platformLogger: ILogger,
@@ -1,6 +1,8 @@
1
1
  import { Injectable } from '@nestjs/common';
2
+ import { Assert } from '@rsdk/common';
2
3
  import type { HealthIndicator } from '@rsdk/core';
3
4
  import { CheckResult, Indicator } from '@rsdk/core';
5
+ import { HEALTH_CHECK_QUERY } from '@rsdk/db';
4
6
  import { Knex } from 'knex';
5
7
 
6
8
  import { InjectKnex } from '../inject-knex.decorator';
@@ -12,11 +14,12 @@ export class KnexIndicator implements HealthIndicator {
12
14
 
13
15
  public async check(): Promise<CheckResult> {
14
16
  try {
15
- await this.knex.raw('SELECT 1');
17
+ await this.knex.raw(HEALTH_CHECK_QUERY);
16
18
 
17
- return CheckResult.up({});
19
+ return CheckResult.up({ query: HEALTH_CHECK_QUERY });
18
20
  } catch (error: unknown) {
19
- return CheckResult.down({ error: (error as Error).message });
21
+ Assert.isError(error);
22
+ return CheckResult.down({ error: error.message });
20
23
  }
21
24
  }
22
25
  }