@rsdk/db.knex 5.8.0-next.0 → 5.8.0-next.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.
- package/dist/providers/knex.config.d.ts +4 -0
- package/dist/providers/knex.config.js +43 -7
- package/dist/providers/knex.config.js.map +1 -1
- package/dist/providers/knex.factory.js +2 -0
- package/dist/providers/knex.factory.js.map +1 -1
- package/package.json +2 -2
- package/src/providers/knex.config.ts +36 -7
- package/src/providers/knex.factory.ts +2 -0
|
@@ -9,4 +9,8 @@ export declare class KnexPluginConfig extends Config {
|
|
|
9
9
|
reconnectInterval: Timespan;
|
|
10
10
|
keepAlive: boolean;
|
|
11
11
|
keepAliveInitialDelay: number;
|
|
12
|
+
allowSelfSignedCert?: boolean | undefined;
|
|
13
|
+
tlsCa?: string | undefined;
|
|
14
|
+
tlsCert?: string | undefined;
|
|
15
|
+
tlslKey?: string | undefined;
|
|
12
16
|
}
|
|
@@ -21,16 +21,20 @@ let KnexPluginConfig = class KnexPluginConfig extends core_1.Config {
|
|
|
21
21
|
reconnectInterval;
|
|
22
22
|
keepAlive;
|
|
23
23
|
keepAliveInitialDelay;
|
|
24
|
+
allowSelfSignedCert;
|
|
25
|
+
tlsCa;
|
|
26
|
+
tlsCert;
|
|
27
|
+
tlslKey;
|
|
24
28
|
};
|
|
25
29
|
exports.KnexPluginConfig = KnexPluginConfig;
|
|
26
30
|
__decorate([
|
|
27
|
-
(0, core_1.Property)('
|
|
31
|
+
(0, core_1.Property)('URL', new core_1.UrlParser(), {
|
|
28
32
|
description: 'database server url',
|
|
29
33
|
}),
|
|
30
34
|
__metadata("design:type", URL)
|
|
31
35
|
], KnexPluginConfig.prototype, "url", void 0);
|
|
32
36
|
__decorate([
|
|
33
|
-
(0, core_1.Property)('
|
|
37
|
+
(0, core_1.Property)('SCHEMA', new core_1.StringParser(), {
|
|
34
38
|
description: (0, common_1.text) `
|
|
35
39
|
Use schema for all entities.
|
|
36
40
|
Not all databases supports this!
|
|
@@ -40,7 +44,7 @@ __decorate([
|
|
|
40
44
|
__metadata("design:type", String)
|
|
41
45
|
], KnexPluginConfig.prototype, "schema", void 0);
|
|
42
46
|
__decorate([
|
|
43
|
-
(0, core_1.Property)('
|
|
47
|
+
(0, core_1.Property)('POOL_MIN', new core_1.IntParser(), {
|
|
44
48
|
defaultValue: 1,
|
|
45
49
|
description: (0, common_1.text) `
|
|
46
50
|
Minimum connection pool size.
|
|
@@ -50,7 +54,7 @@ __decorate([
|
|
|
50
54
|
__metadata("design:type", Number)
|
|
51
55
|
], KnexPluginConfig.prototype, "poolMin", void 0);
|
|
52
56
|
__decorate([
|
|
53
|
-
(0, core_1.Property)('
|
|
57
|
+
(0, core_1.Property)('POOL_MAX', new core_1.IntParser(), {
|
|
54
58
|
defaultValue: 10,
|
|
55
59
|
description: (0, common_1.text) `
|
|
56
60
|
Maximum connection pool size.
|
|
@@ -60,14 +64,14 @@ __decorate([
|
|
|
60
64
|
__metadata("design:type", Number)
|
|
61
65
|
], KnexPluginConfig.prototype, "poolMax", void 0);
|
|
62
66
|
__decorate([
|
|
63
|
-
(0, core_1.Property)('
|
|
67
|
+
(0, core_1.Property)('RECONNECT_ATTEMPTS', new core_1.IntParser(), {
|
|
64
68
|
defaultValue: Number.POSITIVE_INFINITY,
|
|
65
69
|
description: 'Retry attempt count before give up',
|
|
66
70
|
}),
|
|
67
71
|
__metadata("design:type", Number)
|
|
68
72
|
], KnexPluginConfig.prototype, "reconnectAttempts", void 0);
|
|
69
73
|
__decorate([
|
|
70
|
-
(0, core_1.Property)('
|
|
74
|
+
(0, core_1.Property)('RECONNECT_INTERVAL', new core_1.TimespanParser(), {
|
|
71
75
|
defaultValue: new common_1.Timespan(1, 's'),
|
|
72
76
|
description: 'Delay between retries',
|
|
73
77
|
}),
|
|
@@ -95,7 +99,39 @@ __decorate([
|
|
|
95
99
|
}),
|
|
96
100
|
__metadata("design:type", Number)
|
|
97
101
|
], KnexPluginConfig.prototype, "keepAliveInitialDelay", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, core_1.Property)('ALLOW_SELF_SIGNED_CERT', new core_1.BoolParser(), {
|
|
104
|
+
defaultValue: undefined,
|
|
105
|
+
description: 'Allow self-signed certificates',
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Object)
|
|
108
|
+
], KnexPluginConfig.prototype, "allowSelfSignedCert", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, core_1.Property)('TLS_CA', new core_1.StringParser(), {
|
|
111
|
+
defaultValue: undefined,
|
|
112
|
+
description: 'Path to CA certificate',
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], KnexPluginConfig.prototype, "tlsCa", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, core_1.Property)('TLS_CERT', new core_1.StringParser(), {
|
|
118
|
+
defaultValue: undefined,
|
|
119
|
+
description: 'Path to client certificate',
|
|
120
|
+
}),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], KnexPluginConfig.prototype, "tlsCert", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, core_1.Property)('TLS_KEY', new core_1.StringParser(), {
|
|
125
|
+
defaultValue: undefined,
|
|
126
|
+
description: 'Path to client key',
|
|
127
|
+
}),
|
|
128
|
+
__metadata("design:type", Object)
|
|
129
|
+
], KnexPluginConfig.prototype, "tlslKey", void 0);
|
|
98
130
|
exports.KnexPluginConfig = KnexPluginConfig = __decorate([
|
|
99
|
-
(0, core_1.ConfigSection)(
|
|
131
|
+
(0, core_1.ConfigSection)({
|
|
132
|
+
name: 'knex database config',
|
|
133
|
+
tags: [core_1.ConfigTag.infrastructure, core_1.ConfigTag.storage],
|
|
134
|
+
prefix: 'DB',
|
|
135
|
+
})
|
|
100
136
|
], KnexPluginConfig);
|
|
101
137
|
//# sourceMappingURL=knex.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knex.config.js","sourceRoot":"","sources":["../../src/providers/knex.config.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"knex.config.js","sourceRoot":"","sources":["../../src/providers/knex.config.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA8C;AAC9C,qCAUoB;AAOb,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,aAAM;IAI1C,GAAG,CAAO;IASV,MAAM,CAAU;IAShB,OAAO,CAAU;IASjB,OAAO,CAAU;IAMjB,iBAAiB,CAAU;IAM3B,iBAAiB,CAAY;IAU7B,SAAS,CAAW;IAUpB,qBAAqB,CAAU;IAM/B,mBAAmB,CAAuB;IAM1C,KAAK,CAAsB;IAM3B,OAAO,CAAsB;IAM7B,OAAO,CAAsB;CAC9B,CAAA;AAxFY,4CAAgB;AAI3B;IAHC,IAAA,eAAQ,EAAC,KAAK,EAAE,IAAI,gBAAS,EAAE,EAAE;QAChC,WAAW,EAAE,qBAAqB;KACnC,CAAC;8BACI,GAAG;6CAAC;AASV;IAPC,IAAA,eAAQ,EAAC,QAAQ,EAAE,IAAI,mBAAY,EAAE,EAAE;QACtC,WAAW,EAAE,IAAA,aAAI,EAAA;;;KAGhB;QACD,YAAY,EAAE,EAAE;KACjB,CAAC;;gDACc;AAShB;IAPC,IAAA,eAAQ,EAAC,UAAU,EAAE,IAAI,gBAAS,EAAE,EAAE;QACrC,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,IAAA,aAAI,EAAA;;;KAGhB;KACF,CAAC;;iDACe;AASjB;IAPC,IAAA,eAAQ,EAAC,UAAU,EAAE,IAAI,gBAAS,EAAE,EAAE;QACrC,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,IAAA,aAAI,EAAA;;;KAGhB;KACF,CAAC;;iDACe;AAMjB;IAJC,IAAA,eAAQ,EAAC,oBAAoB,EAAE,IAAI,gBAAS,EAAE,EAAE;QAC/C,YAAY,EAAE,MAAM,CAAC,iBA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AC,gBAAS,CAAC,cAAc,EAAE,gBAAS,CAAC,OAAO,CAAC;QACnD,MAAM,EAAE,IAAI;KACb,CAAC;GACW,gBAAgB,CAwF5B"}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.KnexFactory = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const core_1 = require("@rsdk/core");
|
|
18
|
+
const db_1 = require("@rsdk/db");
|
|
18
19
|
const knex_1 = require("knex");
|
|
19
20
|
const promises_1 = require("node:timers/promises");
|
|
20
21
|
const knex_config_1 = require("./knex.config");
|
|
@@ -40,6 +41,7 @@ let KnexFactory = class KnexFactory {
|
|
|
40
41
|
connectionString: this.config.url.toString(),
|
|
41
42
|
keepAlive: this.config.keepAlive,
|
|
42
43
|
keepAliveInitialDelay: this.config.keepAliveInitialDelay,
|
|
44
|
+
ssl: (0, db_1.getSecureContextOptions)(this.config),
|
|
43
45
|
},
|
|
44
46
|
...(this.config.schema && {
|
|
45
47
|
searchPath: [this.config.schema],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knex.factory.js","sourceRoot":"","sources":["../../src/providers/knex.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA4C;AAC5C,qCAAmD;AAGnD,+BAA4B;AAC5B,mDAAkD;AAElD,+CAAiD;AACjD,+DAA0D;AAGnD,IAAM,WAAW,GAAjB,MAAM,WAAW;IAIQ;IACgB;IAC3B;IALX,QAAQ,GAAgB,IAAI,CAAC;IAErC,YAC8B,OAAe,EACC,MAAe,EAC1C,MAAwB;QAFb,YAAO,GAAP,OAAO,CAAQ;QACC,WAAM,GAAN,MAAM,CAAS;QAC1C,WAAM,GAAN,MAAM,CAAkB;IACxC,CAAC;IAEG,KAAK,CAAC,MAAM,CAAC,MAAc;QAChC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;QACv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,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;CACF,CAAA;AA3EY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,cAAO,GAAE,CAAA;IACT,WAAA,IAAA,mBAAY,EAAC,WAAW,CAAC,CAAA;qDACD,8BAAgB;GANhC,WAAW,CA2EvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/db.knex",
|
|
3
|
-
"version": "5.8.0-next.
|
|
3
|
+
"version": "5.8.0-next.2",
|
|
4
4
|
"description": "Knex integration for platform",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
26
26
|
"rxjs": "^7.1.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "b2d33ec333bce5108a9a7ec8d1502c19bb968283"
|
|
29
29
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BoolParser,
|
|
4
4
|
Config,
|
|
5
5
|
ConfigSection,
|
|
6
|
+
ConfigTag,
|
|
6
7
|
IntParser,
|
|
7
8
|
Property,
|
|
8
9
|
StringParser,
|
|
@@ -10,14 +11,18 @@ import {
|
|
|
10
11
|
UrlParser,
|
|
11
12
|
} from '@rsdk/core';
|
|
12
13
|
|
|
13
|
-
@ConfigSection(
|
|
14
|
+
@ConfigSection({
|
|
15
|
+
name: 'knex database config',
|
|
16
|
+
tags: [ConfigTag.infrastructure, ConfigTag.storage],
|
|
17
|
+
prefix: 'DB',
|
|
18
|
+
})
|
|
14
19
|
export class KnexPluginConfig extends Config {
|
|
15
|
-
@Property('
|
|
20
|
+
@Property('URL', new UrlParser(), {
|
|
16
21
|
description: 'database server url',
|
|
17
22
|
})
|
|
18
23
|
url!: URL;
|
|
19
24
|
|
|
20
|
-
@Property('
|
|
25
|
+
@Property('SCHEMA', new StringParser(), {
|
|
21
26
|
description: text`
|
|
22
27
|
Use schema for all entities.
|
|
23
28
|
Not all databases supports this!
|
|
@@ -26,7 +31,7 @@ export class KnexPluginConfig extends Config {
|
|
|
26
31
|
})
|
|
27
32
|
schema!: string;
|
|
28
33
|
|
|
29
|
-
@Property('
|
|
34
|
+
@Property('POOL_MIN', new IntParser(), {
|
|
30
35
|
defaultValue: 1,
|
|
31
36
|
description: text`
|
|
32
37
|
Minimum connection pool size.
|
|
@@ -35,7 +40,7 @@ export class KnexPluginConfig extends Config {
|
|
|
35
40
|
})
|
|
36
41
|
poolMin!: number;
|
|
37
42
|
|
|
38
|
-
@Property('
|
|
43
|
+
@Property('POOL_MAX', new IntParser(), {
|
|
39
44
|
defaultValue: 10,
|
|
40
45
|
description: text`
|
|
41
46
|
Maximum connection pool size.
|
|
@@ -44,13 +49,13 @@ export class KnexPluginConfig extends Config {
|
|
|
44
49
|
})
|
|
45
50
|
poolMax!: number;
|
|
46
51
|
|
|
47
|
-
@Property('
|
|
52
|
+
@Property('RECONNECT_ATTEMPTS', new IntParser(), {
|
|
48
53
|
defaultValue: Number.POSITIVE_INFINITY,
|
|
49
54
|
description: 'Retry attempt count before give up',
|
|
50
55
|
})
|
|
51
56
|
reconnectAttempts!: number;
|
|
52
57
|
|
|
53
|
-
@Property('
|
|
58
|
+
@Property('RECONNECT_INTERVAL', new TimespanParser(), {
|
|
54
59
|
defaultValue: new Timespan(1, 's'),
|
|
55
60
|
description: 'Delay between retries',
|
|
56
61
|
})
|
|
@@ -75,4 +80,28 @@ export class KnexPluginConfig extends Config {
|
|
|
75
80
|
`,
|
|
76
81
|
})
|
|
77
82
|
keepAliveInitialDelay!: number;
|
|
83
|
+
|
|
84
|
+
@Property('ALLOW_SELF_SIGNED_CERT', new BoolParser(), {
|
|
85
|
+
defaultValue: undefined,
|
|
86
|
+
description: 'Allow self-signed certificates',
|
|
87
|
+
})
|
|
88
|
+
allowSelfSignedCert?: boolean | undefined;
|
|
89
|
+
|
|
90
|
+
@Property('TLS_CA', new StringParser(), {
|
|
91
|
+
defaultValue: undefined,
|
|
92
|
+
description: 'Path to CA certificate',
|
|
93
|
+
})
|
|
94
|
+
tlsCa?: string | undefined;
|
|
95
|
+
|
|
96
|
+
@Property('TLS_CERT', new StringParser(), {
|
|
97
|
+
defaultValue: undefined,
|
|
98
|
+
description: 'Path to client certificate',
|
|
99
|
+
})
|
|
100
|
+
tlsCert?: string | undefined;
|
|
101
|
+
|
|
102
|
+
@Property('TLS_KEY', new StringParser(), {
|
|
103
|
+
defaultValue: undefined,
|
|
104
|
+
description: 'Path to client key',
|
|
105
|
+
})
|
|
106
|
+
tlslKey?: string | undefined;
|
|
78
107
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OnApplicationShutdown } from '@nestjs/common';
|
|
2
2
|
import { Injectable } from '@nestjs/common';
|
|
3
3
|
import { AppName, InjectLogger } from '@rsdk/core';
|
|
4
|
+
import { getSecureContextOptions } from '@rsdk/db';
|
|
4
5
|
import { ILogger } from '@rsdk/logging';
|
|
5
6
|
import type { Knex } from 'knex';
|
|
6
7
|
import { knex } from 'knex';
|
|
@@ -31,6 +32,7 @@ export class KnexFactory implements OnApplicationShutdown {
|
|
|
31
32
|
connectionString: this.config.url.toString(),
|
|
32
33
|
keepAlive: this.config.keepAlive,
|
|
33
34
|
keepAliveInitialDelay: this.config.keepAliveInitialDelay,
|
|
35
|
+
ssl: getSecureContextOptions(this.config),
|
|
34
36
|
},
|
|
35
37
|
...(this.config.schema && {
|
|
36
38
|
searchPath: [this.config.schema],
|