@spinajs/di 1.0.19 → 1.2.12
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/array.d.ts +7 -3
- package/lib/array.js +0 -3
- package/lib/array.js.map +1 -1
- package/lib/binder.d.ts +19 -0
- package/lib/binder.js +53 -0
- package/lib/binder.js.map +1 -0
- package/lib/container-cache.d.ts +12 -0
- package/lib/container-cache.js +49 -0
- package/lib/container-cache.js.map +1 -0
- package/lib/container.d.ts +59 -25
- package/lib/container.js +235 -253
- package/lib/container.js.map +1 -1
- package/lib/decorators.d.ts +9 -29
- package/lib/decorators.js +12 -48
- package/lib/decorators.js.map +1 -1
- package/lib/enums.d.ts +0 -1
- package/lib/enums.js +0 -1
- package/lib/enums.js.map +1 -1
- package/lib/exceptions.d.ts +12 -0
- package/lib/exceptions.js +20 -0
- package/lib/exceptions.js.map +1 -0
- package/lib/helpers.d.ts +12 -1
- package/lib/helpers.js +41 -1
- package/lib/helpers.js.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.js +7 -2
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +49 -28
- package/lib/interfaces.js +22 -3
- package/lib/interfaces.js.map +1 -1
- package/lib/registry.d.ts +13 -0
- package/lib/registry.js +66 -0
- package/lib/registry.js.map +1 -0
- package/lib/root.d.ts +85 -58
- package/lib/root.js +139 -61
- package/lib/root.js.map +1 -1
- package/lib/types.d.ts +9 -7
- package/package.json +9 -29
- package/lib/resolvers.d.ts +0 -0
- package/lib/resolvers.js +0 -1
- package/lib/resolvers.js.map +0 -1
- package/typings/array.d.ts +0 -12
package/lib/decorators.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Class } from './types';
|
|
2
|
+
import { TypedArray } from './array';
|
|
3
|
+
export declare const DI_DESCRIPTION_SYMBOL = "__DI_INJECTION_DESCRIPTOR__";
|
|
2
4
|
/**
|
|
3
5
|
*
|
|
4
6
|
* Class with this decorator is automatically registered in DI container an can be resolved.
|
|
@@ -6,7 +8,7 @@ export declare const DI_DESCRIPTION_SYMBOL: unique symbol;
|
|
|
6
8
|
* to register implementation that can be resolved by framework or other parts without knowing about specific implementations eg.
|
|
7
9
|
* avaible database drivers.
|
|
8
10
|
*
|
|
9
|
-
* @param as register class in DI container as something else.
|
|
11
|
+
* @param as - register class in DI container as something else.
|
|
10
12
|
*
|
|
11
13
|
* @example
|
|
12
14
|
* ```typescript
|
|
@@ -25,7 +27,7 @@ export declare const DI_DESCRIPTION_SYMBOL: unique symbol;
|
|
|
25
27
|
* ```
|
|
26
28
|
*
|
|
27
29
|
*/
|
|
28
|
-
export declare function Injectable(as?: Class | string): (target:
|
|
30
|
+
export declare function Injectable(as?: Class<unknown> | string): (target: Class<unknown>) => void;
|
|
29
31
|
/**
|
|
30
32
|
* Sets dependency injection guidelines - what to inject for specified class. If multiple instances are registered at specified type,
|
|
31
33
|
* only first one is resolved and injected
|
|
@@ -52,34 +54,12 @@ export declare function Injectable(as?: Class | string): (target: any) => void;
|
|
|
52
54
|
*
|
|
53
55
|
* ```
|
|
54
56
|
*/
|
|
55
|
-
export declare function Inject(...args: Class[]): any;
|
|
56
|
-
/**
|
|
57
|
-
* Sets dependency injection guidelines - what to inject for specified class. If multiple instances are registered at specified type,
|
|
58
|
-
* all of them are resolved and injected
|
|
59
|
-
* @param args - what to inject - class definitions
|
|
60
|
-
* @example
|
|
61
|
-
* ```javascript
|
|
62
|
-
*
|
|
63
|
-
* @InjectAll(Bar)
|
|
64
|
-
* class Foo{
|
|
65
|
-
*
|
|
66
|
-
* barInstances : Bar[];
|
|
67
|
-
*
|
|
68
|
-
* constructor(bars : Bar[]){
|
|
69
|
-
* // all Bar implementations are injected when Foo is created via DI container
|
|
70
|
-
* this.barInstances = bar;
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
*
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export declare function InjectAll(...args: Class[]): any;
|
|
57
|
+
export declare function Inject(...args: (Class<any> | TypedArray<any>)[]): any;
|
|
77
58
|
/**
|
|
78
59
|
* Automatically injects dependency based on reflected property type. Uses experimental typescript reflection api
|
|
79
60
|
* If decorator is applied to array property all registered type instances are injected, otherwise only first / only that exists
|
|
80
61
|
*
|
|
81
|
-
* @param
|
|
82
|
-
* @param key
|
|
62
|
+
* @param injectType - when injecting array of some type, type must be explicitly provided. Typescript reflection cant reflect declared array types
|
|
83
63
|
* @example
|
|
84
64
|
* ```javascript
|
|
85
65
|
* class Foo{
|
|
@@ -100,7 +80,7 @@ export declare function InjectAll(...args: Class[]): any;
|
|
|
100
80
|
*
|
|
101
81
|
* ```
|
|
102
82
|
*/
|
|
103
|
-
export declare function Autoinject(injectType?: Class): any;
|
|
83
|
+
export declare function Autoinject(injectType?: Class<unknown>): any;
|
|
104
84
|
/**
|
|
105
85
|
* Lazy injects service to object. Use only with class properties
|
|
106
86
|
*
|
|
@@ -123,7 +103,7 @@ export declare function Autoinject(injectType?: Class): any;
|
|
|
123
103
|
*
|
|
124
104
|
* ```
|
|
125
105
|
*/
|
|
126
|
-
export declare function LazyInject(service: Class | string): (target?: any, key?: string) => void;
|
|
106
|
+
export declare function LazyInject(service: Class<any> | string): (target?: any, key?: string) => void;
|
|
127
107
|
/**
|
|
128
108
|
* Per child instance injection decorator - object is resolved once per container - child containers have own instances.
|
|
129
109
|
*/
|
package/lib/decorators.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Singleton = exports.NewInstance = exports.PerChildInstance = exports.LazyInject = exports.Autoinject = exports.
|
|
3
|
+
exports.Singleton = exports.NewInstance = exports.PerChildInstance = exports.LazyInject = exports.Autoinject = exports.Inject = exports.Injectable = exports.DI_DESCRIPTION_SYMBOL = void 0;
|
|
4
4
|
const enums_1 = require("./enums");
|
|
5
|
-
const
|
|
6
|
-
exports.DI_DESCRIPTION_SYMBOL =
|
|
5
|
+
const DI = require("./root");
|
|
6
|
+
exports.DI_DESCRIPTION_SYMBOL = '__DI_INJECTION_DESCRIPTOR__';
|
|
7
7
|
function AddDependency(callback) {
|
|
8
8
|
return (target, propertyKey, indexOrDescriptor) => {
|
|
9
|
-
let descriptor = target
|
|
9
|
+
let descriptor = target.__DI_INJECTION_DESCRIPTOR__;
|
|
10
10
|
if (!descriptor) {
|
|
11
11
|
descriptor = {
|
|
12
12
|
inject: [],
|
|
13
13
|
resolver: enums_1.ResolveType.Singleton,
|
|
14
14
|
};
|
|
15
|
-
target[exports.DI_DESCRIPTION_SYMBOL] = descriptor;
|
|
15
|
+
target[`${exports.DI_DESCRIPTION_SYMBOL}`] = descriptor;
|
|
16
16
|
}
|
|
17
17
|
if (callback) {
|
|
18
18
|
callback(descriptor, target, propertyKey, indexOrDescriptor);
|
|
@@ -26,7 +26,7 @@ function AddDependency(callback) {
|
|
|
26
26
|
* to register implementation that can be resolved by framework or other parts without knowing about specific implementations eg.
|
|
27
27
|
* avaible database drivers.
|
|
28
28
|
*
|
|
29
|
-
* @param as register class in DI container as something else.
|
|
29
|
+
* @param as - register class in DI container as something else.
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
32
|
* ```typescript
|
|
@@ -48,10 +48,10 @@ function AddDependency(callback) {
|
|
|
48
48
|
function Injectable(as) {
|
|
49
49
|
return (target) => {
|
|
50
50
|
if (as) {
|
|
51
|
-
|
|
51
|
+
DI.register(target).as(as);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
|
|
54
|
+
DI.register(target).asSelf();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
}
|
|
@@ -86,7 +86,6 @@ function Inject(...args) {
|
|
|
86
86
|
return AddDependency((descriptor) => {
|
|
87
87
|
for (const a of args) {
|
|
88
88
|
descriptor.inject.push({
|
|
89
|
-
all: false,
|
|
90
89
|
autoinject: false,
|
|
91
90
|
autoinjectKey: '',
|
|
92
91
|
inject: a,
|
|
@@ -95,45 +94,11 @@ function Inject(...args) {
|
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
exports.Inject = Inject;
|
|
98
|
-
/**
|
|
99
|
-
* Sets dependency injection guidelines - what to inject for specified class. If multiple instances are registered at specified type,
|
|
100
|
-
* all of them are resolved and injected
|
|
101
|
-
* @param args - what to inject - class definitions
|
|
102
|
-
* @example
|
|
103
|
-
* ```javascript
|
|
104
|
-
*
|
|
105
|
-
* @InjectAll(Bar)
|
|
106
|
-
* class Foo{
|
|
107
|
-
*
|
|
108
|
-
* barInstances : Bar[];
|
|
109
|
-
*
|
|
110
|
-
* constructor(bars : Bar[]){
|
|
111
|
-
* // all Bar implementations are injected when Foo is created via DI container
|
|
112
|
-
* this.barInstances = bar;
|
|
113
|
-
* }
|
|
114
|
-
* }
|
|
115
|
-
*
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
function InjectAll(...args) {
|
|
119
|
-
return AddDependency((descriptor) => {
|
|
120
|
-
for (const a of args) {
|
|
121
|
-
descriptor.inject.push({
|
|
122
|
-
all: true,
|
|
123
|
-
autoinject: false,
|
|
124
|
-
autoinjectKey: '',
|
|
125
|
-
inject: a,
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
exports.InjectAll = InjectAll;
|
|
131
97
|
/**
|
|
132
98
|
* Automatically injects dependency based on reflected property type. Uses experimental typescript reflection api
|
|
133
99
|
* If decorator is applied to array property all registered type instances are injected, otherwise only first / only that exists
|
|
134
100
|
*
|
|
135
|
-
* @param
|
|
136
|
-
* @param key
|
|
101
|
+
* @param injectType - when injecting array of some type, type must be explicitly provided. Typescript reflection cant reflect declared array types
|
|
137
102
|
* @example
|
|
138
103
|
* ```javascript
|
|
139
104
|
* class Foo{
|
|
@@ -162,10 +127,9 @@ function Autoinject(injectType) {
|
|
|
162
127
|
throw new Error('you must provide inject type when injecting array');
|
|
163
128
|
}
|
|
164
129
|
descriptor.inject.push({
|
|
165
|
-
all: isArray ? true : false,
|
|
166
130
|
autoinject: true,
|
|
167
131
|
autoinjectKey: propertyKey,
|
|
168
|
-
inject: isArray ? injectType : type,
|
|
132
|
+
inject: isArray ? Array.ofType(injectType) : type,
|
|
169
133
|
});
|
|
170
134
|
});
|
|
171
135
|
}
|
|
@@ -197,10 +161,10 @@ function LazyInject(service) {
|
|
|
197
161
|
// property getter
|
|
198
162
|
const getter = () => {
|
|
199
163
|
if (typeof service === 'string') {
|
|
200
|
-
return
|
|
164
|
+
return DI.get(service);
|
|
201
165
|
}
|
|
202
166
|
else {
|
|
203
|
-
return
|
|
167
|
+
return DI.resolve(service);
|
|
204
168
|
}
|
|
205
169
|
};
|
|
206
170
|
// Create new property with getter and setter
|
package/lib/decorators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"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"}
|
package/lib/enums.d.ts
CHANGED
package/lib/enums.js
CHANGED
package/lib/enums.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB;;OAEG;IACH,uDAAS,CAAA;IAET;;OAEG;IACH,2DAAW,CAAA;IAEX;;OAEG;IACH,uEAAiB,CAAA;AACnB,CAAC,EAfW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAetB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exception thrown when cannot resolve type
|
|
3
|
+
*/
|
|
4
|
+
export declare class ResolveException extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Constructs new exception with message
|
|
7
|
+
* @param message - error message
|
|
8
|
+
*/
|
|
9
|
+
constructor(message?: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class BindException extends Error {
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BindException = exports.ResolveException = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Exception thrown when cannot resolve type
|
|
6
|
+
*/
|
|
7
|
+
class ResolveException extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs new exception with message
|
|
10
|
+
* @param message - error message
|
|
11
|
+
*/
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ResolveException = ResolveException;
|
|
17
|
+
class BindException extends Error {
|
|
18
|
+
}
|
|
19
|
+
exports.BindException = BindException;
|
|
20
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../src/exceptions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,gBAAiB,SAAQ,KAAK;IACzC;;;OAGG;IACH,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF;AARD,4CAQC;AAED,MAAa,aAAc,SAAQ,KAAK;CAAG;AAA3C,sCAA2C"}
|
package/lib/helpers.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { TypedArray } from './array';
|
|
2
|
+
import { AsyncModule, SyncModule } from './interfaces';
|
|
3
|
+
import { Factory, Class } from './types';
|
|
1
4
|
/**
|
|
2
5
|
* Checks if value is constructable type.
|
|
3
6
|
* Checks for [[Construct]] internal function in object.
|
|
4
7
|
*
|
|
5
8
|
* @param value - value to test
|
|
6
9
|
*/
|
|
7
|
-
export declare function isConstructor(value: any):
|
|
10
|
+
export declare function isConstructor(value: any): value is Class<unknown>;
|
|
11
|
+
export declare function isFactory(value: any): value is Factory<any>;
|
|
12
|
+
export declare function isObject(value: any): value is object;
|
|
13
|
+
export declare function isAsyncModule(value: any): value is AsyncModule;
|
|
14
|
+
export declare function isPromise(value: any): value is Promise<any>;
|
|
15
|
+
export declare function isSyncModule(value: any): value is SyncModule;
|
|
16
|
+
export declare function isTypedArray(value: any): value is TypedArray<any>;
|
|
17
|
+
export declare function uniqBy<T>(arr: T[], comparator: (a: T, b: T) => boolean): T[];
|
|
18
|
+
export declare function getTypeName(type: TypedArray<any> | Class<any> | string | object): string;
|
package/lib/helpers.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isConstructor = void 0;
|
|
3
|
+
exports.getTypeName = exports.uniqBy = exports.isTypedArray = exports.isSyncModule = exports.isPromise = exports.isAsyncModule = exports.isObject = exports.isFactory = exports.isConstructor = void 0;
|
|
4
|
+
const array_1 = require("./array");
|
|
5
|
+
const interfaces_1 = require("./interfaces");
|
|
4
6
|
/**
|
|
5
7
|
* Checks if value is constructable type.
|
|
6
8
|
* Checks for [[Construct]] internal function in object.
|
|
@@ -17,4 +19,42 @@ function isConstructor(value) {
|
|
|
17
19
|
return true;
|
|
18
20
|
}
|
|
19
21
|
exports.isConstructor = isConstructor;
|
|
22
|
+
function isFactory(value) {
|
|
23
|
+
return !isConstructor(value) && typeof value === 'function';
|
|
24
|
+
}
|
|
25
|
+
exports.isFactory = isFactory;
|
|
26
|
+
function isObject(value) {
|
|
27
|
+
return typeof value === 'object';
|
|
28
|
+
}
|
|
29
|
+
exports.isObject = isObject;
|
|
30
|
+
function isAsyncModule(value) {
|
|
31
|
+
return value instanceof interfaces_1.AsyncModule;
|
|
32
|
+
}
|
|
33
|
+
exports.isAsyncModule = isAsyncModule;
|
|
34
|
+
function isPromise(value) {
|
|
35
|
+
return Boolean(value && typeof value.then === 'function');
|
|
36
|
+
}
|
|
37
|
+
exports.isPromise = isPromise;
|
|
38
|
+
function isSyncModule(value) {
|
|
39
|
+
return value instanceof interfaces_1.SyncModule;
|
|
40
|
+
}
|
|
41
|
+
exports.isSyncModule = isSyncModule;
|
|
42
|
+
function isTypedArray(value) {
|
|
43
|
+
return value instanceof array_1.TypedArray;
|
|
44
|
+
}
|
|
45
|
+
exports.isTypedArray = isTypedArray;
|
|
46
|
+
function uniqBy(arr, comparator) {
|
|
47
|
+
const uniques = [];
|
|
48
|
+
for (const a of arr) {
|
|
49
|
+
if (uniques.findIndex((u) => comparator(a, u)) === -1) {
|
|
50
|
+
uniques.push(a);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return uniques;
|
|
54
|
+
}
|
|
55
|
+
exports.uniqBy = uniqBy;
|
|
56
|
+
function getTypeName(type) {
|
|
57
|
+
return typeof type === 'string' ? type : type instanceof array_1.TypedArray ? getTypeName(type.Type) : isConstructor(type) ? type.name : type.constructor.name;
|
|
58
|
+
}
|
|
59
|
+
exports.getTypeName = getTypeName;
|
|
20
60
|
//# sourceMappingURL=helpers.js.map
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAU;IACtC,IAAI;QACF,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;KACtC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AARD,sCAQC"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AACrC,6CAAuD;AAGvD;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAAU;IACtC,IAAI;QACF,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;KACtC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AARD,sCAQC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC;AAC9D,CAAC;AAFD,8BAEC;AAED,SAAgB,QAAQ,CAAC,KAAU;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAFD,4BAEC;AAED,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,YAAY,wBAAW,CAAC;AACtC,CAAC;AAFD,sCAEC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;AAC5D,CAAC;AAFD,8BAEC;AAED,SAAgB,YAAY,CAAC,KAAU;IACrC,OAAO,KAAK,YAAY,uBAAU,CAAC;AACrC,CAAC;AAFD,oCAEC;AAED,SAAgB,YAAY,CAAC,KAAU;IACrC,OAAO,KAAK,YAAY,kBAAU,CAAC;AACrC,CAAC;AAFD,oCAEC;AAED,SAAgB,MAAM,CAAI,GAAQ,EAAE,UAAmC;IACrE,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE;QACnB,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;YACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AARD,wBAQC;AAED,SAAgB,WAAW,CAAC,IAAoD;IAC9E,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,kBAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;AACzJ,CAAC;AAFD,kCAEC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,5 +4,9 @@ export * from './decorators';
|
|
|
4
4
|
export * from './enums';
|
|
5
5
|
export * from './types';
|
|
6
6
|
export * from './helpers';
|
|
7
|
+
export * from './container-cache';
|
|
8
|
+
export * from './binder';
|
|
9
|
+
export * from './registry';
|
|
7
10
|
export * from './container';
|
|
8
|
-
export * from './root';
|
|
11
|
+
export * as DI from './root';
|
|
12
|
+
export * from './exceptions';
|
package/lib/index.js
CHANGED
|
@@ -7,15 +7,20 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.DI = void 0;
|
|
13
14
|
__exportStar(require("./interfaces"), exports);
|
|
14
15
|
__exportStar(require("./array"), exports);
|
|
15
16
|
__exportStar(require("./decorators"), exports);
|
|
16
17
|
__exportStar(require("./enums"), exports);
|
|
17
18
|
__exportStar(require("./types"), exports);
|
|
18
19
|
__exportStar(require("./helpers"), exports);
|
|
20
|
+
__exportStar(require("./container-cache"), exports);
|
|
21
|
+
__exportStar(require("./binder"), exports);
|
|
22
|
+
__exportStar(require("./registry"), exports);
|
|
19
23
|
__exportStar(require("./container"), exports);
|
|
20
|
-
|
|
24
|
+
exports.DI = require("./root");
|
|
25
|
+
__exportStar(require("./exceptions"), exports);
|
|
21
26
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,oDAAkC;AAClC,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,+BAA6B;AAC7B,+CAA6B"}
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,62 +1,76 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { ResolveType } from './enums';
|
|
2
3
|
import { Class, Factory } from './types';
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
import { TypedArray } from './array';
|
|
6
|
+
import { Registry } from './registry';
|
|
7
|
+
import { ContainerCache } from './container-cache';
|
|
3
8
|
/**
|
|
4
9
|
* Interface to describe DI binding behaviour
|
|
5
10
|
*/
|
|
6
11
|
export interface IBind {
|
|
7
|
-
/**
|
|
8
|
-
* Private var for holding implementation type
|
|
9
|
-
*/
|
|
10
|
-
_impl: any;
|
|
11
12
|
/**
|
|
12
13
|
* `as` binding (alias)
|
|
13
14
|
*
|
|
14
15
|
* @param type - base class that is being registered
|
|
15
16
|
*/
|
|
16
|
-
as
|
|
17
|
+
as(type: Class<any> | string): this;
|
|
17
18
|
/**
|
|
18
19
|
* self bind, class should be resolved by its name. Its default behaviour.
|
|
19
20
|
*/
|
|
20
21
|
asSelf(): this;
|
|
22
|
+
/**
|
|
23
|
+
* Registers as value, it wont be resolved or called, just stored as is in container
|
|
24
|
+
*
|
|
25
|
+
* @param type - name of type / key after whitch implementation will be resolved
|
|
26
|
+
*/
|
|
27
|
+
asValue(type: string): this;
|
|
21
28
|
/**
|
|
22
29
|
* Registers object as single instance ( singleton )
|
|
23
30
|
*/
|
|
24
31
|
singleInstance(): this;
|
|
25
32
|
}
|
|
26
|
-
export interface
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
export interface ResolvableObject {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
export interface IContainer extends EventEmitter {
|
|
37
|
+
Cache: ContainerCache;
|
|
38
|
+
Registry: Registry;
|
|
39
|
+
Parent: IContainer;
|
|
29
40
|
clear(): void;
|
|
30
|
-
|
|
41
|
+
clearRegistry(): void;
|
|
42
|
+
clearCache(): void;
|
|
43
|
+
register<T>(implementation: Class<T> | Factory<T> | ResolvableObject): IBind;
|
|
31
44
|
child(): IContainer;
|
|
32
|
-
get<T>(service: TypedArray<T>, parent?: boolean): T[];
|
|
33
|
-
get<T>(service: string | Class<T>, parent?: boolean): T;
|
|
34
|
-
get<T>(service: string | Class<T> | TypedArray<T>, parent?: boolean): T | T[];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
hasRegistered<T>(service: Class<T> | string
|
|
38
|
-
|
|
45
|
+
get<T>(service: TypedArray<T>, parent?: boolean): T[] | null;
|
|
46
|
+
get<T>(service: string | Class<T>, parent?: boolean): T | null;
|
|
47
|
+
get<T>(service: string | Class<T> | TypedArray<T>, parent?: boolean): T | T[] | null;
|
|
48
|
+
getRegisteredTypes<T>(service: string | Class<T> | TypedArray<T>, parent?: boolean): Array<Class<unknown> | Factory<unknown>>;
|
|
49
|
+
isResolved<T>(service: string | Class<T>, parent?: boolean): boolean;
|
|
50
|
+
hasRegistered<T>(service: Class<T> | string | TypedArray<T>, parent?: boolean): boolean;
|
|
51
|
+
hasRegisteredType<T>(source: Class<any> | string | TypedArray<any>, type: Class<T> | string | TypedArray<T> | object, parent?: boolean): boolean;
|
|
52
|
+
resolve<T>(type: string, options?: unknown[], check?: boolean): T;
|
|
39
53
|
resolve<T>(type: string, check?: boolean): T;
|
|
40
|
-
resolve<T>(type: Class<T> | Factory<T>, options?:
|
|
41
|
-
resolve<T>(type: TypedArray<T>, options?:
|
|
54
|
+
resolve<T>(type: Class<T> | Factory<T>, options?: unknown[] | boolean, check?: boolean): T extends AsyncModule ? Promise<T> : T;
|
|
55
|
+
resolve<T>(type: TypedArray<T>, options?: unknown[] | boolean, check?: boolean): T extends AsyncModule ? Promise<T[]> : T[];
|
|
42
56
|
resolve<T>(type: Class<T> | Factory<T>, check?: boolean): T extends AsyncModule ? Promise<T> : T;
|
|
43
57
|
resolve<T>(type: TypedArray<T>, check?: boolean): T extends AsyncModule ? Promise<T[]> : T[];
|
|
58
|
+
resolve<T>(type: Class<T> | TypedArray<T> | string, options?: unknown[] | boolean, check?: boolean): Promise<T | T[]> | T | T[];
|
|
44
59
|
}
|
|
45
60
|
/**
|
|
46
61
|
* Injection description definition structure
|
|
47
62
|
*/
|
|
48
|
-
export interface IInjectDescriptor<T
|
|
49
|
-
inject:
|
|
63
|
+
export interface IInjectDescriptor<T> {
|
|
64
|
+
inject: IToInject<T>[];
|
|
50
65
|
resolver: ResolveType;
|
|
51
66
|
}
|
|
52
|
-
export interface IToInject<T
|
|
53
|
-
inject: Class<T>;
|
|
67
|
+
export interface IToInject<T> {
|
|
68
|
+
inject: Class<T> | TypedArray<T>;
|
|
54
69
|
autoinject: boolean;
|
|
55
|
-
all: boolean;
|
|
56
70
|
autoinjectKey: string;
|
|
57
71
|
}
|
|
58
72
|
export interface IResolvedInjection {
|
|
59
|
-
instance:
|
|
73
|
+
instance: unknown;
|
|
60
74
|
autoinject: boolean;
|
|
61
75
|
autoinjectKey: string;
|
|
62
76
|
}
|
|
@@ -68,9 +82,16 @@ export interface IResolvedInjection {
|
|
|
68
82
|
*
|
|
69
83
|
* @see FrameworkModuleSyncModule implementation
|
|
70
84
|
*/
|
|
71
|
-
export declare
|
|
72
|
-
|
|
85
|
+
export declare class Module {
|
|
86
|
+
protected resolved: boolean;
|
|
87
|
+
get Resolved(): boolean;
|
|
88
|
+
}
|
|
89
|
+
export declare abstract class SyncModule extends Module {
|
|
90
|
+
resolve(): void;
|
|
91
|
+
}
|
|
92
|
+
export declare class AsyncModule extends Module {
|
|
93
|
+
resolveAsync(): Promise<void>;
|
|
73
94
|
}
|
|
74
|
-
export declare abstract class
|
|
75
|
-
abstract
|
|
95
|
+
export declare abstract class Bootstrapper {
|
|
96
|
+
abstract bootstrap(): Promise<void> | void;
|
|
76
97
|
}
|
package/lib/interfaces.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncModule = exports.SyncModule = void 0;
|
|
3
|
+
exports.Bootstrapper = exports.AsyncModule = exports.SyncModule = exports.Module = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Interface to describe DI resolve strategies. Strategies are used do
|
|
6
6
|
* do some work at object creation eg. initialize objects that inherits from same class
|
|
@@ -15,10 +15,29 @@ exports.AsyncModule = exports.SyncModule = void 0;
|
|
|
15
15
|
// export interface IAsyncStrategy {
|
|
16
16
|
// resolveA: (target: any, container: IContainer) => Promise<void>;
|
|
17
17
|
// }
|
|
18
|
-
class
|
|
18
|
+
class Module {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.resolved = false;
|
|
21
|
+
}
|
|
22
|
+
get Resolved() {
|
|
23
|
+
return this.resolved;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Module = Module;
|
|
27
|
+
class SyncModule extends Module {
|
|
28
|
+
resolve() {
|
|
29
|
+
this.resolved = true;
|
|
30
|
+
}
|
|
19
31
|
}
|
|
20
32
|
exports.SyncModule = SyncModule;
|
|
21
|
-
class AsyncModule {
|
|
33
|
+
class AsyncModule extends Module {
|
|
34
|
+
/* eslint-disable */
|
|
35
|
+
async resolveAsync() {
|
|
36
|
+
this.resolved = true;
|
|
37
|
+
}
|
|
22
38
|
}
|
|
23
39
|
exports.AsyncModule = AsyncModule;
|
|
40
|
+
class Bootstrapper {
|
|
41
|
+
}
|
|
42
|
+
exports.Bootstrapper = Bootstrapper;
|
|
24
43
|
//# sourceMappingURL=interfaces.js.map
|
package/lib/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";;;AA0FA;;;;;;;GAOG;AACH,+BAA+B;AAC/B,6DAA6D;AAC7D,IAAI;AAEJ,oCAAoC;AACpC,uEAAuE;AACvE,IAAI;AAEJ,MAAa,MAAM;IAAnB;QACY,aAAQ,GAAG,KAAK,CAAC;IAI7B,CAAC;IAHC,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AALD,wBAKC;AAED,MAAsB,UAAW,SAAQ,MAAM;IACtC,OAAO;QACZ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;CACF;AAJD,gCAIC;AAED,MAAa,WAAY,SAAQ,MAAM;IACrC,oBAAoB;IACb,KAAK,CAAC,YAAY;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;CACF;AALD,kCAKC;AAED,MAAsB,YAAY;CAEjC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypedArray } from './array';
|
|
2
|
+
import { IContainer } from './interfaces';
|
|
3
|
+
import { Class, Factory } from './types';
|
|
4
|
+
export declare class Registry {
|
|
5
|
+
protected container: IContainer;
|
|
6
|
+
protected registry: Map<string, any[]>;
|
|
7
|
+
constructor(container: IContainer);
|
|
8
|
+
clear(): void;
|
|
9
|
+
register(name: string | Class<any> | TypedArray<any>, type: any): void;
|
|
10
|
+
hasRegisteredType(source: Class<any> | string | TypedArray<any>, type: Class<any> | string | TypedArray<any> | object, parent?: boolean): boolean;
|
|
11
|
+
getTypes<T>(service: string | Class<T> | TypedArray<T>, parent?: boolean): Array<Class<unknown> | Factory<unknown>>;
|
|
12
|
+
hasRegistered<T>(service: TypedArray<T> | Class<T> | string, parent?: boolean): boolean;
|
|
13
|
+
}
|
package/lib/registry.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Registry = void 0;
|
|
4
|
+
const exceptions_1 = require("@spinajs/exceptions");
|
|
5
|
+
const helpers_1 = require("./helpers");
|
|
6
|
+
class Registry {
|
|
7
|
+
constructor(container) {
|
|
8
|
+
this.container = container;
|
|
9
|
+
this.registry = new Map();
|
|
10
|
+
}
|
|
11
|
+
clear() {
|
|
12
|
+
this.registry.clear();
|
|
13
|
+
}
|
|
14
|
+
register(name, type) {
|
|
15
|
+
if (!(0, helpers_1.isConstructor)(type) && !(0, helpers_1.isFactory)(type) && !(0, helpers_1.isObject)(type)) {
|
|
16
|
+
throw new exceptions_1.InvalidOperation('cannot register type if its not an class or factory function');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const tname = (0, helpers_1.getTypeName)(name);
|
|
20
|
+
if (!this.hasRegisteredType(name, type)) {
|
|
21
|
+
const value = this.registry.get(tname);
|
|
22
|
+
if (value) {
|
|
23
|
+
value.push(type);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.registry.set(tname, [type]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
hasRegisteredType(source, type, parent) {
|
|
32
|
+
const sourceName = (0, helpers_1.getTypeName)(source);
|
|
33
|
+
const targetName = (0, helpers_1.getTypeName)(type);
|
|
34
|
+
if (this.registry.has(sourceName)) {
|
|
35
|
+
return this.registry.get(sourceName).find((s) => s.name === targetName) !== undefined;
|
|
36
|
+
}
|
|
37
|
+
else if (parent && this.container.Parent) {
|
|
38
|
+
return this.container.Parent.hasRegisteredType(source, type, parent);
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
getTypes(service, parent = true) {
|
|
43
|
+
if (!service) {
|
|
44
|
+
throw new exceptions_1.InvalidArgument('argument "service" cannot be null or empty');
|
|
45
|
+
}
|
|
46
|
+
const name = (0, helpers_1.getTypeName)(service);
|
|
47
|
+
if (this.registry.has(name)) {
|
|
48
|
+
return this.registry.get(name);
|
|
49
|
+
}
|
|
50
|
+
if (this.container.Parent && parent) {
|
|
51
|
+
return this.container.Parent.getRegisteredTypes(service, parent);
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
hasRegistered(service, parent = true) {
|
|
56
|
+
if (this.registry.has((0, helpers_1.getTypeName)(service))) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
else if (parent && this.container.Parent) {
|
|
60
|
+
return this.container.Parent.hasRegistered(service, parent);
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Registry = Registry;
|
|
66
|
+
//# sourceMappingURL=registry.js.map
|