@tsed/di 6.114.2 → 6.114.5-rc.1
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/lib/cjs/constants/constants.js +1 -3
- package/lib/cjs/constants/constants.js.map +1 -1
- package/lib/cjs/decorators/constant.js +8 -9
- package/lib/cjs/decorators/constant.js.map +1 -1
- package/lib/cjs/decorators/inject.js +26 -28
- package/lib/cjs/decorators/inject.js.map +1 -1
- package/lib/cjs/decorators/intercept.js +30 -10
- package/lib/cjs/decorators/intercept.js.map +1 -1
- package/lib/cjs/decorators/lazyInject.js +13 -14
- package/lib/cjs/decorators/lazyInject.js.map +1 -1
- package/lib/cjs/decorators/useOpts.js +1 -5
- package/lib/cjs/decorators/useOpts.js.map +1 -1
- package/lib/cjs/decorators/value.js +9 -9
- package/lib/cjs/decorators/value.js.map +1 -1
- package/lib/cjs/domain/ContextLogger.js +2 -2
- package/lib/cjs/domain/ContextLogger.js.map +1 -1
- package/lib/cjs/domain/DIContext.js +1 -5
- package/lib/cjs/domain/DIContext.js.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/{InjectableProperties.js → DILoggerOptions.js} +1 -1
- package/lib/cjs/interfaces/DILoggerOptions.js.map +1 -0
- package/lib/cjs/services/DIConfiguration.js +49 -43
- package/lib/cjs/services/DIConfiguration.js.map +1 -1
- package/lib/cjs/services/DITest.js +2 -2
- package/lib/cjs/services/DITest.js.map +1 -1
- package/lib/cjs/services/InjectorService.js +19 -133
- package/lib/cjs/services/InjectorService.js.map +1 -1
- package/lib/cjs/utils/setLoggerConfiguration.js +11 -0
- package/lib/cjs/utils/setLoggerConfiguration.js.map +1 -0
- package/lib/cjs/utils/setLoggerFormat.js +33 -0
- package/lib/cjs/utils/setLoggerFormat.js.map +1 -0
- package/lib/cjs/utils/setLoggerLevel.js +1 -2
- package/lib/cjs/utils/setLoggerLevel.js.map +1 -1
- package/lib/esm/constants/constants.js +0 -2
- package/lib/esm/constants/constants.js.map +1 -1
- package/lib/esm/decorators/constant.js +9 -10
- package/lib/esm/decorators/constant.js.map +1 -1
- package/lib/esm/decorators/inject.js +28 -30
- package/lib/esm/decorators/inject.js.map +1 -1
- package/lib/esm/decorators/intercept.js +31 -11
- package/lib/esm/decorators/intercept.js.map +1 -1
- package/lib/esm/decorators/lazyInject.js +13 -14
- package/lib/esm/decorators/lazyInject.js.map +1 -1
- package/lib/esm/decorators/useOpts.js +2 -6
- package/lib/esm/decorators/useOpts.js.map +1 -1
- package/lib/esm/decorators/value.js +10 -10
- package/lib/esm/decorators/value.js.map +1 -1
- package/lib/esm/domain/ContextLogger.js +2 -2
- package/lib/esm/domain/ContextLogger.js.map +1 -1
- package/lib/esm/domain/DIContext.js +1 -5
- package/lib/esm/domain/DIContext.js.map +1 -1
- package/lib/esm/index.js +3 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/DILoggerOptions.js +2 -0
- package/lib/esm/interfaces/DILoggerOptions.js.map +1 -0
- package/lib/esm/services/DIConfiguration.js +50 -44
- package/lib/esm/services/DIConfiguration.js.map +1 -1
- package/lib/esm/services/DITest.js +2 -2
- package/lib/esm/services/DITest.js.map +1 -1
- package/lib/esm/services/InjectorService.js +21 -135
- package/lib/esm/services/InjectorService.js.map +1 -1
- package/lib/esm/utils/setLoggerConfiguration.js +7 -0
- package/lib/esm/utils/setLoggerConfiguration.js.map +1 -0
- package/lib/esm/utils/setLoggerFormat.js +29 -0
- package/lib/esm/utils/setLoggerFormat.js.map +1 -0
- package/lib/esm/utils/setLoggerLevel.js +1 -2
- package/lib/esm/utils/setLoggerLevel.js.map +1 -1
- package/lib/types/constants/constants.d.ts +0 -2
- package/lib/types/decorators/inject.d.ts +5 -2
- package/lib/types/domain/DIContext.d.ts +2 -2
- package/lib/types/index.d.ts +3 -1
- package/lib/types/interfaces/DILoggerOptions.d.ts +44 -0
- package/lib/types/services/DIConfiguration.d.ts +17 -12
- package/lib/types/services/InjectorService.d.ts +5 -50
- package/lib/types/utils/setLoggerConfiguration.d.ts +2 -0
- package/lib/types/utils/setLoggerFormat.d.ts +6 -0
- package/lib/types/utils/setLoggerLevel.d.ts +1 -1
- package/package.json +9 -6
- package/readme.md +2 -1
- package/lib/cjs/interfaces/InjectableProperties.js.map +0 -1
- package/lib/esm/interfaces/InjectableProperties.js +0 -2
- package/lib/esm/interfaces/InjectableProperties.js.map +0 -1
- package/lib/types/interfaces/InjectableProperties.d.ts +0 -24
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
* @param injector
|
|
4
|
+
*/
|
|
5
|
+
export function setLoggerFormat(injector) {
|
|
6
|
+
const { level, format } = injector.settings.logger;
|
|
7
|
+
if (level) {
|
|
8
|
+
injector.logger.level = level;
|
|
9
|
+
}
|
|
10
|
+
if (format && injector.logger.appenders) {
|
|
11
|
+
injector.logger.appenders.set("stdout", {
|
|
12
|
+
type: "stdout",
|
|
13
|
+
levels: ["info", "debug"],
|
|
14
|
+
layout: {
|
|
15
|
+
type: "pattern",
|
|
16
|
+
pattern: format
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
injector.logger.appenders.set("stderr", {
|
|
20
|
+
levels: ["trace", "fatal", "error", "warn"],
|
|
21
|
+
type: "stderr",
|
|
22
|
+
layout: {
|
|
23
|
+
type: "pattern",
|
|
24
|
+
pattern: format
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=setLoggerFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setLoggerFormat.js","sourceRoot":"","sources":["../../../src/utils/setLoggerFormat.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,QAAyB;IACvD,MAAM,EAAC,KAAK,EAAE,MAAM,EAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEjD,IAAI,KAAK,EAAE;QACT,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;KAC/B;IAED,IAAI,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE;QACvC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE;YACtC,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;YACzB,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM;aAChB;SACF,CAAC,CAAC;QAEH,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE;YACtC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;YAC3C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM;aAChB;SACF,CAAC,CAAC;KACJ;AACH,CAAC","sourcesContent":["import type {InjectorService} from \"../services/InjectorService\";\n\n/**\n * @ignore\n * @param injector\n */\nexport function setLoggerFormat(injector: InjectorService) {\n const {level, format} = injector.settings.logger;\n\n if (level) {\n injector.logger.level = level;\n }\n\n if (format && injector.logger.appenders) {\n injector.logger.appenders.set(\"stdout\", {\n type: \"stdout\",\n levels: [\"info\", \"debug\"],\n layout: {\n type: \"pattern\",\n pattern: format\n }\n });\n\n injector.logger.appenders.set(\"stderr\", {\n levels: [\"trace\", \"fatal\", \"error\", \"warn\"],\n type: \"stderr\",\n layout: {\n type: \"pattern\",\n pattern: format\n }\n });\n }\n}\n"]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* @param injector
|
|
4
4
|
*/
|
|
5
5
|
export function setLoggerLevel(injector) {
|
|
6
|
-
|
|
7
|
-
const level = (_a = injector.settings.logger) === null || _a === void 0 ? void 0 : _a.level;
|
|
6
|
+
const { level } = injector.settings.logger;
|
|
8
7
|
if (level) {
|
|
9
8
|
injector.logger.level = level;
|
|
10
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setLoggerLevel.js","sourceRoot":"","sources":["../../../src/utils/setLoggerLevel.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAyB
|
|
1
|
+
{"version":3,"file":"setLoggerLevel.js","sourceRoot":"","sources":["../../../src/utils/setLoggerLevel.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAyB;IACtD,MAAM,EAAC,KAAK,EAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;IAEzC,IAAI,KAAK,EAAE;QACT,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;KAC/B;AACH,CAAC","sourcesContent":["import type {InjectorService} from \"../services/InjectorService\";\n\n/**\n * @ignore\n * @param injector\n */\nexport function setLoggerLevel(injector: InjectorService) {\n const {level} = injector.settings.logger;\n\n if (level) {\n injector.logger.level = level;\n }\n}\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { InvokeOptions } from "../interfaces/InvokeOptions";
|
|
2
|
+
import { TokenProvider } from "../interfaces/TokenProvider";
|
|
3
|
+
import { InjectorService } from "../services/InjectorService";
|
|
4
|
+
export declare type InjectPropertyResolver = (injector: InjectorService, locals: Map<TokenProvider, any>, options: Partial<InvokeOptions>) => () => any;
|
|
5
|
+
export declare function injectProperty(target: any, propertyKey: string, resolver: InjectPropertyResolver): void;
|
|
3
6
|
/**
|
|
4
7
|
* Inject a provider to another provider.
|
|
5
8
|
*
|
|
@@ -53,11 +53,11 @@ export declare class DIContext extends Map<any, any> implements ContextMethods {
|
|
|
53
53
|
/**
|
|
54
54
|
* Logger attached to the context request.
|
|
55
55
|
*/
|
|
56
|
-
logger: ContextLogger;
|
|
56
|
+
readonly logger: ContextLogger;
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
59
59
|
*/
|
|
60
|
-
injector: InjectorService;
|
|
60
|
+
readonly injector: InjectorService;
|
|
61
61
|
constructor({ id, injector, logger, ignoreLog, ...options }: DIContextOptions);
|
|
62
62
|
get env(): any;
|
|
63
63
|
destroy(): Promise<void>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export * from "./errors/InjectionError";
|
|
|
29
29
|
export * from "./errors/UndefinedTokenError";
|
|
30
30
|
export * from "./interfaces/DIConfigurationOptions";
|
|
31
31
|
export * from "./interfaces/DILogger";
|
|
32
|
+
export * from "./interfaces/DILoggerOptions";
|
|
32
33
|
export * from "./interfaces/DIResolver";
|
|
33
|
-
export * from "./interfaces/InjectableProperties";
|
|
34
34
|
export * from "./interfaces/InterceptorContext";
|
|
35
35
|
export * from "./interfaces/InterceptorMethods";
|
|
36
36
|
export * from "./interfaces/InvokeOptions";
|
|
@@ -52,4 +52,6 @@ export * from "./utils/createContainer";
|
|
|
52
52
|
export * from "./utils/getConfiguration";
|
|
53
53
|
export * from "./utils/resolveControllers";
|
|
54
54
|
export * from "./utils/runInContext";
|
|
55
|
+
export * from "./utils/setLoggerConfiguration";
|
|
56
|
+
export * from "./utils/setLoggerFormat";
|
|
55
57
|
export * from "./utils/setLoggerLevel";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface DILoggerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Enable debug mode. By default debug is false.
|
|
4
|
+
*/
|
|
5
|
+
debug?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Enable info mode. By default debug is false.
|
|
8
|
+
*/
|
|
9
|
+
level?: "debug" | "info" | "warn" | "error" | "off";
|
|
10
|
+
/**
|
|
11
|
+
* Enable log performance tracker and disable log server.
|
|
12
|
+
*/
|
|
13
|
+
perf?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* List of regexp to ignore log.
|
|
16
|
+
*/
|
|
17
|
+
ignoreUrlPatterns?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* The number of space characters to use as white space in JSON output. Default is 2 (0 in production).
|
|
20
|
+
*/
|
|
21
|
+
jsonIndentation?: number;
|
|
22
|
+
/**
|
|
23
|
+
* A function called for each incoming request to create a request id.
|
|
24
|
+
* @returns {number}
|
|
25
|
+
*/
|
|
26
|
+
reqIdBuilder?: (req: any) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Disable routes table displayed in the logger. By default debug is `false`.
|
|
29
|
+
*/
|
|
30
|
+
disableRoutesSummary?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Disable bootstrap log displayed in the logger. By default debug is `false`.
|
|
33
|
+
*/
|
|
34
|
+
disableBootstrapLog?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Specify log format. Example: `%[%d{[yyyy-MM-dd hh:mm:ss,SSS}] %p%] %m`. See [@tsed/logger configuration](https://tsedio.github.io/logger/).
|
|
37
|
+
*/
|
|
38
|
+
format?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Specify the log stack size for the context.logger. When the stack.length is reach, the logger is flushed during the request.
|
|
41
|
+
* Default size is set to 30.
|
|
42
|
+
*/
|
|
43
|
+
maxStackSize?: number;
|
|
44
|
+
}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Env } from "@tsed/core";
|
|
2
|
+
import type { ProviderScope } from "../domain/ProviderScope";
|
|
3
|
+
import type { DILoggerOptions } from "../interfaces/DILoggerOptions";
|
|
2
4
|
import type { DIResolver } from "../interfaces/DIResolver";
|
|
3
5
|
import type { TokenProvider } from "../interfaces/TokenProvider";
|
|
4
|
-
import { TokenRoute } from "../interfaces/TokenRoute";
|
|
6
|
+
import type { TokenRoute } from "../interfaces/TokenRoute";
|
|
5
7
|
export declare class DIConfiguration {
|
|
6
8
|
readonly default: Map<string, any>;
|
|
7
9
|
protected map: Map<string, any>;
|
|
8
|
-
[key: string]: any;
|
|
9
10
|
constructor(initialProps?: {});
|
|
10
|
-
get
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
set
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
get version(): string;
|
|
12
|
+
set version(v: string);
|
|
13
|
+
get rootDir(): string;
|
|
14
|
+
set rootDir(value: string);
|
|
15
|
+
get env(): Env;
|
|
16
|
+
set env(value: Env);
|
|
17
|
+
get scopes(): Record<string, ProviderScope>;
|
|
18
|
+
set scopes(value: Record<string, ProviderScope>);
|
|
16
19
|
get resolvers(): DIResolver[];
|
|
17
20
|
set resolvers(resolvers: DIResolver[]);
|
|
18
21
|
get imports(): TokenProvider[];
|
|
19
22
|
set imports(imports: TokenProvider[]);
|
|
20
23
|
get routes(): TokenRoute[];
|
|
21
24
|
set routes(routes: TokenRoute[]);
|
|
25
|
+
get logger(): Partial<DILoggerOptions>;
|
|
26
|
+
set logger(value: Partial<DILoggerOptions>);
|
|
27
|
+
get debug(): boolean;
|
|
28
|
+
set debug(debug: boolean);
|
|
22
29
|
/**
|
|
23
30
|
*
|
|
24
31
|
* @param callbackfn
|
|
@@ -39,13 +46,11 @@ export declare class DIConfiguration {
|
|
|
39
46
|
* @returns {undefined|any}
|
|
40
47
|
*/
|
|
41
48
|
get<T = any>(propertyKey: string, defaultValue?: T): T;
|
|
42
|
-
getRaw(propertyKey: string, defaultValue?: any): any;
|
|
43
|
-
merge(obj: Partial<TsED.Configuration>): void;
|
|
49
|
+
protected getRaw(propertyKey: string, defaultValue?: any): any;
|
|
44
50
|
/**
|
|
45
51
|
*
|
|
46
52
|
* @param value
|
|
47
53
|
* @returns {any}
|
|
48
54
|
*/
|
|
49
55
|
resolve(value: any): any;
|
|
50
|
-
build(): void;
|
|
51
56
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Container } from "../domain/Container";
|
|
2
2
|
import { LocalsContainer } from "../domain/LocalsContainer";
|
|
3
3
|
import { Provider } from "../domain/Provider";
|
|
4
|
-
import { DIConfiguration } from "./DIConfiguration";
|
|
5
4
|
import { ProviderScope } from "../domain/ProviderScope";
|
|
6
5
|
import { DILogger } from "../interfaces/DILogger";
|
|
7
|
-
import { TokenProvider } from "../interfaces/TokenProvider";
|
|
8
|
-
import { ProviderOpts } from "../interfaces/ProviderOpts";
|
|
9
6
|
import { InvokeOptions } from "../interfaces/InvokeOptions";
|
|
10
|
-
import {
|
|
7
|
+
import { ProviderOpts } from "../interfaces/ProviderOpts";
|
|
8
|
+
import { TokenProvider } from "../interfaces/TokenProvider";
|
|
11
9
|
import { runInContext } from "../utils/runInContext";
|
|
10
|
+
import { DIConfiguration } from "./DIConfiguration";
|
|
12
11
|
/**
|
|
13
12
|
* This service contain all services collected by `@Service` or services declared manually with `InjectorService.factory()` or `InjectorService.service()`.
|
|
14
13
|
*
|
|
@@ -32,17 +31,13 @@ import { runInContext } from "../utils/runInContext";
|
|
|
32
31
|
*/
|
|
33
32
|
export declare class InjectorService extends Container {
|
|
34
33
|
#private;
|
|
35
|
-
settings:
|
|
34
|
+
settings: DIConfiguration;
|
|
36
35
|
logger: DILogger;
|
|
37
36
|
runInContext: typeof runInContext;
|
|
38
37
|
private resolvedConfiguration;
|
|
39
38
|
constructor();
|
|
40
39
|
get resolvers(): import("..").DIResolver[];
|
|
41
|
-
get scopes():
|
|
42
|
-
[key: string]: ProviderScope;
|
|
43
|
-
} & {
|
|
44
|
-
[key: string]: ProviderScope;
|
|
45
|
-
};
|
|
40
|
+
get scopes(): Record<string, ProviderScope>;
|
|
46
41
|
/**
|
|
47
42
|
* Retrieve default scope for a given provider.
|
|
48
43
|
* @param provider
|
|
@@ -147,46 +142,6 @@ export declare class InjectorService extends Container {
|
|
|
147
142
|
* @param options
|
|
148
143
|
*/
|
|
149
144
|
bindInjectableProperties(instance: any, locals: Map<TokenProvider, any>, options: Partial<InvokeOptions>): void;
|
|
150
|
-
/**
|
|
151
|
-
*
|
|
152
|
-
* @param instance
|
|
153
|
-
* @param {string} propertyKey
|
|
154
|
-
*/
|
|
155
|
-
bindMethod(instance: any, { propertyKey }: InjectablePropertyOptions): void;
|
|
156
|
-
/**
|
|
157
|
-
* Create an injectable property.
|
|
158
|
-
*
|
|
159
|
-
* @param instance
|
|
160
|
-
* @param {string} propertyKey
|
|
161
|
-
* @param {any} useType
|
|
162
|
-
* @param resolver
|
|
163
|
-
* @param options
|
|
164
|
-
* @param locals
|
|
165
|
-
* @param invokeOptions
|
|
166
|
-
*/
|
|
167
|
-
bindProperty(instance: any, { propertyKey, resolver, options }: InjectablePropertyOptions, locals: Map<TokenProvider, any>, invokeOptions: Partial<InvokeOptions>): void;
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
170
|
-
* @param instance
|
|
171
|
-
* @param {string} propertyKey
|
|
172
|
-
* @param {any} useType
|
|
173
|
-
*/
|
|
174
|
-
bindValue(instance: any, { propertyKey, expression, defaultValue }: InjectablePropertyValue): void;
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @param instance
|
|
178
|
-
* @param {string} propertyKey
|
|
179
|
-
* @param {any} useType
|
|
180
|
-
*/
|
|
181
|
-
bindConstant(instance: any, { propertyKey, expression, defaultValue }: InjectablePropertyValue): void;
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
* @param instance
|
|
185
|
-
* @param propertyKey
|
|
186
|
-
* @param useType
|
|
187
|
-
* @param options
|
|
188
|
-
*/
|
|
189
|
-
bindInterceptor(instance: any, { propertyKey, useType, options }: InjectablePropertyOptions): void;
|
|
190
145
|
lazyInvoke<T = any>(token: TokenProvider): Promise<any>;
|
|
191
146
|
/**
|
|
192
147
|
* Emit an event to all service. See service [lifecycle hooks](/docs/services.md#lifecycle-hooks).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/di",
|
|
3
|
-
"version": "6.114.
|
|
3
|
+
"version": "6.114.5-rc.1",
|
|
4
4
|
"description": "DI module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"tslib": "2.3.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tsed/core": "6.114.
|
|
26
|
+
"@tsed/core": "6.114.5-rc.1",
|
|
27
27
|
"@tsed/logger": ">=6.1.1",
|
|
28
|
-
"@tsed/schema": "6.114.
|
|
28
|
+
"@tsed/schema": "6.114.5-rc.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@tsed/core": "^6.114.
|
|
31
|
+
"@tsed/core": "^6.114.5-rc.1",
|
|
32
32
|
"@tsed/logger": ">=6.1.1",
|
|
33
|
-
"@tsed/schema": "^6.114.
|
|
33
|
+
"@tsed/schema": "^6.114.5-rc.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@tsed/core": {
|
|
@@ -49,5 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/di",
|
|
51
51
|
"author": "Romain Lenzotti",
|
|
52
|
-
"license": "MIT"
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"tag": "rc"
|
|
55
|
+
}
|
|
53
56
|
}
|
package/readme.md
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
[](https://badge.fury.io/js/%40tsed%2Fcommon)
|
|
12
12
|
[](https://github.com/semantic-release/semantic-release)
|
|
13
13
|
[](https://github.com/prettier/prettier)
|
|
14
|
-
[](https://github.com/sponsors/romakita)
|
|
15
|
+
[](https://opencollective.com/tsed)
|
|
15
16
|
|
|
16
17
|
</div>
|
|
17
18
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InjectableProperties.js","sourceRoot":"","sources":["../../../src/interfaces/InjectableProperties.ts"],"names":[],"mappings":"","sourcesContent":["import type {InjectablePropertyType} from \"../domain/InjectablePropertyType\";\nimport type {TokenProvider} from \"./TokenProvider\";\nimport type {InjectorService} from \"../services/InjectorService\";\nimport type {InvokeOptions} from \"./InvokeOptions\";\n\nexport interface InjectableProperty {\n propertyKey: string;\n}\n\nexport interface InjectablePropertyOptions extends InjectableProperty {\n bindingType: InjectablePropertyType.METHOD | InjectablePropertyType.PROPERTY | InjectablePropertyType.INTERCEPTOR;\n propertyType: string;\n useType?: TokenProvider;\n resolver: (injector: InjectorService, locals: Map<TokenProvider, any>, options: Partial<InvokeOptions> & {options: any}) => () => any;\n options?: any;\n}\n\nexport interface InjectablePropertyValue extends InjectableProperty {\n bindingType: InjectablePropertyType.CONSTANT | InjectablePropertyType.VALUE;\n expression: string;\n defaultValue?: any;\n}\n\nexport interface InjectableProperties {\n [key: string]: InjectablePropertyOptions | InjectablePropertyValue;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InjectableProperties.js","sourceRoot":"","sources":["../../../src/interfaces/InjectableProperties.ts"],"names":[],"mappings":"","sourcesContent":["import type {InjectablePropertyType} from \"../domain/InjectablePropertyType\";\nimport type {TokenProvider} from \"./TokenProvider\";\nimport type {InjectorService} from \"../services/InjectorService\";\nimport type {InvokeOptions} from \"./InvokeOptions\";\n\nexport interface InjectableProperty {\n propertyKey: string;\n}\n\nexport interface InjectablePropertyOptions extends InjectableProperty {\n bindingType: InjectablePropertyType.METHOD | InjectablePropertyType.PROPERTY | InjectablePropertyType.INTERCEPTOR;\n propertyType: string;\n useType?: TokenProvider;\n resolver: (injector: InjectorService, locals: Map<TokenProvider, any>, options: Partial<InvokeOptions> & {options: any}) => () => any;\n options?: any;\n}\n\nexport interface InjectablePropertyValue extends InjectableProperty {\n bindingType: InjectablePropertyType.CONSTANT | InjectablePropertyType.VALUE;\n expression: string;\n defaultValue?: any;\n}\n\nexport interface InjectableProperties {\n [key: string]: InjectablePropertyOptions | InjectablePropertyValue;\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { InjectablePropertyType } from "../domain/InjectablePropertyType";
|
|
2
|
-
import type { TokenProvider } from "./TokenProvider";
|
|
3
|
-
import type { InjectorService } from "../services/InjectorService";
|
|
4
|
-
import type { InvokeOptions } from "./InvokeOptions";
|
|
5
|
-
export interface InjectableProperty {
|
|
6
|
-
propertyKey: string;
|
|
7
|
-
}
|
|
8
|
-
export interface InjectablePropertyOptions extends InjectableProperty {
|
|
9
|
-
bindingType: InjectablePropertyType.METHOD | InjectablePropertyType.PROPERTY | InjectablePropertyType.INTERCEPTOR;
|
|
10
|
-
propertyType: string;
|
|
11
|
-
useType?: TokenProvider;
|
|
12
|
-
resolver: (injector: InjectorService, locals: Map<TokenProvider, any>, options: Partial<InvokeOptions> & {
|
|
13
|
-
options: any;
|
|
14
|
-
}) => () => any;
|
|
15
|
-
options?: any;
|
|
16
|
-
}
|
|
17
|
-
export interface InjectablePropertyValue extends InjectableProperty {
|
|
18
|
-
bindingType: InjectablePropertyType.CONSTANT | InjectablePropertyType.VALUE;
|
|
19
|
-
expression: string;
|
|
20
|
-
defaultValue?: any;
|
|
21
|
-
}
|
|
22
|
-
export interface InjectableProperties {
|
|
23
|
-
[key: string]: InjectablePropertyOptions | InjectablePropertyValue;
|
|
24
|
-
}
|