@tsed/di 7.0.0-beta.2 → 7.0.0-beta.5
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/{index.js → constants.js} +1 -1
- package/lib/cjs/constants/constants.js.map +1 -0
- package/lib/cjs/decorators/constant.js +1 -1
- package/lib/cjs/decorators/constant.js.map +1 -1
- package/lib/cjs/decorators/controller.js.map +1 -1
- package/lib/cjs/decorators/inject.js +1 -1
- package/lib/cjs/decorators/inject.js.map +1 -1
- package/lib/cjs/decorators/injectable.js +0 -2
- package/lib/cjs/decorators/injectable.js.map +1 -1
- package/lib/cjs/decorators/intercept.js +20 -12
- package/lib/cjs/decorators/intercept.js.map +1 -1
- package/lib/cjs/decorators/module.js +4 -3
- package/lib/cjs/decorators/module.js.map +1 -1
- package/lib/cjs/decorators/opts.js +1 -1
- package/lib/cjs/decorators/opts.js.map +1 -1
- package/lib/cjs/decorators/useOpts.js +1 -1
- package/lib/cjs/decorators/useOpts.js.map +1 -1
- package/lib/cjs/decorators/value.js +1 -1
- package/lib/cjs/decorators/value.js.map +1 -1
- package/lib/cjs/domain/Container.js.map +1 -1
- package/lib/cjs/domain/DIContext.js.map +1 -1
- package/lib/cjs/domain/Provider.js.map +1 -1
- package/lib/cjs/errors/InjectionError.js.map +1 -1
- package/lib/cjs/index.js +52 -17
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/{IProvider.js → ProviderOpts.js} +1 -1
- package/lib/cjs/interfaces/ProviderOpts.js.map +1 -0
- package/lib/cjs/interfaces/RegistrySettings.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/registries/GlobalProviders.js +4 -4
- package/lib/cjs/registries/GlobalProviders.js.map +1 -1
- package/lib/cjs/registries/ProviderRegistry.js +7 -6
- package/lib/cjs/registries/ProviderRegistry.js.map +1 -1
- package/lib/cjs/services/DIConfiguration.js.map +1 -1
- package/lib/cjs/services/InjectorService.js +45 -45
- package/lib/cjs/services/InjectorService.js.map +1 -1
- package/lib/esm/constants/{index.js → constants.js} +1 -1
- package/lib/esm/constants/constants.js.map +1 -0
- package/lib/esm/decorators/configuration.js +1 -1
- package/lib/esm/decorators/constant.js +2 -2
- package/lib/esm/decorators/constant.js.map +1 -1
- package/lib/esm/decorators/controller.js +1 -1
- package/lib/esm/decorators/controller.js.map +1 -1
- package/lib/esm/decorators/inject.js +1 -1
- package/lib/esm/decorators/inject.js.map +1 -1
- package/lib/esm/decorators/injectable.js +1 -3
- package/lib/esm/decorators/injectable.js.map +1 -1
- package/lib/esm/decorators/intercept.js +21 -13
- package/lib/esm/decorators/intercept.js.map +1 -1
- package/lib/esm/decorators/interceptor.js +2 -2
- package/lib/esm/decorators/lazyInject.js +1 -1
- package/lib/esm/decorators/module.js +4 -3
- package/lib/esm/decorators/module.js.map +1 -1
- package/lib/esm/decorators/opts.js +4 -4
- package/lib/esm/decorators/opts.js.map +1 -1
- package/lib/esm/decorators/overrideProvider.js +1 -1
- package/lib/esm/decorators/scope.js +1 -1
- package/lib/esm/decorators/service.js +1 -1
- package/lib/esm/decorators/useOpts.js +1 -1
- package/lib/esm/decorators/useOpts.js.map +1 -1
- package/lib/esm/decorators/value.js +2 -2
- package/lib/esm/decorators/value.js.map +1 -1
- package/lib/esm/domain/Container.js +2 -2
- package/lib/esm/domain/Container.js.map +1 -1
- package/lib/esm/domain/DIContext.js +2 -2
- package/lib/esm/domain/DIContext.js.map +1 -1
- package/lib/esm/domain/Provider.js +2 -2
- package/lib/esm/domain/Provider.js.map +1 -1
- package/lib/esm/errors/InjectionError.js +1 -1
- package/lib/esm/errors/InjectionError.js.map +1 -1
- package/lib/esm/index.js +52 -17
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/ProviderOpts.js +2 -0
- package/lib/esm/interfaces/ProviderOpts.js.map +1 -0
- package/lib/esm/interfaces/RegistrySettings.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/registries/GlobalProviders.js +2 -2
- package/lib/esm/registries/GlobalProviders.js.map +1 -1
- package/lib/esm/registries/ProviderRegistry.js +5 -4
- package/lib/esm/registries/ProviderRegistry.js.map +1 -1
- package/lib/esm/services/DIConfiguration.js.map +1 -1
- package/lib/esm/services/DILogger.js +2 -2
- package/lib/esm/services/DITest.js +4 -4
- package/lib/esm/services/InjectorService.js +27 -27
- package/lib/esm/services/InjectorService.js.map +1 -1
- package/lib/esm/utils/createContainer.js +2 -2
- package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
- package/lib/types/decorators/controller.d.ts +2 -2
- package/lib/types/decorators/injectable.d.ts +2 -4
- package/lib/types/decorators/intercept.d.ts +2 -2
- package/lib/types/decorators/module.d.ts +3 -2
- package/lib/types/domain/Container.d.ts +3 -3
- package/lib/types/domain/DIContext.d.ts +0 -6
- package/lib/types/domain/Provider.d.ts +4 -6
- package/lib/types/errors/InjectionError.d.ts +1 -1
- package/lib/types/index.d.ts +46 -11
- package/lib/types/interfaces/{IProvider.d.ts → ProviderOpts.d.ts} +10 -4
- package/lib/types/interfaces/RegistrySettings.d.ts +1 -1
- package/lib/types/registries/GlobalProviders.d.ts +6 -4
- package/lib/types/registries/ProviderRegistry.d.ts +4 -4
- package/lib/types/services/DIConfiguration.d.ts +3 -2
- package/lib/types/services/InjectorService.d.ts +12 -10
- package/package.json +24 -9
- package/readme.md +37 -41
- package/tsconfig.compile.esm.json +1 -0
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -19
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -12
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/IProvider.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -18
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/utils/data/Test1.js +0 -8
- package/lib/cjs/utils/data/Test1.js.map +0 -1
- package/lib/cjs/utils/data/Test2.js +0 -8
- package/lib/cjs/utils/data/Test2.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -16
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -9
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/IProvider.js +0 -2
- package/lib/esm/interfaces/IProvider.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -15
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/utils/data/Test1.js +0 -4
- package/lib/esm/utils/data/Test1.js.map +0 -1
- package/lib/esm/utils/data/Test2.js +0 -4
- package/lib/esm/utils/data/Test2.js.map +0 -1
- package/lib/types/decorators/index.d.ts +0 -15
- package/lib/types/domain/index.d.ts +0 -8
- package/lib/types/interfaces/index.d.ts +0 -14
- package/lib/types/utils/data/Test1.d.ts +0 -3
- package/lib/types/utils/data/Test2.d.ts +0 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ProviderScope } from "../domain";
|
|
2
|
-
import type { DIResolver
|
|
1
|
+
import { ProviderScope } from "../domain/ProviderScope";
|
|
2
|
+
import type { DIResolver } from "../interfaces/DIResolver";
|
|
3
|
+
import type { TokenProvider } from "../interfaces/TokenProvider";
|
|
3
4
|
export declare class DIConfiguration {
|
|
4
5
|
readonly default: Map<string, any>;
|
|
5
6
|
protected map: Map<string, any>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { DIContext, ProviderScope } from "../domain";
|
|
2
1
|
import { Container } from "../domain/Container";
|
|
3
2
|
import { LocalsContainer } from "../domain/LocalsContainer";
|
|
4
3
|
import { Provider } from "../domain/Provider";
|
|
5
|
-
import { DILogger, InjectablePropertyOptions, InjectablePropertyValue, InvokeOptions, IProvider, TokenProvider } from "../interfaces";
|
|
6
4
|
import { DIConfiguration } from "./DIConfiguration";
|
|
5
|
+
import { ProviderScope } from "../domain/ProviderScope";
|
|
6
|
+
import { DILogger } from "../interfaces/DILogger";
|
|
7
|
+
import { TokenProvider } from "../interfaces/TokenProvider";
|
|
8
|
+
import { InvokeOptions } from "../interfaces/InvokeOptions";
|
|
9
|
+
import { InjectablePropertyOptions, InjectablePropertyValue } from "../interfaces/InjectableProperties";
|
|
10
|
+
import { DIContext } from "../domain/DIContext";
|
|
7
11
|
/**
|
|
8
12
|
* This service contain all services collected by `@Service` or services declared manually with `InjectorService.factory()` or `InjectorService.service()`.
|
|
9
13
|
*
|
|
@@ -31,7 +35,7 @@ export declare class InjectorService extends Container {
|
|
|
31
35
|
logger: DILogger;
|
|
32
36
|
private resolvedConfiguration;
|
|
33
37
|
constructor();
|
|
34
|
-
get resolvers(): import("
|
|
38
|
+
get resolvers(): import("..").DIResolver[];
|
|
35
39
|
get scopes(): {
|
|
36
40
|
[key: string]: ProviderScope;
|
|
37
41
|
} & {
|
|
@@ -42,13 +46,6 @@ export declare class InjectorService extends Container {
|
|
|
42
46
|
* @param provider
|
|
43
47
|
*/
|
|
44
48
|
scopeOf(provider: Provider): ProviderScope;
|
|
45
|
-
/**
|
|
46
|
-
* Clone a provider from GlobalProviders and the given token. forkProvider method build automatically the provider if the instance parameter ins't given.
|
|
47
|
-
* @param token
|
|
48
|
-
* @param settings
|
|
49
|
-
* @deprecated
|
|
50
|
-
*/
|
|
51
|
-
forkProvider(token: TokenProvider, settings?: Partial<IProvider<any>>): Provider;
|
|
52
49
|
/**
|
|
53
50
|
* Return a list of instance build by the injector.
|
|
54
51
|
*/
|
|
@@ -74,6 +71,11 @@ export declare class InjectorService extends Container {
|
|
|
74
71
|
* @returns {boolean}
|
|
75
72
|
*/
|
|
76
73
|
get<T = any>(token: TokenProvider, options?: any): T | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Return all instance of the same provider type
|
|
76
|
+
* @param type
|
|
77
|
+
*/
|
|
78
|
+
getAll(type: string): any[];
|
|
77
79
|
/**
|
|
78
80
|
* The has() method returns a boolean indicating whether an element with the specified key exists or not.
|
|
79
81
|
* @returns {boolean}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/di",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.5",
|
|
4
4
|
"description": "DI module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,26 +14,40 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
17
18
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
19
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
20
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\""
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"@tsed/schema": "7.0.0-beta.2",
|
|
23
|
-
"tslib": "2.2.0"
|
|
23
|
+
"tslib": "2.3.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tsed/
|
|
26
|
+
"@tsed/core": "7.0.0-beta.5",
|
|
27
|
+
"@tsed/logger": ">=6.1.1",
|
|
28
|
+
"@tsed/schema": "7.0.0-beta.5"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
|
-
"@tsed/
|
|
31
|
+
"@tsed/core": "^7.0.0-beta.5",
|
|
32
|
+
"@tsed/logger": ">=6.1.1",
|
|
33
|
+
"@tsed/schema": "^7.0.0-beta.5"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"@tsed/core": {
|
|
37
|
+
"optional": false
|
|
38
|
+
},
|
|
39
|
+
"@tsed/logger": {
|
|
40
|
+
"optional": false
|
|
41
|
+
},
|
|
42
|
+
"@tsed/schema": {
|
|
43
|
+
"optional": false
|
|
44
|
+
}
|
|
30
45
|
},
|
|
31
46
|
"repository": "https://github.com/tsedio/tsed",
|
|
32
47
|
"bugs": {
|
|
33
48
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
34
49
|
},
|
|
35
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
50
|
+
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/di",
|
|
36
51
|
"author": "Romain Lenzotti",
|
|
37
52
|
"license": "MIT"
|
|
38
53
|
}
|
package/readme.md
CHANGED
|
@@ -32,39 +32,36 @@ A package of Ts.ED framework. See website: https://tsed.io/
|
|
|
32
32
|
# Installation
|
|
33
33
|
|
|
34
34
|
You can get the latest release and the type definitions using npm:
|
|
35
|
+
|
|
35
36
|
```bash
|
|
36
37
|
npm install --save @tsed/di
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
> **Important!** TsExpressDecorators requires Node >= 6, Express >= 4, TypeScript >= 2.0 and
|
|
40
|
-
the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib` compilation
|
|
41
|
-
options in your `tsconfig.json` file.
|
|
40
|
+
> **Important!** TsExpressDecorators requires Node >= 6, Express >= 4, TypeScript >= 2.0 and
|
|
41
|
+
> the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib` compilation
|
|
42
|
+
> options in your `tsconfig.json` file.
|
|
42
43
|
|
|
43
44
|
```json
|
|
44
45
|
{
|
|
45
46
|
"compilerOptions": {
|
|
46
47
|
"target": "es2016",
|
|
47
48
|
"lib": ["es2016"],
|
|
48
|
-
"typeRoots": [
|
|
49
|
-
"./node_modules/@types"
|
|
50
|
-
],
|
|
49
|
+
"typeRoots": ["./node_modules/@types"],
|
|
51
50
|
"module": "commonjs",
|
|
52
51
|
"moduleResolution": "node",
|
|
53
|
-
"experimentalDecorators":true,
|
|
52
|
+
"experimentalDecorators": true,
|
|
54
53
|
"emitDecoratorMetadata": true,
|
|
55
54
|
"allowSyntheticDefaultImports": true
|
|
56
55
|
},
|
|
57
|
-
"exclude": [
|
|
58
|
-
"node_modules"
|
|
59
|
-
]
|
|
56
|
+
"exclude": ["node_modules"]
|
|
60
57
|
}
|
|
61
58
|
```
|
|
62
59
|
|
|
63
60
|
## Introduction
|
|
64
61
|
|
|
65
|
-
Basically, almost everything may be considered as a provider – service, factory, intereceptors, and so on.
|
|
62
|
+
Basically, almost everything may be considered as a provider – service, factory, intereceptors, and so on.
|
|
66
63
|
All of them can inject dependencies, meaning, they can create various relationships with each other.
|
|
67
|
-
|
|
64
|
+
But in fact, a provider is nothing else than just a simple class annotated with an `@Injectable()` decorator.
|
|
68
65
|
|
|
69
66
|
## Usage
|
|
70
67
|
|
|
@@ -77,27 +74,28 @@ import {Calendar} from "./models/calendar";
|
|
|
77
74
|
@Injectable()
|
|
78
75
|
export class CalendarsService {
|
|
79
76
|
private readonly calendars: Calendar[] = [];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
|
|
78
|
+
create(calendar: Calendar) {
|
|
79
|
+
this.calendars.push(calendar);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
findAll(): Calendar[] {
|
|
83
|
+
return this.calendars;
|
|
84
|
+
}
|
|
88
85
|
}
|
|
89
86
|
```
|
|
90
87
|
|
|
91
88
|
Here's a CalendarsService, a basic class with one property and two methods. The only new trait is that it uses the `@Injectable()` decorator.
|
|
92
89
|
The `@Injectable()` attaches the metadata, thereby Ts.ED knows that this class is a provider.
|
|
93
|
-
|
|
90
|
+
|
|
94
91
|
Now we have the service class already done, let's use it inside a controller:
|
|
92
|
+
|
|
95
93
|
```typescript
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
94
|
+
import {Controller, Post, Body, Get} from "@tsed/common";
|
|
95
|
+
import {CalendarsService} from "./CalendarsService";
|
|
96
|
+
import {Calendar} from "./models/Calendar";
|
|
99
97
|
|
|
100
|
-
@Controller(
|
|
98
|
+
@Controller("/calendars")
|
|
101
99
|
export class CalendarCtrl {
|
|
102
100
|
constructor(private readonly calendarsService: CalendarsService) {}
|
|
103
101
|
|
|
@@ -112,30 +110,31 @@ export class CalendarCtrl {
|
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
112
|
```
|
|
115
|
-
> Note: Controller isn't a part of `@tsed/di`. `@Controller` decorator is exposed by `@tsed/common` package because it's a specific provider
|
|
116
|
-
used by the Ts.ED framework. Ts.ED DI allow you to define your own Provider and decorator.
|
|
117
113
|
|
|
114
|
+
> Note: Controller isn't a part of `@tsed/di`. `@Controller` decorator is exposed by `@tsed/common` package because it's a specific provider
|
|
115
|
+
> used by the Ts.ED framework. Ts.ED DI allow you to define your own Provider and decorator.
|
|
118
116
|
|
|
119
117
|
Finally, we can load the injector and use:
|
|
118
|
+
|
|
120
119
|
```typescript
|
|
121
120
|
import {InjectorService} from "@tsed/di";
|
|
122
121
|
import {CalendarCtrl} from "./CalendarCtrl";
|
|
123
122
|
|
|
124
123
|
async function bootstrap() {
|
|
125
|
-
const injector = new InjectorService()
|
|
126
|
-
|
|
124
|
+
const injector = new InjectorService();
|
|
125
|
+
|
|
127
126
|
// Load all providers registered via @Injectable decorator
|
|
128
|
-
await injector.load()
|
|
129
|
-
|
|
130
|
-
const calendarController = injector.get<CalendarCtrl>()
|
|
131
|
-
|
|
132
|
-
await calendarController.create(new Calendar())
|
|
133
|
-
|
|
127
|
+
await injector.load();
|
|
128
|
+
|
|
129
|
+
const calendarController = injector.get<CalendarCtrl>();
|
|
130
|
+
|
|
131
|
+
await calendarController.create(new Calendar());
|
|
132
|
+
|
|
134
133
|
// And finally destroy injector and his instances (see injector hooks)
|
|
135
|
-
await injector.destroy()
|
|
134
|
+
await injector.destroy();
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
bootstrap()
|
|
137
|
+
bootstrap();
|
|
139
138
|
```
|
|
140
139
|
|
|
141
140
|
## Custom providers
|
|
@@ -147,23 +146,20 @@ To organize your code Ts.ED DI provide different kind of providers:
|
|
|
147
146
|
- Interceptor can be declared with `@Interceptor`,
|
|
148
147
|
- Factory and Value can be declared with `registerProvider` and `registerValue`.
|
|
149
148
|
|
|
150
|
-
|
|
151
149
|
See more details on our documentation https://tsed.io/providers.html
|
|
152
150
|
|
|
153
|
-
|
|
154
151
|
## Contributors
|
|
152
|
+
|
|
155
153
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html)
|
|
156
154
|
|
|
157
155
|
<a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
158
156
|
|
|
159
|
-
|
|
160
157
|
## Backers
|
|
161
158
|
|
|
162
159
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
163
160
|
|
|
164
161
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
|
|
165
162
|
|
|
166
|
-
|
|
167
163
|
## Sponsors
|
|
168
164
|
|
|
169
165
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,oBAAoB,CAAC;AACvC,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,gBAAgB,GAAG,kBAAkB,CAAC","sourcesContent":["export const INJECTABLE_PROP = \"DI:INJECTABLE_PROP\";\nexport const DI_PARAMS = \"DI:PARAMS\";\nexport const DI_PARAM_OPTIONS = \"DI:PARAM:OPTIONS\";\n"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./scope"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./service"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./overrideProvider"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./inject"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./lazyInject"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./injectable"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./constant"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./value"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./intercept"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./interceptor"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./configuration"), exports);
|
|
15
|
-
(0, tslib_1.__exportStar)(require("./module"), exports);
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./opts"), exports);
|
|
17
|
-
(0, tslib_1.__exportStar)(require("./useOpts"), exports);
|
|
18
|
-
(0, tslib_1.__exportStar)(require("./controller"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,uDAAwB;AACxB,yDAA0B;AAC1B,kEAAmC;AACnC,wDAAyB;AACzB,4DAA6B;AAC7B,4DAA6B;AAC7B,0DAA2B;AAC3B,uDAAwB;AACxB,2DAA4B;AAC5B,6DAA8B;AAC9B,+DAAgC;AAChC,wDAAyB;AACzB,sDAAuB;AACvB,yDAA0B;AAC1B,4DAA6B","sourcesContent":["export * from \"./scope\";\nexport * from \"./service\";\nexport * from \"./overrideProvider\";\nexport * from \"./inject\";\nexport * from \"./lazyInject\";\nexport * from \"./injectable\";\nexport * from \"./constant\";\nexport * from \"./value\";\nexport * from \"./intercept\";\nexport * from \"./interceptor\";\nexport * from \"./configuration\";\nexport * from \"./module\";\nexport * from \"./opts\";\nexport * from \"./useOpts\";\nexport * from \"./controller\";\n"]}
|
package/lib/cjs/domain/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./Container"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./InjectablePropertyType"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./LocalsContainer"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./Provider"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./ProviderScope"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./ProviderType"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./ContextLogger"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./DIContext"), exports);
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,2DAA4B;AAC5B,wEAAyC;AACzC,iEAAkC;AAClC,0DAA2B;AAC3B,+DAAgC;AAChC,8DAA+B;AAC/B,+DAAgC;AAChC,2DAA4B","sourcesContent":["export * from \"./Container\";\nexport * from \"./InjectablePropertyType\";\nexport * from \"./LocalsContainer\";\nexport * from \"./Provider\";\nexport * from \"./ProviderScope\";\nexport * from \"./ProviderType\";\nexport * from \"./ContextLogger\";\nexport * from \"./DIContext\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IProvider.js","sourceRoot":"","sources":["../../../src/interfaces/IProvider.ts"],"names":[],"mappings":"","sourcesContent":["import type {Type} from \"@tsed/core\";\nimport type {DIResolver} from \"./DIResolver\";\nimport type {ProviderScope} from \"../domain/ProviderScope\";\nimport type {ProviderType} from \"../domain/ProviderType\";\nimport type {TokenProvider} from \"./TokenProvider\";\n/**\n *\n */\nexport interface IProvider<T = any> {\n /**\n * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).\n */\n provide: TokenProvider;\n /**\n * Provider type\n */\n type?: ProviderType | string;\n /**\n * Instance build by the injector\n */\n instance?: T;\n /**\n * Define dependencies to build the provider\n */\n deps?: TokenProvider[];\n /**\n * Class to instantiate for the `token`.\n */\n useClass?: Type<T>;\n /**\n * Provide a function to build the provider\n */\n useFactory?: Function;\n /**\n * Provide an async function to build the provider\n */\n useAsyncFactory?: Function;\n /**\n * Provide predefined value\n */\n useValue?: any;\n /**\n * Scope used by the injector to build the provider.\n */\n scope?: ProviderScope;\n /**\n * A list of resolvers which will be used to resolve missing Symbol/Class when injector invoke a Class. This property allow external DI usage.\n */\n resolvers?: DIResolver[];\n\n /**\n *\n */\n [key: string]: any;\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./DILogger"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./DIConfigurationOptions"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./DIResolver"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./InjectableProperties"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./InterceptorMethods"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./InterceptorContext"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./InvokeOptions"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./IProvider"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./OnInit"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./OnDestroy"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./OnInit"), exports);
|
|
15
|
-
(0, tslib_1.__exportStar)(require("./RegistrySettings"), exports);
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./TokenProvider"), exports);
|
|
17
|
-
(0, tslib_1.__exportStar)(require("./ResolvedInvokeOptions"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,0DAA2B;AAC3B,wEAAyC;AACzC,4DAA6B;AAC7B,sEAAuC;AACvC,oEAAqC;AACrC,oEAAqC;AACrC,+DAAgC;AAChC,2DAA4B;AAC5B,wDAAyB;AACzB,2DAA4B;AAC5B,wDAAyB;AACzB,kEAAmC;AACnC,+DAAgC;AAChC,uEAAwC","sourcesContent":["export * from \"./DILogger\";\nexport * from \"./DIConfigurationOptions\";\nexport * from \"./DIResolver\";\nexport * from \"./InjectableProperties\";\nexport * from \"./InterceptorMethods\";\nexport * from \"./InterceptorContext\";\nexport * from \"./InvokeOptions\";\nexport * from \"./IProvider\";\nexport * from \"./OnInit\";\nexport * from \"./OnDestroy\";\nexport * from \"./OnInit\";\nexport * from \"./RegistrySettings\";\nexport * from \"./TokenProvider\";\nexport * from \"./ResolvedInvokeOptions\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../../src/utils/data/Test1.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../../src/utils/data/Test2.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAa,KAAK;CAAG;AAArB,sBAAqB","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC","sourcesContent":["export const INJECTABLE_PROP = \"DI:INJECTABLE_PROP\";\nexport const DI_PARAMS = \"DI:PARAMS\";\nexport const DI_PARAM_OPTIONS = \"DI:PARAM:OPTIONS\";\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./scope";
|
|
2
|
-
export * from "./service";
|
|
3
|
-
export * from "./overrideProvider";
|
|
4
|
-
export * from "./inject";
|
|
5
|
-
export * from "./lazyInject";
|
|
6
|
-
export * from "./injectable";
|
|
7
|
-
export * from "./constant";
|
|
8
|
-
export * from "./value";
|
|
9
|
-
export * from "./intercept";
|
|
10
|
-
export * from "./interceptor";
|
|
11
|
-
export * from "./configuration";
|
|
12
|
-
export * from "./module";
|
|
13
|
-
export * from "./opts";
|
|
14
|
-
export * from "./useOpts";
|
|
15
|
-
export * from "./controller";
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./scope\";\nexport * from \"./service\";\nexport * from \"./overrideProvider\";\nexport * from \"./inject\";\nexport * from \"./lazyInject\";\nexport * from \"./injectable\";\nexport * from \"./constant\";\nexport * from \"./value\";\nexport * from \"./intercept\";\nexport * from \"./interceptor\";\nexport * from \"./configuration\";\nexport * from \"./module\";\nexport * from \"./opts\";\nexport * from \"./useOpts\";\nexport * from \"./controller\";\n"]}
|
package/lib/esm/domain/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./Container";
|
|
2
|
-
export * from "./InjectablePropertyType";
|
|
3
|
-
export * from "./LocalsContainer";
|
|
4
|
-
export * from "./Provider";
|
|
5
|
-
export * from "./ProviderScope";
|
|
6
|
-
export * from "./ProviderType";
|
|
7
|
-
export * from "./ContextLogger";
|
|
8
|
-
export * from "./DIContext";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC","sourcesContent":["export * from \"./Container\";\nexport * from \"./InjectablePropertyType\";\nexport * from \"./LocalsContainer\";\nexport * from \"./Provider\";\nexport * from \"./ProviderScope\";\nexport * from \"./ProviderType\";\nexport * from \"./ContextLogger\";\nexport * from \"./DIContext\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IProvider.js","sourceRoot":"","sources":["../../../src/interfaces/IProvider.ts"],"names":[],"mappings":"","sourcesContent":["import type {Type} from \"@tsed/core\";\nimport type {DIResolver} from \"./DIResolver\";\nimport type {ProviderScope} from \"../domain/ProviderScope\";\nimport type {ProviderType} from \"../domain/ProviderType\";\nimport type {TokenProvider} from \"./TokenProvider\";\n/**\n *\n */\nexport interface IProvider<T = any> {\n /**\n * An injection token. (Typically an instance of `Type` or `InjectionToken`, but can be `any`).\n */\n provide: TokenProvider;\n /**\n * Provider type\n */\n type?: ProviderType | string;\n /**\n * Instance build by the injector\n */\n instance?: T;\n /**\n * Define dependencies to build the provider\n */\n deps?: TokenProvider[];\n /**\n * Class to instantiate for the `token`.\n */\n useClass?: Type<T>;\n /**\n * Provide a function to build the provider\n */\n useFactory?: Function;\n /**\n * Provide an async function to build the provider\n */\n useAsyncFactory?: Function;\n /**\n * Provide predefined value\n */\n useValue?: any;\n /**\n * Scope used by the injector to build the provider.\n */\n scope?: ProviderScope;\n /**\n * A list of resolvers which will be used to resolve missing Symbol/Class when injector invoke a Class. This property allow external DI usage.\n */\n resolvers?: DIResolver[];\n\n /**\n *\n */\n [key: string]: any;\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from "./DILogger";
|
|
2
|
-
export * from "./DIConfigurationOptions";
|
|
3
|
-
export * from "./DIResolver";
|
|
4
|
-
export * from "./InjectableProperties";
|
|
5
|
-
export * from "./InterceptorMethods";
|
|
6
|
-
export * from "./InterceptorContext";
|
|
7
|
-
export * from "./InvokeOptions";
|
|
8
|
-
export * from "./IProvider";
|
|
9
|
-
export * from "./OnInit";
|
|
10
|
-
export * from "./OnDestroy";
|
|
11
|
-
export * from "./OnInit";
|
|
12
|
-
export * from "./RegistrySettings";
|
|
13
|
-
export * from "./TokenProvider";
|
|
14
|
-
export * from "./ResolvedInvokeOptions";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./DILogger\";\nexport * from \"./DIConfigurationOptions\";\nexport * from \"./DIResolver\";\nexport * from \"./InjectableProperties\";\nexport * from \"./InterceptorMethods\";\nexport * from \"./InterceptorContext\";\nexport * from \"./InvokeOptions\";\nexport * from \"./IProvider\";\nexport * from \"./OnInit\";\nexport * from \"./OnDestroy\";\nexport * from \"./OnInit\";\nexport * from \"./RegistrySettings\";\nexport * from \"./TokenProvider\";\nexport * from \"./ResolvedInvokeOptions\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test1.js","sourceRoot":"","sources":["../../../../src/utils/data/Test1.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value1 = \"value\";\n\nexport class Test1 {}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Test2.js","sourceRoot":"","sources":["../../../../src/utils/data/Test2.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC;AAE9B,MAAM,OAAO,KAAK;CAAG","sourcesContent":["export const value2 = \"value\";\n\nexport class Test2 {}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from "./scope";
|
|
2
|
-
export * from "./service";
|
|
3
|
-
export * from "./overrideProvider";
|
|
4
|
-
export * from "./inject";
|
|
5
|
-
export * from "./lazyInject";
|
|
6
|
-
export * from "./injectable";
|
|
7
|
-
export * from "./constant";
|
|
8
|
-
export * from "./value";
|
|
9
|
-
export * from "./intercept";
|
|
10
|
-
export * from "./interceptor";
|
|
11
|
-
export * from "./configuration";
|
|
12
|
-
export * from "./module";
|
|
13
|
-
export * from "./opts";
|
|
14
|
-
export * from "./useOpts";
|
|
15
|
-
export * from "./controller";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./Container";
|
|
2
|
-
export * from "./InjectablePropertyType";
|
|
3
|
-
export * from "./LocalsContainer";
|
|
4
|
-
export * from "./Provider";
|
|
5
|
-
export * from "./ProviderScope";
|
|
6
|
-
export * from "./ProviderType";
|
|
7
|
-
export * from "./ContextLogger";
|
|
8
|
-
export * from "./DIContext";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./DILogger";
|
|
2
|
-
export * from "./DIConfigurationOptions";
|
|
3
|
-
export * from "./DIResolver";
|
|
4
|
-
export * from "./InjectableProperties";
|
|
5
|
-
export * from "./InterceptorMethods";
|
|
6
|
-
export * from "./InterceptorContext";
|
|
7
|
-
export * from "./InvokeOptions";
|
|
8
|
-
export * from "./IProvider";
|
|
9
|
-
export * from "./OnInit";
|
|
10
|
-
export * from "./OnDestroy";
|
|
11
|
-
export * from "./OnInit";
|
|
12
|
-
export * from "./RegistrySettings";
|
|
13
|
-
export * from "./TokenProvider";
|
|
14
|
-
export * from "./ResolvedInvokeOptions";
|