@rsdk/core 4.3.3-next.0 → 4.4.0-next.0
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,12 @@
|
|
|
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.4.0-next.0](https://github.com/R-Vision/rsdk/compare/v4.3.3-next.0...v4.4.0-next.0) (2024-03-27)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **core:** added custom extractors to plugins ([8489892](https://github.com/R-Vision/rsdk/commit/8489892978a84ca725c417947b02c7aa336eef54))
|
|
11
|
+
|
|
6
12
|
## [4.3.3-next.0](https://github.com/R-Vision/rsdk/compare/v4.3.2...v4.3.3-next.0) (2024-03-27)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @rsdk/core
|
|
@@ -26,7 +26,10 @@ class ContextAggregator {
|
|
|
26
26
|
return this._aggregated;
|
|
27
27
|
}
|
|
28
28
|
const platformRoot = platform_module_1.PlatformModule.forRoot(this.platformContext.extendedOptions);
|
|
29
|
-
const rsdkMetadataProvider = await metadata_1.RsdkMetadataProvider.create([platformRoot], [
|
|
29
|
+
const rsdkMetadataProvider = await metadata_1.RsdkMetadataProvider.create([platformRoot], [
|
|
30
|
+
new config_metadata_extractor_1.ConfigMetadataExtractor(),
|
|
31
|
+
...(this.platformContext.options.plugins?.flatMap?.((p) => p.extractors?.() ?? []) ?? []),
|
|
32
|
+
]);
|
|
30
33
|
const rsdkMetadataGlobalModule = await rsdk_metadata_global_module_1.RsdkMetadataGlobalModule.fromProvider(rsdkMetadataProvider);
|
|
31
34
|
const configContext = new config_1.ConfigContext(rsdkMetadataProvider, {
|
|
32
35
|
...this.platformContext.options.config,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.aggregator.js","sourceRoot":"","sources":["../src/context.aggregator.ts"],"names":[],"mappings":";;;AACA,6CAAsD;AAEtD,oDAA8D;AAC9D,yFAAoF;AACpF,6FAAuF;AAEvF,qCAAyC;AAEzC,uDAAmD;AAEnD,MAAa,iBAAiB;IAGR;IAFZ,WAAW,CAAqB;IAExC,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAExD;;;;;;;OAOG;IACH,KAAK,CAAC,aAAa;QACjB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QACD,MAAM,YAAY,GAAG,gCAAc,CAAC,OAAO,CACzC,IAAI,CAAC,eAAe,CAAC,eAAe,CACrC,CAAC;QACF,MAAM,oBAAoB,GAAG,MAAM,+BAAoB,CAAC,MAAM,CAC5D,CAAC,YAAY,CAAC,EACd,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"context.aggregator.js","sourceRoot":"","sources":["../src/context.aggregator.ts"],"names":[],"mappings":";;;AACA,6CAAsD;AAEtD,oDAA8D;AAC9D,yFAAoF;AACpF,6FAAuF;AAEvF,qCAAyC;AAEzC,uDAAmD;AAEnD,MAAa,iBAAiB;IAGR;IAFZ,WAAW,CAAqB;IAExC,YAAoB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAExD;;;;;;;OAOG;IACH,KAAK,CAAC,aAAa;QACjB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QACD,MAAM,YAAY,GAAG,gCAAc,CAAC,OAAO,CACzC,IAAI,CAAC,eAAe,CAAC,eAAe,CACrC,CAAC;QACF,MAAM,oBAAoB,GAAG,MAAM,+BAAoB,CAAC,MAAM,CAC5D,CAAC,YAAY,CAAC,EACd;YACE,IAAI,mDAAuB,EAAE;YAC7B,GAAG,CAAC,IAAI,CAAC,eAAe,C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Consumer } from '@nestjs/common';
|
|
2
2
|
import type { Constructor } from '@rsdk/common';
|
|
3
|
+
import type { ResourceExtractor } from '@rsdk/metadata';
|
|
3
4
|
import type { IErrorsFormatter, IErrorsSender, IErrorsTransformer } from '../exceptions.handling';
|
|
4
5
|
import type { ProtocolTracingHeadersExtractor } from './transports';
|
|
5
6
|
export type SpecifiedTransports = Readonly<string[]>;
|
|
@@ -12,6 +13,12 @@ export declare const hasSpecifiedTransports: (x: PlatformAppPlugin) => x is Plat
|
|
|
12
13
|
* outside. This is where plugins come in.
|
|
13
14
|
*/
|
|
14
15
|
export interface PlatformAppPlugin<T extends AppropriateTransports = AppropriateTransports> {
|
|
16
|
+
/**
|
|
17
|
+
* Additional resource extractors
|
|
18
|
+
* Maybe used with custom plugin entity
|
|
19
|
+
* @returns {ResourceExtractor[]}
|
|
20
|
+
*/
|
|
21
|
+
extractors?(): ResourceExtractor[];
|
|
15
22
|
tracingHeadersExtractors?(): {
|
|
16
23
|
extractor: ProtocolTracingHeadersExtractor;
|
|
17
24
|
protocol: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/types/plugins.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/types/plugins.ts"],"names":[],"mappings":";;;AAeO,MAAM,sBAAsB,GAAG,CACpC,CAAoB,EACyB,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,KAAK,CAAC;AAFjE,QAAA,sBAAsB,0BAE2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-next.0",
|
|
4
4
|
"description": "Nestjs based microservice chassis",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"@nestjs/core": "^10.0.0",
|
|
25
25
|
"@nestjs/microservices": "^10.0.0",
|
|
26
26
|
"@opentelemetry/api": "1.7.0",
|
|
27
|
-
"@rsdk/autodoc.protocol": "^4.
|
|
28
|
-
"@rsdk/common": "^4.
|
|
29
|
-
"@rsdk/common.nestjs": "^4.
|
|
30
|
-
"@rsdk/common.node": "^4.
|
|
31
|
-
"@rsdk/decorators": "^4.
|
|
32
|
-
"@rsdk/logging": "^4.
|
|
33
|
-
"@rsdk/metadata": "^4.
|
|
34
|
-
"@rsdk/nest-tools": "^4.
|
|
35
|
-
"@rsdk/tracing": "^4.
|
|
27
|
+
"@rsdk/autodoc.protocol": "^4.4.0-next.0",
|
|
28
|
+
"@rsdk/common": "^4.4.0-next.0",
|
|
29
|
+
"@rsdk/common.nestjs": "^4.4.0-next.0",
|
|
30
|
+
"@rsdk/common.node": "^4.4.0-next.0",
|
|
31
|
+
"@rsdk/decorators": "^4.4.0-next.0",
|
|
32
|
+
"@rsdk/logging": "^4.4.0-next.0",
|
|
33
|
+
"@rsdk/metadata": "^4.4.0-next.0",
|
|
34
|
+
"@rsdk/nest-tools": "^4.4.0-next.0",
|
|
35
|
+
"@rsdk/tracing": "^4.4.0-next.0",
|
|
36
36
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
37
37
|
"rxjs": "^7.0.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "eb3fc4825bbc45f38eb1cd9db712388b5e12d9ef"
|
|
40
40
|
}
|
|
@@ -31,7 +31,12 @@ export class ContextAggregator {
|
|
|
31
31
|
);
|
|
32
32
|
const rsdkMetadataProvider = await RsdkMetadataProvider.create(
|
|
33
33
|
[platformRoot],
|
|
34
|
-
[
|
|
34
|
+
[
|
|
35
|
+
new ConfigMetadataExtractor(),
|
|
36
|
+
...(this.platformContext.options.plugins?.flatMap?.(
|
|
37
|
+
(p) => p.extractors?.() ?? [],
|
|
38
|
+
) ?? []),
|
|
39
|
+
],
|
|
35
40
|
);
|
|
36
41
|
const rsdkMetadataGlobalModule =
|
|
37
42
|
await RsdkMetadataGlobalModule.fromProvider(rsdkMetadataProvider);
|
package/src/types/plugins.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DynamicModule, MiddlewareConsumer } from '@nestjs/common';
|
|
2
2
|
import type { Constructor } from '@rsdk/common';
|
|
3
|
+
import type { ResourceExtractor } from '@rsdk/metadata';
|
|
3
4
|
|
|
4
5
|
import type {
|
|
5
6
|
IErrorsFormatter,
|
|
@@ -25,6 +26,13 @@ export const hasSpecifiedTransports = (
|
|
|
25
26
|
export interface PlatformAppPlugin<
|
|
26
27
|
T extends AppropriateTransports = AppropriateTransports,
|
|
27
28
|
> {
|
|
29
|
+
/**
|
|
30
|
+
* Additional resource extractors
|
|
31
|
+
* Maybe used with custom plugin entity
|
|
32
|
+
* @returns {ResourceExtractor[]}
|
|
33
|
+
*/
|
|
34
|
+
extractors?(): ResourceExtractor[];
|
|
35
|
+
|
|
28
36
|
tracingHeadersExtractors?(): {
|
|
29
37
|
extractor: ProtocolTracingHeadersExtractor;
|
|
30
38
|
protocol: string;
|