@rsdk/core 3.6.0-next.6 → 3.6.0-next.7
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 +4 -0
- package/dist/config/config.module.d.ts +5 -4
- package/dist/config/config.module.js +26 -7
- package/dist/config/config.module.js.map +1 -1
- package/dist/exceptions.handling/global-exceptions.module.js +0 -3
- package/dist/exceptions.handling/global-exceptions.module.js.map +1 -1
- package/dist/logging/logging.module.js +0 -4
- package/dist/logging/logging.module.js.map +1 -1
- package/dist/metrics/metrics.module.js +1 -4
- package/dist/metrics/metrics.module.js.map +1 -1
- package/dist/rsdk-metadata/config-metadata.extractor.js +1 -1
- package/dist/rsdk-metadata/config-metadata.extractor.js.map +1 -1
- package/dist/tracing/tracing.module.js +0 -2
- package/dist/tracing/tracing.module.js.map +1 -1
- package/package.json +3 -3
- package/src/config/config.module.ts +18 -9
- package/src/exceptions.handling/global-exceptions.module.ts +0 -5
- package/src/logging/logging.module.ts +0 -4
- package/src/metrics/metrics.module.ts +1 -5
- package/src/rsdk-metadata/config-metadata.extractor.ts +1 -1
- package/src/tracing/tracing.module.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
## [3.6.0-next.7](https://github.com/R-Vision/rsdk/compare/v3.6.0-next.6...v3.6.0-next.7) (2023-10-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rsdk/core
|
|
9
|
+
|
|
6
10
|
## [3.6.0-next.6](https://github.com/R-Vision/rsdk/compare/v3.6.0-next.5...v3.6.0-next.6) (2023-10-20)
|
|
7
11
|
|
|
8
12
|
### Features
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { Constructor } from '@rsdk/common';
|
|
3
3
|
import type { PlatformOptions } from '../types';
|
|
4
4
|
import type { Config } from './config.abstract';
|
|
5
5
|
import type { ConfigSource } from './sources';
|
|
@@ -33,6 +33,9 @@ export declare class PlatformConfigModule {
|
|
|
33
33
|
* @returns DynamicModule
|
|
34
34
|
*/
|
|
35
35
|
static forProperty(alias: string): DynamicModule;
|
|
36
|
+
static createConfigProvider(ctor: Constructor<Config>): DynamicModule;
|
|
37
|
+
static forRoot(options: PlatformOptions): DynamicModule;
|
|
38
|
+
private static getPropertyProvider;
|
|
36
39
|
/**
|
|
37
40
|
* Use this method to import specified configuration section
|
|
38
41
|
* into given module
|
|
@@ -40,6 +43,4 @@ export declare class PlatformConfigModule {
|
|
|
40
43
|
* @returns DynamicModule
|
|
41
44
|
*/
|
|
42
45
|
static forFeature(ctor: Constructor<Config>): DynamicModule;
|
|
43
|
-
static forRoot(options: PlatformOptions): DynamicModule;
|
|
44
|
-
private static getPropertyProvider;
|
|
45
46
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.PlatformConfigModule = void 0;
|
|
13
|
+
const deprecate_1 = require("@rsdk/decorators/dist/deprecate");
|
|
4
14
|
const additional_source_initializer_1 = require("./additional-source/additional-source.initializer");
|
|
5
15
|
const additional_source_module_1 = require("./additional-source/additional-source.module");
|
|
6
16
|
const config_context_1 = require("./context/config.context");
|
|
@@ -26,13 +36,7 @@ class PlatformConfigModule {
|
|
|
26
36
|
exports: [provider],
|
|
27
37
|
};
|
|
28
38
|
}
|
|
29
|
-
|
|
30
|
-
* Use this method to import specified configuration section
|
|
31
|
-
* into given module
|
|
32
|
-
* @param ctor Pass constructor of configuration section class
|
|
33
|
-
* @returns DynamicModule
|
|
34
|
-
*/
|
|
35
|
-
static forFeature(ctor) {
|
|
39
|
+
static createConfigProvider(ctor) {
|
|
36
40
|
/**
|
|
37
41
|
* Factory providers are used because at the point of time when
|
|
38
42
|
* forFeature() is executed Config instances don't yet exist
|
|
@@ -89,6 +93,21 @@ class PlatformConfigModule {
|
|
|
89
93
|
},
|
|
90
94
|
};
|
|
91
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Use this method to import specified configuration section
|
|
98
|
+
* into given module
|
|
99
|
+
* @param ctor Pass constructor of configuration section class
|
|
100
|
+
* @returns DynamicModule
|
|
101
|
+
*/
|
|
102
|
+
static forFeature(ctor) {
|
|
103
|
+
return PlatformConfigModule.createConfigProvider(ctor);
|
|
104
|
+
}
|
|
92
105
|
}
|
|
93
106
|
exports.PlatformConfigModule = PlatformConfigModule;
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, deprecate_1.DeprecateMethod)('do not use `PlatformConfigModule.forFeature`, from @rsdk/core 3.1.0 configs are loaded automatically'),
|
|
109
|
+
__metadata("design:type", Function),
|
|
110
|
+
__metadata("design:paramtypes", [Object]),
|
|
111
|
+
__metadata("design:returntype", Object)
|
|
112
|
+
], PlatformConfigModule, "forFeature", null);
|
|
94
113
|
//# sourceMappingURL=config.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.module.js","sourceRoot":"","sources":["../../src/config/config.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,+DAAkE;AAIlE,qGAAgG;AAChG,2FAAsF;AACtF,6DAAyD;AAEzD,yCAA8C;AAuB9C,MAAa,oBAAoB;IAC/B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW,CAAC,KAAa;QAC9B,MAAM,KAAK,GAAG,IAAA,2BAAgB,EAAC,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAEjD,OAAO;YACL,MAAM,EAAE,oBAAoB;YAC5B,SAAS,EAAE,CAAC,QAAQ,CAAC;YACrB,OAAO,EAAE,CAAC,QAAQ,CAAC;SACpB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,IAAyB;QACnD;;;WAGG;QACH,MAAM,QAAQ,GAAoB;YAChC,MAAM,EAAE;gBACN,8BAAa;gBACb,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,2DAA2B,EAAE;aACvD;YACD,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,KAAK,EACf,aAA4B,EAC5B,iCAA+D,EAC/D,EAAE;gBACF;;mBAEG;gBACH,MAAM,iCAAiC,EAAE,UAAU,EAAE,CAAC;gBACtD,OAAO,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrC,CAAC;SACF,CAAC;QAEF,OAAO;YACL;;;;eAIG;YACH,MAAM,EAAE,oBAAoB;YAC5B,SAAS,EAAE,CAAC,QAAQ,CAAC;YAErB,OAAO,EAAE,CAAC,QAAQ,CAAC;SACpB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAwB;QACrC,MAAM,SAAS,GAAe,EAAE,CAAC;QACjC,MAAM,OAAO,GAA+C,EAAE,CAAC;QAE/D,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,iDAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;SACvE;QAED,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,OAAO;YACP,MAAM,EAAE,oBAAoB;YAC5B,SAAS;YACT,OAAO,EAAE,SAAS;SACnB,CAAC;IACJ,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAChC,KAA6C;QAE7C,OAAO;YACL,MAAM,EAAE;gBACN,8BAAa;gBACb,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,2DAA2B,EAAE;aACvD;YACD,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,KAAK,EACf,aAA4B,EAC5B,iCAA+D,EACvC,EAAE;gBAC1B,MAAM,iCAAiC,EAAE,UAAU,EAAE,CAAC;gBACtD,OAAO,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAC9C,CAAC;SACF,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IAII,AAAP,MAAM,CAAC,UAAU,CAAC,IAAyB;QACzC,OAAO,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;CACF;AA3GD,oDA2GC;AAHQ;IAHN,IAAA,2BAAe,EACd,sGAAsG,CACvG;;;;4CAGA"}
|
|
@@ -10,15 +10,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.GlobalExceptionsModule = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const core_1 = require("@nestjs/core");
|
|
13
|
-
const config_1 = require("../config");
|
|
14
13
|
const constants_1 = require("./constants");
|
|
15
|
-
const global_exceptions_config_1 = require("./global-exceptions.config");
|
|
16
14
|
const global_exceptions_filter_1 = require("./global-exceptions.filter");
|
|
17
15
|
let GlobalExceptionsModule = exports.GlobalExceptionsModule = GlobalExceptionsModule_1 = class GlobalExceptionsModule {
|
|
18
16
|
static forRoot(options) {
|
|
19
17
|
return {
|
|
20
18
|
module: GlobalExceptionsModule_1,
|
|
21
|
-
imports: [config_1.PlatformConfigModule.forFeature(global_exceptions_config_1.GlobalExceptionsConfig)],
|
|
22
19
|
providers: [
|
|
23
20
|
{
|
|
24
21
|
provide: core_1.APP_FILTER,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-exceptions.module.js","sourceRoot":"","sources":["../../src/exceptions.handling/global-exceptions.module.ts"],"names":[],"mappings":";;;;;;;;;;AACA,2CAAwC;AACxC,uCAA0C;AAE1C,
|
|
1
|
+
{"version":3,"file":"global-exceptions.module.js","sourceRoot":"","sources":["../../src/exceptions.handling/global-exceptions.module.ts"],"names":[],"mappings":";;;;;;;;;;AACA,2CAAwC;AACxC,uCAA0C;AAE1C,2CAAgE;AAChE,yEAAoE;AAgC7D,IAAM,sBAAsB,+DAA5B,MAAM,sBAAsB;IACjC,MAAM,CAAC,OAAO,CAAC,OAAqC;QAClD,OAAO;YACL,MAAM,EAAE,wBAAsB;YAC9B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,iBAAU;oBACnB,QAAQ,EAAE,iDAAsB;iBACjC;gBACD;oBACE,OAAO,EAAE,sBAAU;oBACnB,QAAQ,EAAE,OAAO,CAAC,UAAU;iBAC7B;gBACD;oBACE,OAAO,EAAE,mBAAO;oBAChB,QAAQ,EAAE,OAAO,CAAC,OAAO;iBAC1B;gBACD;oBACE,OAAO,EAAE,wBAAY;oBACrB,QAAQ,EAAE,OAAO,CAAC,YAAY,IAAI,EAAE;iBACrC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;iCAxBY,sBAAsB;IADlC,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,sBAAsB,CAwBlC"}
|
|
@@ -19,7 +19,6 @@ const common_1 = require("@nestjs/common");
|
|
|
19
19
|
const logging_1 = require("@rsdk/logging");
|
|
20
20
|
const metadata_1 = require("@rsdk/metadata");
|
|
21
21
|
const pino_1 = __importDefault(require("pino"));
|
|
22
|
-
const config_1 = require("../config");
|
|
23
22
|
const constants_1 = require("../rsdk-metadata/constants");
|
|
24
23
|
const constants_2 = require("./metadata/constants");
|
|
25
24
|
const helpers_1 = require("./helpers");
|
|
@@ -48,9 +47,7 @@ let LoggingModule = exports.LoggingModule = class LoggingModule {
|
|
|
48
47
|
static pureRoot() {
|
|
49
48
|
return {
|
|
50
49
|
global: true,
|
|
51
|
-
imports: [config_1.PlatformConfigModule.forFeature(logging_config_1.LoggingConfig)],
|
|
52
50
|
module: LoggingModule_1,
|
|
53
|
-
exports: [config_1.PlatformConfigModule],
|
|
54
51
|
};
|
|
55
52
|
}
|
|
56
53
|
static register(target, context, token = (0, helpers_1.getLoggerToken)(context)) {
|
|
@@ -89,7 +86,6 @@ let LoggingModule = exports.LoggingModule = class LoggingModule {
|
|
|
89
86
|
static forFeature(context, token = (0, helpers_1.getLoggerToken)(context)) {
|
|
90
87
|
return {
|
|
91
88
|
global: true,
|
|
92
|
-
imports: [config_1.PlatformConfigModule.forFeature(logging_config_1.LoggingConfig)],
|
|
93
89
|
module: LoggingModule_1,
|
|
94
90
|
providers: [
|
|
95
91
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.module.js","sourceRoot":"","sources":["../../src/logging/logging.module.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;;;;;;;;;;;;;AAG9B,2CAAwC;AAExC,2CAA8C;AAC9C,6CAA8C;AAC9C,gDAAwB;
|
|
1
|
+
{"version":3,"file":"logging.module.js","sourceRoot":"","sources":["../../src/logging/logging.module.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;;;;;;;;;;;;;AAG9B,2CAAwC;AAExC,2CAA8C;AAC9C,6CAA8C;AAC9C,gDAAwB;AAGxB,0DAAgF;AAEhF,oDAAmE;AACnE,uCAA2C;AAC3C,qDAAiD;AAI1C,IAAM,aAAa,2BAAnB,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KAAK;oBACd,QAAQ,EAAE,uBAAa,CAAC,MAAM,CAAC,OAAO,CAAC;iBACxC;aACF;YACD,OAAO,EAAE,CAAC,KAAK,CAAC;SACjB,CAAC;IACJ,CAAC;;wBA7FU,aAAa;IADzB,IAAA,eAAM,EAAC,EAAE,CAAC;qCAIW,8BAAa;GAHtB,aAAa,CA8FzB"}
|
|
@@ -17,7 +17,6 @@ exports.MetricsModule = void 0;
|
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const metadata_1 = require("@rsdk/metadata");
|
|
19
19
|
const prom_client_1 = __importDefault(require("prom-client"));
|
|
20
|
-
const config_1 = require("../config");
|
|
21
20
|
const constants_1 = require("./metadata/constants");
|
|
22
21
|
const metric_storage_1 = require("./metric.storage");
|
|
23
22
|
const metrics_config_1 = require("./metrics.config");
|
|
@@ -108,9 +107,7 @@ let MetricsModule = exports.MetricsModule = class MetricsModule {
|
|
|
108
107
|
}
|
|
109
108
|
};
|
|
110
109
|
exports.MetricsModule = MetricsModule = MetricsModule_1 = __decorate([
|
|
111
|
-
(0, common_1.Module)({
|
|
112
|
-
imports: [config_1.PlatformConfigModule.forFeature(metrics_config_1.MetricsModuleConfig)],
|
|
113
|
-
}),
|
|
110
|
+
(0, common_1.Module)({}),
|
|
114
111
|
__metadata("design:paramtypes", [metrics_config_1.MetricsModuleConfig])
|
|
115
112
|
], MetricsModule);
|
|
116
113
|
//# sourceMappingURL=metrics.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.module.js","sourceRoot":"","sources":["../../src/metrics/metrics.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,2CAAwC;AAExC,6CAA8C;AAC9C,8DAAiC;AAEjC,
|
|
1
|
+
{"version":3,"file":"metrics.module.js","sourceRoot":"","sources":["../../src/metrics/metrics.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAKA,2CAAwC;AAExC,6CAA8C;AAC9C,8DAAiC;AAEjC,o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AC,QAAQ,CAAC,CAAC;oBAExD,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBAC1C,OAAO,QAAQ,CAAC;gBAClB,CAAC;aACF,CAAC,CAAC;SACJ;QAED,OAAO;YACL,MAAM,EAAE,eAAa;YACrB,OAAO,EAAE,SAAS;YAClB,SAAS;SACV,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB;;;WAGG;QACH,IAAI,eAAa,CAAC,cAAc,EAAE;YAChC,OAAO;SACR;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;YAC9B,qBAAM,CAAC,qBAAqB,EAAE,CAAC;SAChC;QAED,eAAa,CAAC,cAAc,GAAG,IAAI,CAAC;IACtC,CAAC;;wBA3FU,aAAa;IADzB,IAAA,eAAM,EAAC,EAAE,CAAC;qCAW4B,oCAAmB;GAV7C,aAAa,CA4FzB"}
|
|
@@ -32,7 +32,7 @@ class ConfigMetadataExtractor {
|
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
34
|
resources.push({
|
|
35
|
-
value: config_1.PlatformConfigModule.
|
|
35
|
+
value: config_1.PlatformConfigModule.createConfigProvider(arg),
|
|
36
36
|
key: arg,
|
|
37
37
|
scope: constants_1.PLATFORM_RAW_GLOBAL_METADATA_SCOPE,
|
|
38
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-metadata.extractor.js","sourceRoot":"","sources":["../../src/rsdk-metadata/config-metadata.extractor.ts"],"names":[],"mappings":";;;AASA,iDAA0D;AAE1D,sCAAyD;AAEzD,2CAAiE;AAEjE;;GAEG;AACH,MAAa,uBAAuB;IAClC,OAAO,CACL,KAMkB;QAElB,IAAI,CAAC,mBAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,EAAE,CAAC;SACX;QACD;;WAEG;QACH,MAAM,IAAI,GAAG,2BAAc,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/C;;WAEG;QACH,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACxB,OAAO,EAAE,CAAC;SACX;QACD,MAAM,SAAS,GAA8B,EAAE,CAAC;QAEhD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,mBAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;gBAC/B,SAAS;aACV;YACD,MAAM,eAAe,GAAG,eAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAEpD,IAAI,CAAC,eAAe,EAAE;gBACpB,SAAS;aACV;YACD,SAAS,CAAC,IAAI,CAAC;gBACb,KAAK,EAAE,6BAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"config-metadata.extractor.js","sourceRoot":"","sources":["../../src/rsdk-metadata/config-metadata.extractor.ts"],"names":[],"mappings":";;;AASA,iDAA0D;AAE1D,sCAAyD;AAEzD,2CAAiE;AAEjE;;GAEG;AACH,MAAa,uBAAuB;IAClC,OAAO,CACL,KAMkB;QAElB,IAAI,CAAC,mBAAM,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACjC,OAAO,EAAE,CAAC;SACX;QACD;;WAEG;QACH,MAAM,IAAI,GAAG,2BAAc,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC/C;;WAEG;QACH,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACxB,OAAO,EAAE,CAAC;SACX;QACD,MAAM,SAAS,GAA8B,EAAE,CAAC;QAEhD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,CAAC,mBAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;gBAC/B,SAAS;aACV;YACD,MAAM,eAAe,GAAG,eAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAEpD,IAAI,CAAC,eAAe,EAAE;gBACpB,SAAS;aACV;YACD,SAAS,CAAC,IAAI,CAAC;gBACb,KAAK,EAAE,6BAAoB,CAAC,oBAAoB,CAAC,GAAG,CAAC;gBACrD,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,8CAAkC;aAC1C,CAAC,CAAC;SACJ;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1CD,0DA0CC"}
|
|
@@ -25,7 +25,6 @@ const sdk_node_1 = require("@opentelemetry/sdk-node");
|
|
|
25
25
|
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
26
26
|
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
27
27
|
const logging_1 = require("@rsdk/logging");
|
|
28
|
-
const config_1 = require("../config");
|
|
29
28
|
const logging_2 = require("../logging");
|
|
30
29
|
const instrumentation_service_1 = require("./services/instrumentation.service");
|
|
31
30
|
const metadata_scanner_1 = require("./services/metadata.scanner");
|
|
@@ -44,7 +43,6 @@ let TracingModule = exports.TracingModule = TracingModule_1 = class TracingModul
|
|
|
44
43
|
static forRoot(options) {
|
|
45
44
|
return {
|
|
46
45
|
module: TracingModule_1,
|
|
47
|
-
imports: [config_1.PlatformConfigModule.forFeature(tracing_config_1.TracingModuleConfig)],
|
|
48
46
|
providers: [
|
|
49
47
|
metadata_scanner_1.ExtendedMetadataScanner,
|
|
50
48
|
instrumentation_service_1.InstrumentationService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.module.js","sourceRoot":"","sources":["../../src/tracing/tracing.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,2CAAwC;AACxC,4CAAoD;AACpD,4EAAqF;AACrF,8CAA0D;AAC1D,sFAA4E;AAC5E,gEAA8E;AAC9E,wDAAoD;AACpD,sDAAkD;AAElD,kEAGuC;AACvC,8EAAiF;AACjF,2CAAuD;AAEvD,
|
|
1
|
+
{"version":3,"file":"tracing.module.js","sourceRoot":"","sources":["../../src/tracing/tracing.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,2CAAwC;AACxC,4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B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACxD,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;CACF,CAAA;wBApFY,aAAa;IADzB,IAAA,eAAM,EAAC,EAAE,CAAC;IAGN,WAAA,IAAA,sBAAY,EAAC,eAAa,CAAC,CAAA;6CACO,gDAAsB;QACnC,kBAAO;QACJ,oCAAmB;GALnC,aAAa,CAoFzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/core",
|
|
3
|
-
"version": "3.6.0-next.
|
|
3
|
+
"version": "3.6.0-next.7",
|
|
4
4
|
"description": "Nestjs based microservice chassis",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@rsdk/common": "^3.5.0",
|
|
36
36
|
"@rsdk/common.nestjs": "^3.5.0",
|
|
37
37
|
"@rsdk/common.node": "^3.5.0",
|
|
38
|
-
"@rsdk/decorators": "^3.6.0-next.
|
|
38
|
+
"@rsdk/decorators": "^3.6.0-next.7",
|
|
39
39
|
"@rsdk/logging": "^3.6.0-next.6",
|
|
40
40
|
"@rsdk/metadata": "^3.6.0-next.6",
|
|
41
41
|
"@rsdk/nest-tools": "^3.6.0-next.0",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"reflect-metadata": "^0.1.13",
|
|
44
44
|
"rxjs": "^7.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a4186d3d5dfc9f6a8cc57c3f6e4c8cc40b09c747"
|
|
47
47
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { FactoryProvider, Provider } from '@nestjs/common';
|
|
2
|
+
import { DynamicModule } from '@nestjs/common';
|
|
3
|
+
import { Constructor } from '@rsdk/common';
|
|
4
|
+
import { DeprecateMethod } from '@rsdk/decorators/dist/deprecate';
|
|
3
5
|
|
|
4
6
|
import type { PlatformOptions } from '../types';
|
|
5
7
|
|
|
@@ -53,13 +55,7 @@ export class PlatformConfigModule {
|
|
|
53
55
|
};
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
* Use this method to import specified configuration section
|
|
58
|
-
* into given module
|
|
59
|
-
* @param ctor Pass constructor of configuration section class
|
|
60
|
-
* @returns DynamicModule
|
|
61
|
-
*/
|
|
62
|
-
static forFeature(ctor: Constructor<Config>): DynamicModule {
|
|
58
|
+
static createConfigProvider(ctor: Constructor<Config>): DynamicModule {
|
|
63
59
|
/**
|
|
64
60
|
* Factory providers are used because at the point of time when
|
|
65
61
|
* forFeature() is executed Config instances don't yet exist
|
|
@@ -130,4 +126,17 @@ export class PlatformConfigModule {
|
|
|
130
126
|
},
|
|
131
127
|
};
|
|
132
128
|
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Use this method to import specified configuration section
|
|
132
|
+
* into given module
|
|
133
|
+
* @param ctor Pass constructor of configuration section class
|
|
134
|
+
* @returns DynamicModule
|
|
135
|
+
*/
|
|
136
|
+
@DeprecateMethod(
|
|
137
|
+
'do not use `PlatformConfigModule.forFeature`, from @rsdk/core 3.1.0 configs are loaded automatically',
|
|
138
|
+
)
|
|
139
|
+
static forFeature(ctor: Constructor<Config>): DynamicModule {
|
|
140
|
+
return PlatformConfigModule.createConfigProvider(ctor);
|
|
141
|
+
}
|
|
133
142
|
}
|
|
@@ -2,10 +2,7 @@ import type { DynamicModule } from '@nestjs/common';
|
|
|
2
2
|
import { Module } from '@nestjs/common';
|
|
3
3
|
import { APP_FILTER } from '@nestjs/core';
|
|
4
4
|
|
|
5
|
-
import { PlatformConfigModule } from '../config';
|
|
6
|
-
|
|
7
5
|
import { FORMATTERS, SENDERS, TRANSFORMERS } from './constants';
|
|
8
|
-
import { GlobalExceptionsConfig } from './global-exceptions.config';
|
|
9
6
|
import { GlobalExceptionsFilter } from './global-exceptions.filter';
|
|
10
7
|
import type {
|
|
11
8
|
IErrorsFormatter,
|
|
@@ -42,8 +39,6 @@ export class GlobalExceptionsModule {
|
|
|
42
39
|
static forRoot(options: GlobalExceptionModuleOptions): DynamicModule {
|
|
43
40
|
return {
|
|
44
41
|
module: GlobalExceptionsModule,
|
|
45
|
-
|
|
46
|
-
imports: [PlatformConfigModule.forFeature(GlobalExceptionsConfig)],
|
|
47
42
|
providers: [
|
|
48
43
|
{
|
|
49
44
|
provide: APP_FILTER,
|
|
@@ -7,7 +7,6 @@ import { LoggerFactory } from '@rsdk/logging';
|
|
|
7
7
|
import { RsdkMetadata } from '@rsdk/metadata';
|
|
8
8
|
import pino from 'pino';
|
|
9
9
|
|
|
10
|
-
import { PlatformConfigModule } from '../config';
|
|
11
10
|
import type { PlatformRawGlobalMetadata } from '../rsdk-metadata/constants';
|
|
12
11
|
import { PLATFORM_RAW_GLOBAL_METADATA_SCOPE } from '../rsdk-metadata/constants';
|
|
13
12
|
|
|
@@ -44,9 +43,7 @@ export class LoggingModule {
|
|
|
44
43
|
static pureRoot(): DynamicModule {
|
|
45
44
|
return {
|
|
46
45
|
global: true,
|
|
47
|
-
imports: [PlatformConfigModule.forFeature(LoggingConfig)],
|
|
48
46
|
module: LoggingModule,
|
|
49
|
-
exports: [PlatformConfigModule],
|
|
50
47
|
};
|
|
51
48
|
}
|
|
52
49
|
|
|
@@ -103,7 +100,6 @@ export class LoggingModule {
|
|
|
103
100
|
): DynamicModule {
|
|
104
101
|
return {
|
|
105
102
|
global: true,
|
|
106
|
-
imports: [PlatformConfigModule.forFeature(LoggingConfig)],
|
|
107
103
|
module: LoggingModule,
|
|
108
104
|
providers: [
|
|
109
105
|
{
|
|
@@ -8,8 +8,6 @@ import type { Constructor } from '@rsdk/common';
|
|
|
8
8
|
import { RsdkMetadata } from '@rsdk/metadata';
|
|
9
9
|
import client from 'prom-client';
|
|
10
10
|
|
|
11
|
-
import { PlatformConfigModule } from '../config';
|
|
12
|
-
|
|
13
11
|
import { METRIC_RSDK_METADATA_SCOPE } from './metadata/constants';
|
|
14
12
|
import type { MetricRsdkMetadata } from './metadata';
|
|
15
13
|
import { MetricStorage } from './metric.storage';
|
|
@@ -24,9 +22,7 @@ import type { AnyMetric, MetricsModuleOptions } from './types';
|
|
|
24
22
|
* @willsoto/nestjs-prometheus was an alternative, but it didn't really
|
|
25
23
|
* fit
|
|
26
24
|
*/
|
|
27
|
-
@Module({
|
|
28
|
-
imports: [PlatformConfigModule.forFeature(MetricsModuleConfig)],
|
|
29
|
-
})
|
|
25
|
+
@Module({})
|
|
30
26
|
export class MetricsModule implements OnApplicationBootstrap {
|
|
31
27
|
private static isBootstrapped = false;
|
|
32
28
|
// TODO По идее от этого нужно избавиться, но тут нужно будет делать @InjectMetric(SomeMetric) там где сейчас используется someMetric: SomeMetric
|
|
@@ -51,7 +51,7 @@ export class ConfigMetadataExtractor implements ResourceExtractor {
|
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
resources.push({
|
|
54
|
-
value: PlatformConfigModule.
|
|
54
|
+
value: PlatformConfigModule.createConfigProvider(arg),
|
|
55
55
|
key: arg,
|
|
56
56
|
scope: PLATFORM_RAW_GLOBAL_METADATA_SCOPE,
|
|
57
57
|
});
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
|
|
16
16
|
import { ILogger, LoggerFactory } from '@rsdk/logging';
|
|
17
17
|
|
|
18
|
-
import { PlatformConfigModule } from '../config';
|
|
19
18
|
import { InjectLogger } from '../logging';
|
|
20
19
|
|
|
21
20
|
import { InstrumentationService } from './services/instrumentation.service';
|
|
@@ -40,8 +39,6 @@ export class TracingModule {
|
|
|
40
39
|
static forRoot(options: TracingModuleOptions): DynamicModule {
|
|
41
40
|
return {
|
|
42
41
|
module: TracingModule,
|
|
43
|
-
|
|
44
|
-
imports: [PlatformConfigModule.forFeature(TracingModuleConfig)],
|
|
45
42
|
providers: [
|
|
46
43
|
ExtendedMetadataScanner,
|
|
47
44
|
InstrumentationService,
|