@loopback/service-proxy 2.3.7 → 3.0.2
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 +48 -0
- package/dist/mixins/service.mixin.d.ts +18 -12
- package/package.json +12 -9
- package/src/mixins/service.mixin.ts +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,54 @@
|
|
|
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
|
+
## [3.0.2](https://github.com/strongloop/loopback-next/compare/@loopback/service-proxy@3.0.1...@loopback/service-proxy@3.0.2) (2020-10-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/service-proxy
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.0.1](https://github.com/strongloop/loopback-next/compare/@loopback/service-proxy@3.0.0...@loopback/service-proxy@3.0.1) (2020-09-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @loopback/service-proxy
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.0.0](https://github.com/strongloop/loopback-next/compare/@loopback/service-proxy@2.3.8...@loopback/service-proxy@3.0.0) (2020-09-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* move framework packages to `devDependencies` ([e2c61ce](https://github.com/strongloop/loopback-next/commit/e2c61ce79aa68d76f6e7138642034160b50063f0))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
* components no longer install core framework packages as
|
|
33
|
+
their own dependencies, they use the framework packages provided by the
|
|
34
|
+
target application instead.
|
|
35
|
+
|
|
36
|
+
If you are getting `npm install` errors after upgrade, then make sure
|
|
37
|
+
your project lists all dependencies required by the extensions you are
|
|
38
|
+
using.
|
|
39
|
+
|
|
40
|
+
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [2.3.8](https://github.com/strongloop/loopback-next/compare/@loopback/service-proxy@2.3.7...@loopback/service-proxy@2.3.8) (2020-08-27)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @loopback/service-proxy
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
6
54
|
## [2.3.7](https://github.com/strongloop/loopback-next/compare/@loopback/service-proxy@2.3.6...@loopback/service-proxy@2.3.7) (2020-08-19)
|
|
7
55
|
|
|
8
56
|
**Note:** Version bump only for package @loopback/service-proxy
|
|
@@ -77,7 +77,7 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
77
77
|
* app.component(ProductComponent);
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
component<
|
|
80
|
+
component<C extends Component = Component>(componentCtor: Constructor<C>, nameOrOptions?: string | BindingFromClassOptions | undefined): Binding<C>;
|
|
81
81
|
/**
|
|
82
82
|
* Get an instance of a component and mount all it's
|
|
83
83
|
* services. This function is intended to be used internally
|
|
@@ -85,23 +85,26 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
85
85
|
*
|
|
86
86
|
* @param component - The component to mount services of
|
|
87
87
|
*/
|
|
88
|
-
mountComponentServices<
|
|
88
|
+
mountComponentServices<C_1 extends Component = Component>(component: Constructor<C_1>, componentBindingKey?: string | loopbackContext.BindingKey<C_1> | undefined): void;
|
|
89
89
|
readonly options: loopbackContext.ApplicationConfig;
|
|
90
90
|
readonly state: string;
|
|
91
|
-
controller: <
|
|
92
|
-
server: <
|
|
93
|
-
servers: <
|
|
94
|
-
getServer: <
|
|
91
|
+
controller: <T_1>(controllerCtor: Constructor<T_1>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_1>;
|
|
92
|
+
server: <T_2 extends loopbackContext.Server>(ctor: Constructor<T_2>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_2>;
|
|
93
|
+
servers: <T_3 extends loopbackContext.Server>(ctors: Constructor<T_3>[]) => Binding<any>[];
|
|
94
|
+
getServer: <T_4 extends loopbackContext.Server>(target: string | Constructor<T_4>) => Promise<T_4>;
|
|
95
95
|
start: () => Promise<void>;
|
|
96
|
+
onStart: (fn: () => loopbackContext.ValueOrPromise<void>) => Binding<loopbackContext.LifeCycleObserver>;
|
|
96
97
|
stop: () => Promise<void>;
|
|
98
|
+
onStop: (fn: () => loopbackContext.ValueOrPromise<void>) => Binding<loopbackContext.LifeCycleObserver>;
|
|
97
99
|
setMetadata: (metadata: loopbackContext.ApplicationMetadata) => void;
|
|
98
|
-
lifeCycleObserver: <
|
|
99
|
-
service: <S_2>(cls:
|
|
100
|
+
lifeCycleObserver: <T_5 extends loopbackContext.LifeCycleObserver>(ctor: Constructor<T_5>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_5>;
|
|
101
|
+
service: <S_2>(cls: loopbackContext.ServiceOrProviderClass<S_2>, nameOrOptions?: string | ServiceOptions | undefined) => Binding<S_2>;
|
|
100
102
|
interceptor: (interceptor: loopbackContext.Interceptor | Constructor<Provider<loopbackContext.Interceptor>>, nameOrOptions?: string | loopbackContext.InterceptorBindingOptions | undefined) => Binding<loopbackContext.Interceptor>;
|
|
101
103
|
readonly name: string;
|
|
102
104
|
readonly subscriptionManager: loopbackContext.ContextSubscriptionManager;
|
|
105
|
+
scope: loopbackContext.BindingScope;
|
|
103
106
|
readonly parent: loopbackContext.Context | undefined;
|
|
104
|
-
emitEvent: <
|
|
107
|
+
emitEvent: <T_6 extends loopbackContext.ContextEvent>(type: string, event: T_6) => void;
|
|
105
108
|
emitError: (err: unknown) => void;
|
|
106
109
|
bind: <ValueType = any>(key: BindingAddress<ValueType>) => Binding<ValueType>;
|
|
107
110
|
add: (binding: Binding<unknown>) => Application;
|
|
@@ -114,10 +117,13 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
114
117
|
unsubscribe: (observer: loopbackContext.ContextEventObserver) => boolean;
|
|
115
118
|
close: () => void;
|
|
116
119
|
isSubscribed: (observer: loopbackContext.ContextObserver) => boolean;
|
|
117
|
-
createView: <
|
|
120
|
+
createView: <T_7 = unknown>(filter: loopbackContext.BindingFilter, comparator?: loopbackContext.BindingComparator | undefined) => loopbackContext.ContextView<T_7>;
|
|
118
121
|
contains: (key: BindingAddress<unknown>) => boolean;
|
|
119
122
|
isBound: (key: BindingAddress<unknown>) => boolean;
|
|
120
|
-
getOwnerContext: (
|
|
123
|
+
getOwnerContext: (keyOrBinding: string | loopbackContext.BindingKey<unknown> | Readonly<Binding<unknown>>) => loopbackContext.Context | undefined;
|
|
124
|
+
getScopedContext: (scope: loopbackContext.BindingScope.APPLICATION | loopbackContext.BindingScope.SERVER | loopbackContext.BindingScope.REQUEST) => loopbackContext.Context | undefined;
|
|
125
|
+
getResolutionContext: (binding: Readonly<Binding<unknown>>) => loopbackContext.Context | undefined;
|
|
126
|
+
isVisibleTo: (ctx: loopbackContext.Context) => boolean;
|
|
121
127
|
find: <ValueType_1 = any>(pattern?: string | RegExp | loopbackContext.BindingFilter | undefined) => Readonly<Binding<ValueType_1>>[];
|
|
122
128
|
findByTag: <ValueType_2 = any>(tagFilter: string | RegExp | Record<string, any>) => Readonly<Binding<ValueType_2>>[];
|
|
123
129
|
get: {
|
|
@@ -134,7 +140,7 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
134
140
|
optional?: boolean | undefined;
|
|
135
141
|
} | undefined): Binding<ValueType_8> | undefined;
|
|
136
142
|
};
|
|
137
|
-
findOrCreateBinding: <
|
|
143
|
+
findOrCreateBinding: <T_8>(key: BindingAddress<T_8>, policy?: loopbackContext.BindingCreationPolicy | undefined) => Binding<T_8>;
|
|
138
144
|
getValueOrPromise: <ValueType_9>(keyWithPath: BindingAddress<ValueType_9>, optionsOrSession?: loopbackContext.ResolutionOptions | loopbackContext.ResolutionSession | undefined) => loopbackContext.ValueOrPromise<ValueType_9 | undefined>;
|
|
139
145
|
toJSON: () => loopbackContext.JSONObject;
|
|
140
146
|
inspect: (options?: loopbackContext.ContextInspectOptions | undefined) => loopbackContext.JSONObject;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/service-proxy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "A common set of interfaces for interacting with service oriented backends such as REST APIs, SOAP Web Services, and gRPC microservices",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
8
|
+
"node": "^10.16 || 12 || 14"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -23,16 +23,19 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@loopback/core": "^2.11.0"
|
|
28
|
+
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@loopback/build": "^6.2.
|
|
28
|
-
"@loopback/
|
|
29
|
-
"@loopback/
|
|
30
|
-
"@
|
|
30
|
+
"@loopback/build": "^6.2.5",
|
|
31
|
+
"@loopback/core": "^2.11.0",
|
|
32
|
+
"@loopback/eslint-config": "^10.0.1",
|
|
33
|
+
"@loopback/testlab": "^3.2.7",
|
|
34
|
+
"@types/node": "^10.17.35"
|
|
31
35
|
},
|
|
32
36
|
"dependencies": {
|
|
33
|
-
"@loopback/core": "^2.9.4",
|
|
34
37
|
"loopback-datasource-juggler": "^4.24.0",
|
|
35
|
-
"tslib": "^2.0.
|
|
38
|
+
"tslib": "^2.0.2"
|
|
36
39
|
},
|
|
37
40
|
"files": [
|
|
38
41
|
"README.md",
|
|
@@ -45,5 +48,5 @@
|
|
|
45
48
|
"url": "https://github.com/strongloop/loopback-next.git",
|
|
46
49
|
"directory": "packages/service-proxy"
|
|
47
50
|
},
|
|
48
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "390f2794d10eea3d969ae417963af815ce1bc417"
|
|
49
52
|
}
|
|
@@ -114,8 +114,8 @@ export function ServiceMixin<T extends MixinTarget<Application>>(
|
|
|
114
114
|
// from mapped types. https://github.com/microsoft/TypeScript/issues/38496
|
|
115
115
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
116
116
|
// @ts-ignore
|
|
117
|
-
component<
|
|
118
|
-
componentCtor: Constructor<
|
|
117
|
+
component<C extends Component = Component>(
|
|
118
|
+
componentCtor: Constructor<C>,
|
|
119
119
|
nameOrOptions?: string | BindingFromClassOptions,
|
|
120
120
|
) {
|
|
121
121
|
const binding = super.component(componentCtor, nameOrOptions);
|
|
@@ -130,9 +130,9 @@ export function ServiceMixin<T extends MixinTarget<Application>>(
|
|
|
130
130
|
*
|
|
131
131
|
* @param component - The component to mount services of
|
|
132
132
|
*/
|
|
133
|
-
mountComponentServices<
|
|
134
|
-
component: Constructor<
|
|
135
|
-
componentBindingKey?: BindingAddress<
|
|
133
|
+
mountComponentServices<C extends Component = Component>(
|
|
134
|
+
component: Constructor<C>,
|
|
135
|
+
componentBindingKey?: BindingAddress<C>,
|
|
136
136
|
) {
|
|
137
137
|
const componentKey =
|
|
138
138
|
componentBindingKey ?? `components.${component.name}`;
|