@loopback/core 2.7.0 → 2.9.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/CHANGELOG.md +43 -0
- package/dist/application.d.ts +2 -1
- package/dist/application.js +2 -0
- package/dist/application.js.map +1 -1
- package/dist/component.d.ts +5 -1
- package/dist/component.js +5 -0
- package/dist/component.js.map +1 -1
- package/dist/lifecycle-registry.js +137 -140
- package/dist/lifecycle-registry.js.map +1 -1
- package/dist/mixin-target.d.ts +1 -0
- package/dist/mixin-target.js +1 -1
- package/dist/mixin-target.js.map +1 -1
- package/dist/service.js +1 -1
- package/dist/service.js.map +1 -1
- package/package.json +12 -9
- package/src/application.ts +9 -1
- package/src/component.ts +16 -1
- package/src/mixin-target.ts +2 -1
- package/src/service.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,49 @@
|
|
|
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
|
+
## [2.9.1](https://github.com/strongloop/loopback-next/compare/@loopback/core@2.9.0...@loopback/core@2.9.1) (2020-06-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.9.0](https://github.com/strongloop/loopback-next/compare/@loopback/core@2.8.0...@loopback/core@2.9.0) (2020-06-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* set node version to >=10.16 to support events.once ([e39da1c](https://github.com/strongloop/loopback-next/commit/e39da1ca47728eafaf83c10ce35b09b03b6a4edc))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **core:** enable application config with configure/getConfig/[@config](https://github.com/config) ([3a74ee1](https://github.com/strongloop/loopback-next/commit/3a74ee180633754ecd369b07454a104e731129f1))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [2.8.0](https://github.com/strongloop/loopback-next/compare/@loopback/core@2.7.1...@loopback/core@2.8.0) (2020-06-11)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **core:** add services to component artifacts ([5545345](https://github.com/strongloop/loopback-next/commit/5545345a7a1a51333d518d5a5cb8580d74ff2492))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [2.7.1](https://github.com/strongloop/loopback-next/compare/@loopback/core@2.7.0...@loopback/core@2.7.1) (2020-05-28)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @loopback/core
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
6
49
|
# [2.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/core@2.6.0...@loopback/core@2.7.0) (2020-05-20)
|
|
7
50
|
|
|
8
51
|
|
package/dist/application.d.ts
CHANGED
|
@@ -236,7 +236,7 @@ export declare class Application extends Context implements LifeCycleObserver {
|
|
|
236
236
|
* }
|
|
237
237
|
* ```
|
|
238
238
|
*/
|
|
239
|
-
service<S>(cls:
|
|
239
|
+
service<S>(cls: ServiceOrProviderClass<S>, nameOrOptions?: string | ServiceOptions): Binding<S>;
|
|
240
240
|
/**
|
|
241
241
|
* Register an interceptor
|
|
242
242
|
* @param interceptor - An interceptor function or provider class
|
|
@@ -282,6 +282,7 @@ export interface ApplicationConfig {
|
|
|
282
282
|
[prop: string]: any;
|
|
283
283
|
}
|
|
284
284
|
export declare type ControllerClass<T = any> = Constructor<T>;
|
|
285
|
+
export declare type ServiceOrProviderClass<T = any> = Constructor<T | Provider<T>>;
|
|
285
286
|
/**
|
|
286
287
|
* Type description for `package.json`
|
|
287
288
|
*/
|
package/dist/application.js
CHANGED
|
@@ -65,6 +65,8 @@ class Application extends context_1.Context {
|
|
|
65
65
|
this.bind(keys_1.CoreBindings.APPLICATION_INSTANCE).to(this);
|
|
66
66
|
// Make options available to other modules as well.
|
|
67
67
|
this.bind(keys_1.CoreBindings.APPLICATION_CONFIG).to(this.options);
|
|
68
|
+
// Also configure the application instance to allow `@config`
|
|
69
|
+
this.configure(keys_1.CoreBindings.APPLICATION_INSTANCE).toAlias(keys_1.CoreBindings.APPLICATION_CONFIG);
|
|
68
70
|
this._shutdownOptions = { signals: ['SIGTERM'], ...this.options.shutdown };
|
|
69
71
|
}
|
|
70
72
|
/**
|
package/dist/application.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAY2B;AAC3B,4DAA4B;AAC5B,0DAAiC;AACjC,mCAA4B;AAC5B,2CAAsD;AACtD,iCAA8C;AAC9C,2CAIqB;AACrB,6DAA+D;AAE/D,uCAA+D;AAC/D,MAAM,KAAK,GAAG,eAAY,CAAC,2BAA2B,CAAC,CAAC;AACxD,MAAM,aAAa,GAAG,eAAY,CAAC,oCAAoC,CAAC,CAAC;AACzE,MAAM,YAAY,GAAG,eAAY,CAAC,mCAAmC,CAAC,CAAC;AAEvE;;;;GAIG;AACH,SAAS,oBAAoB,CAC3B,cAA4C,EAC5C,MAAgB;IAEhB,IAAI,IAAwB,CAAC;IAC7B,IAAI,SAA8B,CAAC;IAEnC,IAAI,cAAc,YAAY,iBAAO,EAAE;QACrC,SAAS,GAAG,cAAc,CAAC;QAC3B,IAAI,GAAG,SAAS,CAAC;KAClB;SAAM;QACL,SAAS,GAAG,MAAM,CAAC;QACnB,IAAI,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAC;KAC7B;IACD,OAAO,CAAC,SAAS,EAAE,I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CACR,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACpB,IAAI,OAAO,CAAC,eAAe,EAAE,IAAI,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE;gBAC3D,IAAI,YAAY,CAAC,OAAO,EAAE;oBACxB,YAAY,CACV,8CAA8C,EAC9C,IAAI,CAAC,IAAI,EACT,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAC1B,GAAG,EACH,OAAO,CAAC,GAAG,EACX,IAAI,KAAK,CAAC,6BAA6B,CAAC,CACzC,CAAC;iBACH;aACF;YACD,kEAAkE;YAClE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,oBAAoB;QAC1B,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI;YAAE,OAAO;QACzC,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC7C,aAAa,CACX,kDAAkD,EAClD,IAAI,CAAC,IAAI,EACT,OAAO,CAAC,GAAG,EACX,OAAO,CACR,CAAC;QACF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACpB,kEAAkE;QAClE,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,CAClD,CAAC;IACJ,CAAC;CACF;AAhfD,kCAgfC;AAED;;;GAGG;AACH,SAAS,SAAS,CAAC,aAAgD;IACjE,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACrC,OAAO,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC;KAC9B;IACD,OAAO,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC;AAC7B,CAAC"}
|
package/dist/component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Binding, BoundValue, Constructor, Provider } from '@loopback/context';
|
|
2
|
-
import { Application, ControllerClass } from './application';
|
|
2
|
+
import { Application, ControllerClass, ServiceOrProviderClass } from './application';
|
|
3
3
|
import { LifeCycleObserver } from './lifecycle';
|
|
4
4
|
import { Server } from './server';
|
|
5
5
|
/**
|
|
@@ -52,6 +52,10 @@ export interface Component {
|
|
|
52
52
|
[name: string]: Constructor<Server>;
|
|
53
53
|
};
|
|
54
54
|
lifeCycleObservers?: Constructor<LifeCycleObserver>[];
|
|
55
|
+
/**
|
|
56
|
+
* An array of service or provider classes
|
|
57
|
+
*/
|
|
58
|
+
services?: ServiceOrProviderClass[];
|
|
55
59
|
/**
|
|
56
60
|
* An array of bindings to be aded to the application context.
|
|
57
61
|
*
|
package/dist/component.js
CHANGED
|
@@ -49,6 +49,11 @@ function mountComponent(app, component) {
|
|
|
49
49
|
app.lifeCycleObserver(observer);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
if (component.services) {
|
|
53
|
+
for (const service of component.services) {
|
|
54
|
+
app.service(service);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
52
57
|
}
|
|
53
58
|
exports.mountComponent = mountComponent;
|
|
54
59
|
//# sourceMappingURL=component.js.map
|
package/dist/component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;AAEhE,+CAM2B;
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;AAEhE,+CAM2B;AAyF3B;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,GAAgB,EAAE,SAAoB;IACnE,IAAI,SAAS,CAAC,OAAO,EAAE;QACrB,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,OAAO,EAAE;YACxC,MAAM,OAAO,GAAG,gC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AC;AAhDD,wCAgDC"}
|
|
@@ -15,157 +15,154 @@ exports.DEFAULT_ORDERED_GROUPS = ['server'];
|
|
|
15
15
|
/**
|
|
16
16
|
* A context-based registry for life cycle observers
|
|
17
17
|
*/
|
|
18
|
-
let LifeCycleObserverRegistry =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
let LifeCycleObserverRegistry = class LifeCycleObserverRegistry {
|
|
19
|
+
constructor(observersView, options = {
|
|
20
|
+
parallel: true,
|
|
21
|
+
orderedGroups: exports.DEFAULT_ORDERED_GROUPS,
|
|
22
|
+
}) {
|
|
23
|
+
this.observersView = observersView;
|
|
24
|
+
this.options = options;
|
|
25
|
+
}
|
|
26
|
+
setOrderedGroups(groups) {
|
|
27
|
+
this.options.orderedGroups = groups;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get observer groups ordered by the group
|
|
31
|
+
*/
|
|
32
|
+
getObserverGroupsByOrder() {
|
|
33
|
+
const bindings = this.observersView.bindings;
|
|
34
|
+
const groups = this.sortObserverBindingsByGroup(bindings);
|
|
35
|
+
if (debug.enabled) {
|
|
36
|
+
debug('Observer groups: %j', groups.map(g => ({
|
|
37
|
+
group: g.group,
|
|
38
|
+
bindings: g.bindings.map(b => b.key),
|
|
39
|
+
})));
|
|
26
40
|
}
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
return groups;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the group for a given life cycle observer binding
|
|
45
|
+
* @param binding - Life cycle observer binding
|
|
46
|
+
*/
|
|
47
|
+
getObserverGroup(binding) {
|
|
48
|
+
// First check if there is an explicit group name in the tag
|
|
49
|
+
let group = binding.tagMap[keys_1.CoreTags.LIFE_CYCLE_OBSERVER_GROUP];
|
|
50
|
+
if (!group) {
|
|
51
|
+
// Fall back to a tag that matches one of the groups
|
|
52
|
+
group = this.options.orderedGroups.find(g => binding.tagMap[g] === g);
|
|
29
53
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
group = group || '';
|
|
55
|
+
debug('Binding %s is configured with observer group %s', binding.key, group);
|
|
56
|
+
return group;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Sort the life cycle observer bindings so that we can start/stop them
|
|
60
|
+
* in the right order. By default, we can start other observers before servers
|
|
61
|
+
* and stop them in the reverse order
|
|
62
|
+
* @param bindings - Life cycle observer bindings
|
|
63
|
+
*/
|
|
64
|
+
sortObserverBindingsByGroup(bindings) {
|
|
65
|
+
// Group bindings in a map
|
|
66
|
+
const groupMap = new Map();
|
|
67
|
+
context_1.sortBindingsByPhase(bindings, keys_1.CoreTags.LIFE_CYCLE_OBSERVER_GROUP, this.options.orderedGroups);
|
|
68
|
+
for (const binding of bindings) {
|
|
69
|
+
const group = this.getObserverGroup(binding);
|
|
70
|
+
let bindingsInGroup = groupMap.get(group);
|
|
71
|
+
if (bindingsInGroup == null) {
|
|
72
|
+
bindingsInGroup = [];
|
|
73
|
+
groupMap.set(group, bindingsInGroup);
|
|
41
74
|
}
|
|
42
|
-
|
|
75
|
+
bindingsInGroup.push(binding);
|
|
43
76
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
getObserverGroup(binding) {
|
|
49
|
-
// First check if there is an explicit group name in the tag
|
|
50
|
-
let group = binding.tagMap[keys_1.CoreTags.LIFE_CYCLE_OBSERVER_GROUP];
|
|
51
|
-
if (!group) {
|
|
52
|
-
// Fall back to a tag that matches one of the groups
|
|
53
|
-
group = this.options.orderedGroups.find(g => binding.tagMap[g] === g);
|
|
54
|
-
}
|
|
55
|
-
group = group || '';
|
|
56
|
-
debug('Binding %s is configured with observer group %s', binding.key, group);
|
|
57
|
-
return group;
|
|
77
|
+
// Create an array for group entries
|
|
78
|
+
const groups = [];
|
|
79
|
+
for (const [group, bindingsInGroup] of groupMap) {
|
|
80
|
+
groups.push({ group, bindings: bindingsInGroup });
|
|
58
81
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
bindingsInGroup = [];
|
|
74
|
-
groupMap.set(group, bindingsInGroup);
|
|
75
|
-
}
|
|
76
|
-
bindingsInGroup.push(binding);
|
|
77
|
-
}
|
|
78
|
-
// Create an array for group entries
|
|
79
|
-
const groups = [];
|
|
80
|
-
for (const [group, bindingsInGroup] of groupMap) {
|
|
81
|
-
groups.push({ group, bindings: bindingsInGroup });
|
|
82
|
+
return groups;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Notify an observer group of the given event
|
|
86
|
+
* @param group - A group of bindings for life cycle observers
|
|
87
|
+
* @param event - Event name
|
|
88
|
+
*/
|
|
89
|
+
async notifyObservers(observers, bindings, event) {
|
|
90
|
+
if (!this.options.parallel) {
|
|
91
|
+
let index = 0;
|
|
92
|
+
for (const observer of observers) {
|
|
93
|
+
debug('Invoking %s observer for binding %s', event, bindings[index].key);
|
|
94
|
+
index++;
|
|
95
|
+
await this.invokeObserver(observer, event);
|
|
82
96
|
}
|
|
83
|
-
return
|
|
97
|
+
return;
|
|
84
98
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// Parallel invocation
|
|
101
|
-
const notifiers = observers.map((observer, index) => {
|
|
102
|
-
debug('Invoking %s observer for binding %s', event, bindings[index].key);
|
|
103
|
-
return this.invokeObserver(observer, event);
|
|
104
|
-
});
|
|
105
|
-
await Promise.all(notifiers);
|
|
99
|
+
// Parallel invocation
|
|
100
|
+
const notifiers = observers.map((observer, index) => {
|
|
101
|
+
debug('Invoking %s observer for binding %s', event, bindings[index].key);
|
|
102
|
+
return this.invokeObserver(observer, event);
|
|
103
|
+
});
|
|
104
|
+
await Promise.all(notifiers);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Invoke an observer for the given event
|
|
108
|
+
* @param observer - A life cycle observer
|
|
109
|
+
* @param event - Event name
|
|
110
|
+
*/
|
|
111
|
+
async invokeObserver(observer, event) {
|
|
112
|
+
if (typeof observer[event] === 'function') {
|
|
113
|
+
await observer[event]();
|
|
106
114
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Emit events to the observer groups
|
|
118
|
+
* @param events - Event names
|
|
119
|
+
* @param groups - Observer groups
|
|
120
|
+
*/
|
|
121
|
+
async notifyGroups(events, groups, reverse = false) {
|
|
122
|
+
const observers = await this.observersView.values();
|
|
123
|
+
const bindings = this.observersView.bindings;
|
|
124
|
+
if (reverse) {
|
|
125
|
+
// Do not reverse the original `groups` in place
|
|
126
|
+
groups = [...groups].reverse();
|
|
116
127
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (reverse) {
|
|
126
|
-
// Do not reverse the original `groups` in place
|
|
127
|
-
groups = [...groups].reverse();
|
|
128
|
+
for (const group of groups) {
|
|
129
|
+
const observersForGroup = [];
|
|
130
|
+
const bindingsInGroup = reverse
|
|
131
|
+
? group.bindings.reverse()
|
|
132
|
+
: group.bindings;
|
|
133
|
+
for (const binding of bindingsInGroup) {
|
|
134
|
+
const index = bindings.indexOf(binding);
|
|
135
|
+
observersForGroup.push(observers[index]);
|
|
128
136
|
}
|
|
129
|
-
for (const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
: group.bindings;
|
|
134
|
-
for (const binding of bindingsInGroup) {
|
|
135
|
-
const index = bindings.indexOf(binding);
|
|
136
|
-
observersForGroup.push(observers[index]);
|
|
137
|
-
}
|
|
138
|
-
for (const event of events) {
|
|
139
|
-
debug('Beginning notification %s of %s...', event);
|
|
140
|
-
await this.notifyObservers(observersForGroup, group.bindings, event);
|
|
141
|
-
debug('Finished notification %s of %s', event);
|
|
142
|
-
}
|
|
137
|
+
for (const event of events) {
|
|
138
|
+
debug('Beginning notification %s of %s...', event);
|
|
139
|
+
await this.notifyObservers(observersForGroup, group.bindings, event);
|
|
140
|
+
debug('Finished notification %s of %s', event);
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Notify all life cycle observers by group of `start`
|
|
146
|
+
*/
|
|
147
|
+
async start() {
|
|
148
|
+
debug('Starting the %s...');
|
|
149
|
+
const groups = this.getObserverGroupsByOrder();
|
|
150
|
+
await this.notifyGroups(['start'], groups);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Notify all life cycle observers by group of `stop`
|
|
154
|
+
*/
|
|
155
|
+
async stop() {
|
|
156
|
+
debug('Stopping the %s...');
|
|
157
|
+
const groups = this.getObserverGroupsByOrder();
|
|
158
|
+
// Stop in the reverse order
|
|
159
|
+
await this.notifyGroups(['stop'], groups, true);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
LifeCycleObserverRegistry = tslib_1.__decorate([
|
|
163
|
+
tslib_1.__param(0, context_1.inject.view(lifecycle_1.lifeCycleObserverFilter)),
|
|
164
|
+
tslib_1.__param(1, context_1.inject(keys_1.CoreBindings.LIFE_CYCLE_OBSERVER_OPTIONS, { optional: true })),
|
|
165
|
+
tslib_1.__metadata("design:paramtypes", [context_1.ContextView, Object])
|
|
166
|
+
], LifeCycleObserverRegistry);
|
|
170
167
|
exports.LifeCycleObserverRegistry = LifeCycleObserverRegistry;
|
|
171
168
|
//# sourceMappingURL=lifecycle-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-registry.js","sourceRoot":"","sources":["../src/lifecycle-registry.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAK2B;AAC3B,iCAA8C;AAC9C,2CAAuE;AACvE,sCAAuC;AACvC,MAAM,KAAK,GAAG,YAAY,CAAC,yBAAyB,CAAC,CAAC;AA8BzC,QAAA,sBAAsB,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEjD;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"lifecycle-registry.js","sourceRoot":"","sources":["../src/lifecycle-registry.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,+CAK2B;AAC3B,iCAA8C;AAC9C,2CAAuE;AACvE,sCAAuC;AACvC,MAAM,KAAK,GAAG,YAAY,CAAC,yBAAyB,CAAC,CAAC;AA8BzC,QAAA,sBAAsB,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEjD;;GAEG;AACH,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IACpC,YAEqB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,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;aAC1C;YAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;gBAC1B,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;gBACnD,MAAM,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;gBACrE,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;aAChD;SACF;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC/C,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI;QACf,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC/C,4BAA4B;QAC5B,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AA7LY,yBAAyB;IAEjC,mBAAA,gBAAM,CAAC,IAAI,CAAC,mCAAuB,CAAC,CAAA;IAEpC,mBAAA,gBAAM,CAAC,mBAAY,CAAC,2BAA2B,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;6CADjC,qBAAW;GAHpC,yBAAyB,CA6LrC;AA7LY,8DAAyB"}
|
package/dist/mixin-target.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { Constructor } from '@loopback/context';
|
|
|
20
20
|
* the base class. You can use the following approach as a workaround:
|
|
21
21
|
*
|
|
22
22
|
* ```ts
|
|
23
|
+
* // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
23
24
|
* // @ts-ignore
|
|
24
25
|
* (this as unknown as {YourBaseClass}).protectedMember
|
|
25
26
|
* ```
|
package/dist/mixin-target.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp.
|
|
2
|
+
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/core
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
package/dist/mixin-target.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixin-target.js","sourceRoot":"","sources":["../src/mixin-target.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"mixin-target.js","sourceRoot":"","sources":["../src/mixin-target.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE"}
|
package/dist/service.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2019. All Rights Reserved.
|
|
2
|
+
// Copyright IBM Corp. 2019,2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/core
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
package/dist/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,8BAA8B;AAC9B,+CAA+C;AAC/C,gEAAgE;;;AAEhE,+CAgB2B;AAC3B,iCAAgC;AAgBhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,OAAO,CACrB,gBAAmC,EACnC,QAA4B;IAE5B,OAAO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IAAI,EAAE,eAAQ,CAAC,OAAO;QACtB,GAAG,OAAO;KACX,CAAC,CAAC,KAAK,CAAC,SAAS,OAAC,OAAO,CAAC,SAAS,mCAAI,GAAG,CAAC,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC;AACjB,CAAC;AAxBD,oDAwBC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,gBAAkC;IAC1D,OAAO,SAAS,eAAe,CAAC,OAAgB;QAC9C,OAAO,CAAC,GAAG,CAAC;YACV,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,eAAQ,CAAC,OAAO;YACpC,CAAC,eAAQ,CAAC,iBAAiB,CAAC,EAAE,gBAAgB;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAPD,8BAOC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/core",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.9.1",
|
|
4
|
+
"description": "Define and implement core constructs such as Application and Component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=10"
|
|
8
|
+
"node": ">=10.16"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -20,17 +20,20 @@
|
|
|
20
20
|
"author": "IBM Corp.",
|
|
21
21
|
"copyright.owner": "IBM Corp.",
|
|
22
22
|
"license": "MIT",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
23
26
|
"dependencies": {
|
|
24
|
-
"@loopback/context": "^3.
|
|
27
|
+
"@loopback/context": "^3.9.2",
|
|
25
28
|
"debug": "^4.1.1",
|
|
26
29
|
"tslib": "^2.0.0"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
29
|
-
"@loopback/build": "^
|
|
30
|
-
"@loopback/eslint-config": "^
|
|
31
|
-
"@loopback/testlab": "^3.
|
|
32
|
+
"@loopback/build": "^6.1.0",
|
|
33
|
+
"@loopback/eslint-config": "^8.0.3",
|
|
34
|
+
"@loopback/testlab": "^3.2.0",
|
|
32
35
|
"@types/debug": "^4.1.5",
|
|
33
|
-
"@types/node": "^10.17.
|
|
36
|
+
"@types/node": "^10.17.26"
|
|
34
37
|
},
|
|
35
38
|
"files": [
|
|
36
39
|
"README.md",
|
|
@@ -43,5 +46,5 @@
|
|
|
43
46
|
"url": "https://github.com/strongloop/loopback-next.git",
|
|
44
47
|
"directory": "packages/core"
|
|
45
48
|
},
|
|
46
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b89db3d3b8be6a36e63e91c2331d217fda7538de"
|
|
47
50
|
}
|
package/src/application.ts
CHANGED
|
@@ -129,6 +129,11 @@ export class Application extends Context implements LifeCycleObserver {
|
|
|
129
129
|
// Make options available to other modules as well.
|
|
130
130
|
this.bind(CoreBindings.APPLICATION_CONFIG).to(this.options);
|
|
131
131
|
|
|
132
|
+
// Also configure the application instance to allow `@config`
|
|
133
|
+
this.configure(CoreBindings.APPLICATION_INSTANCE).toAlias(
|
|
134
|
+
CoreBindings.APPLICATION_CONFIG,
|
|
135
|
+
);
|
|
136
|
+
|
|
132
137
|
this._shutdownOptions = {signals: ['SIGTERM'], ...this.options.shutdown};
|
|
133
138
|
}
|
|
134
139
|
|
|
@@ -451,7 +456,7 @@ export class Application extends Context implements LifeCycleObserver {
|
|
|
451
456
|
* ```
|
|
452
457
|
*/
|
|
453
458
|
public service<S>(
|
|
454
|
-
cls:
|
|
459
|
+
cls: ServiceOrProviderClass<S>,
|
|
455
460
|
nameOrOptions?: string | ServiceOptions,
|
|
456
461
|
): Binding<S> {
|
|
457
462
|
const options = toOptions(nameOrOptions);
|
|
@@ -602,6 +607,9 @@ export interface ApplicationConfig {
|
|
|
602
607
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
603
608
|
export type ControllerClass<T = any> = Constructor<T>;
|
|
604
609
|
|
|
610
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
611
|
+
export type ServiceOrProviderClass<T = any> = Constructor<T | Provider<T>>;
|
|
612
|
+
|
|
605
613
|
/**
|
|
606
614
|
* Type description for `package.json`
|
|
607
615
|
*/
|
package/src/component.ts
CHANGED
|
@@ -10,7 +10,11 @@ import {
|
|
|
10
10
|
createBindingFromClass,
|
|
11
11
|
Provider,
|
|
12
12
|
} from '@loopback/context';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Application,
|
|
15
|
+
ControllerClass,
|
|
16
|
+
ServiceOrProviderClass,
|
|
17
|
+
} from './application';
|
|
14
18
|
import {LifeCycleObserver} from './lifecycle';
|
|
15
19
|
import {Server} from './server';
|
|
16
20
|
|
|
@@ -71,6 +75,11 @@ export interface Component {
|
|
|
71
75
|
|
|
72
76
|
lifeCycleObservers?: Constructor<LifeCycleObserver>[];
|
|
73
77
|
|
|
78
|
+
/**
|
|
79
|
+
* An array of service or provider classes
|
|
80
|
+
*/
|
|
81
|
+
services?: ServiceOrProviderClass[];
|
|
82
|
+
|
|
74
83
|
/**
|
|
75
84
|
* An array of bindings to be aded to the application context.
|
|
76
85
|
*
|
|
@@ -137,4 +146,10 @@ export function mountComponent(app: Application, component: Component) {
|
|
|
137
146
|
app.lifeCycleObserver(observer);
|
|
138
147
|
}
|
|
139
148
|
}
|
|
149
|
+
|
|
150
|
+
if (component.services) {
|
|
151
|
+
for (const service of component.services) {
|
|
152
|
+
app.service(service);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
140
155
|
}
|
package/src/mixin-target.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp.
|
|
1
|
+
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/core
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -26,6 +26,7 @@ import {Constructor} from '@loopback/context';
|
|
|
26
26
|
* the base class. You can use the following approach as a workaround:
|
|
27
27
|
*
|
|
28
28
|
* ```ts
|
|
29
|
+
* // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
29
30
|
* // @ts-ignore
|
|
30
31
|
* (this as unknown as {YourBaseClass}).protectedMember
|
|
31
32
|
* ```
|
package/src/service.ts
CHANGED