@loopback/service-proxy 5.0.10 → 6.1.0
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/dist/decorators/service.decorator.d.ts +1 -1
- package/dist/decorators/service.decorator.js.map +1 -1
- package/dist/legacy-juggler-bridge.js +1 -1
- package/dist/legacy-juggler-bridge.js.map +1 -1
- package/dist/mixins/service.mixin.d.ts +25 -25
- package/package.json +11 -11
- package/src/decorators/service.decorator.ts +5 -1
|
@@ -14,4 +14,4 @@ export declare class ServiceProxyMetadata implements InjectionMetadata {
|
|
|
14
14
|
dataSource?: juggler.DataSource;
|
|
15
15
|
constructor(dataSource: string | juggler.DataSource);
|
|
16
16
|
}
|
|
17
|
-
export declare function serviceProxy(dataSource: string | juggler.DataSource): (target: object, key: string, parameterIndex?: number) => void;
|
|
17
|
+
export declare function serviceProxy(dataSource: string | juggler.DataSource): (target: object, key: string | undefined, parameterIndex?: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.decorator.js","sourceRoot":"","sources":["../../src/decorators/service.decorator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;AAEhE,yCAMwB;AACxB,0BAAuC;AAO1B,QAAA,iBAAiB,GAAG,uBAAgB,CAAC,MAAM,CAGtD,eAAe,CAAC,CAAC;AAEnB;;GAEG;AACH,MAAa,oBAAoB;IAK/B,YAAY,UAAuC;QAJnD,cAAS,GAAG,eAAe,CAAC;QAK1B,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;YAClC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC;SAClC;aAAM;YACL,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;SAC9B;IACH,CAAC;CACF;AAZD,oDAYC;AAED,SAAgB,YAAY,CAAC,UAAuC;IAClE,OAAO,
|
|
1
|
+
{"version":3,"file":"service.decorator.js","sourceRoot":"","sources":["../../src/decor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EAAE,CAAC,CAAC;KACvB;IACD,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;AACJ,CAAC"}
|
|
@@ -11,7 +11,7 @@ var juggler;
|
|
|
11
11
|
(function (juggler) {
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
13
|
juggler.DataSource = loopback_datasource_juggler_1.default.DataSource;
|
|
14
|
-
})(juggler
|
|
14
|
+
})(juggler || (exports.juggler = juggler = {}));
|
|
15
15
|
/**
|
|
16
16
|
* Get a service proxy from a LoopBack 3.x data source backed by
|
|
17
17
|
* service-oriented connectors such as `rest`, `soap`, and `grpc`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-juggler-bridge.js","sourceRoot":"","sources":["../src/legacy-juggler-bridge.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,sGAAiD;AAEjD,IAAiB,OAAO,CAGvB;AAHD,WAAiB,OAAO;IACtB,6DAA6D;IAC/C,kBAAU,GAAG,qCAAM,CAAC,UAAU,CAAC;AAC/C,CAAC,EAHgB,OAAO,
|
|
1
|
+
{"version":3,"file":"legacy-juggler-bridge.js","sourceRoot":"","sources":["../src/legacy-juggler-bridge.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,uCAAuC;AACvC,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,sGAAiD;AAEjD,IAAiB,OAAO,CAGvB;AAHD,WAAiB,OAAO;IACtB,6DAA6D;IAC/C,kBAAU,GAAG,qCAAM,CAAC,UAAU,CAAC;AAC/C,CAAC,EAHgB,OAAO,uBAAP,OAAO,QAGvB;AAUD;;;;;;GAMG;AACI,KAAK,UAAU,UAAU,CAC9B,EAAqB;IAErB,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;IACnB,8DAA8D;IAC9D,OAAO,EAAE,CAAC,gBAAuB,CAAC;AACpC,CAAC;AAND,gCAMC"}
|
|
@@ -86,10 +86,10 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
86
86
|
mountComponentServices<C_1 extends Component = Component>(component: Constructor<C_1>, componentBindingKey?: BindingAddress<C_1> | undefined): void;
|
|
87
87
|
readonly options: import("@loopback/core").ApplicationConfig;
|
|
88
88
|
readonly state: string;
|
|
89
|
-
controller: <
|
|
90
|
-
server: <
|
|
91
|
-
servers: <
|
|
92
|
-
getServer: <
|
|
89
|
+
controller: <T>(controllerCtor: import("@loopback/core").ControllerClass<T>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T>;
|
|
90
|
+
server: <T_1 extends import("@loopback/core").Server>(ctor: Constructor<T_1>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_1>;
|
|
91
|
+
servers: <T_2 extends import("@loopback/core").Server>(ctors: Constructor<T_2>[]) => Binding<any>[];
|
|
92
|
+
getServer: <T_3 extends import("@loopback/core").Server>(target: string | Constructor<T_3>) => Promise<T_3>;
|
|
93
93
|
init: () => Promise<void>;
|
|
94
94
|
onInit: (fn: () => import("@loopback/core").ValueOrPromise<void>) => Binding<import("@loopback/core").LifeCycleObserver>;
|
|
95
95
|
start: () => Promise<void>;
|
|
@@ -97,30 +97,30 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
97
97
|
stop: () => Promise<void>;
|
|
98
98
|
onStop: (fn: () => import("@loopback/core").ValueOrPromise<void>) => Binding<import("@loopback/core").LifeCycleObserver>;
|
|
99
99
|
setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
|
|
100
|
-
lifeCycleObserver: <
|
|
100
|
+
lifeCycleObserver: <T_4 extends import("@loopback/core").LifeCycleObserver>(ctor: Constructor<T_4>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_4>;
|
|
101
101
|
service: <S_1>(cls: import("@loopback/core").ServiceOrProviderClass<S_1>, nameOrOptions?: string | ServiceOptions | undefined) => Binding<S_1>;
|
|
102
102
|
interceptor: (interceptor: import("@loopback/core").Interceptor | Constructor<Provider<import("@loopback/core").Interceptor>>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => Binding<import("@loopback/core").Interceptor>;
|
|
103
103
|
readonly name: string;
|
|
104
104
|
readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
|
|
105
105
|
scope: import("@loopback/core").BindingScope;
|
|
106
106
|
readonly parent: import("@loopback/core").Context | undefined;
|
|
107
|
-
emitEvent: <
|
|
107
|
+
emitEvent: <T_5 extends import("@loopback/core").ContextEvent>(type: string, event: T_5) => void;
|
|
108
108
|
emitError: (err: unknown) => void;
|
|
109
109
|
bind: <ValueType = any>(key: BindingAddress<ValueType>) => Binding<ValueType>;
|
|
110
110
|
add: (binding: Binding<unknown>) => Application;
|
|
111
|
-
configure: <ConfigValueType = any>(key?: BindingAddress
|
|
112
|
-
getConfigAsValueOrPromise: <ConfigValueType_1>(key: BindingAddress
|
|
113
|
-
getConfig: <ConfigValueType_2>(key: BindingAddress
|
|
114
|
-
getConfigSync: <ConfigValueType_3>(key: BindingAddress
|
|
115
|
-
unbind: (key: BindingAddress
|
|
111
|
+
configure: <ConfigValueType = any>(key?: BindingAddress | undefined) => Binding<ConfigValueType>;
|
|
112
|
+
getConfigAsValueOrPromise: <ConfigValueType_1>(key: BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise<ConfigValueType_1 | undefined>;
|
|
113
|
+
getConfig: <ConfigValueType_2>(key: BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise<ConfigValueType_2 | undefined>;
|
|
114
|
+
getConfigSync: <ConfigValueType_3>(key: BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3 | undefined;
|
|
115
|
+
unbind: (key: BindingAddress) => boolean;
|
|
116
116
|
subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
|
|
117
117
|
unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
|
118
118
|
close: () => void;
|
|
119
119
|
isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
|
120
|
-
createView: <
|
|
121
|
-
contains: (key: BindingAddress
|
|
122
|
-
isBound: (key: BindingAddress
|
|
123
|
-
getOwnerContext: (keyOrBinding: BindingAddress
|
|
120
|
+
createView: <T_6 = unknown>(filter: import("@loopback/core").BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_6>;
|
|
121
|
+
contains: (key: BindingAddress) => boolean;
|
|
122
|
+
isBound: (key: BindingAddress) => boolean;
|
|
123
|
+
getOwnerContext: (keyOrBinding: BindingAddress | Readonly<Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
124
124
|
getScopedContext: (scope: import("@loopback/core").BindingScope.APPLICATION | import("@loopback/core").BindingScope.SERVER | import("@loopback/core").BindingScope.REQUEST) => import("@loopback/core").Context | undefined;
|
|
125
125
|
getResolutionContext: (binding: Readonly<Binding<unknown>>) => import("@loopback/core").Context | undefined;
|
|
126
126
|
isVisibleTo: (ctx: import("@loopback/core").Context) => boolean;
|
|
@@ -140,7 +140,7 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
140
140
|
optional?: boolean | undefined;
|
|
141
141
|
} | undefined): Binding<ValueType_8> | undefined;
|
|
142
142
|
};
|
|
143
|
-
findOrCreateBinding: <
|
|
143
|
+
findOrCreateBinding: <T_7>(key: BindingAddress<T_7>, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => Binding<T_7>;
|
|
144
144
|
getValueOrPromise: <ValueType_9>(keyWithPath: BindingAddress<ValueType_9>, optionsOrSession?: import("@loopback/core").ResolutionOptionsOrSession | undefined) => import("@loopback/core").ValueOrPromise<ValueType_9 | undefined>;
|
|
145
145
|
toJSON: () => import("@loopback/core").JSONObject;
|
|
146
146
|
inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
|
|
@@ -152,18 +152,18 @@ export declare function ServiceMixin<T extends MixinTarget<Application>>(superCl
|
|
|
152
152
|
(eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): Application;
|
|
153
153
|
(event: string | symbol, listener: (...args: any[]) => void): Application;
|
|
154
154
|
};
|
|
155
|
-
addListener: (
|
|
156
|
-
removeListener: (
|
|
157
|
-
off: (
|
|
155
|
+
addListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
|
156
|
+
removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
|
157
|
+
off: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
|
158
158
|
removeAllListeners: (event?: string | symbol | undefined) => Application;
|
|
159
159
|
setMaxListeners: (n: number) => Application;
|
|
160
160
|
getMaxListeners: () => number;
|
|
161
|
-
listeners: (
|
|
162
|
-
rawListeners: (
|
|
163
|
-
emit: (
|
|
164
|
-
listenerCount: (
|
|
165
|
-
prependListener: (
|
|
166
|
-
prependOnceListener: (
|
|
161
|
+
listeners: (eventName: string | symbol) => Function[];
|
|
162
|
+
rawListeners: (eventName: string | symbol) => Function[];
|
|
163
|
+
emit: (eventName: string | symbol, ...args: any[]) => boolean;
|
|
164
|
+
listenerCount: (eventName: string | symbol) => number;
|
|
165
|
+
prependListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
|
166
|
+
prependOnceListener: (eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
|
167
167
|
eventNames: () => (string | symbol)[];
|
|
168
168
|
};
|
|
169
169
|
} & T;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/service-proxy",
|
|
3
3
|
"description": "A common set of interfaces for interacting with service oriented backends such as REST APIs, SOAP Web Services, and gRPC microservices",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.1.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/service-proxy"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": "
|
|
16
|
+
"node": "16 || 18 || 20"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"acceptance": "lb-mocha \"dist/__tests__/acceptance/**/*.js\"",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"!*/__tests__"
|
|
36
36
|
],
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@loopback/core": "^
|
|
38
|
+
"@loopback/core": "^5.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"loopback-datasource-juggler": "^4.28.
|
|
42
|
-
"tslib": "^2.
|
|
41
|
+
"loopback-datasource-juggler": "^4.28.7",
|
|
42
|
+
"tslib": "^2.6.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@loopback/build": "^
|
|
46
|
-
"@loopback/core": "^
|
|
47
|
-
"@loopback/eslint-config": "^
|
|
48
|
-
"@loopback/testlab": "^
|
|
49
|
-
"@types/node": "^
|
|
45
|
+
"@loopback/build": "^10.1.0",
|
|
46
|
+
"@loopback/core": "^5.1.0",
|
|
47
|
+
"@loopback/eslint-config": "^14.0.1",
|
|
48
|
+
"@loopback/testlab": "^6.1.0",
|
|
49
|
+
"@types/node": "^16.18.37"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "10a8fa7fbd00ac77c4aee3e7f40884b07fe1919c"
|
|
52
52
|
}
|
|
@@ -40,7 +40,11 @@ export class ServiceProxyMetadata implements InjectionMetadata {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export function serviceProxy(dataSource: string | juggler.DataSource) {
|
|
43
|
-
return function (
|
|
43
|
+
return function (
|
|
44
|
+
target: object,
|
|
45
|
+
key: string | undefined,
|
|
46
|
+
parameterIndex?: number,
|
|
47
|
+
) {
|
|
44
48
|
if (key || typeof parameterIndex === 'number') {
|
|
45
49
|
const meta = new ServiceProxyMetadata(dataSource);
|
|
46
50
|
inject('', meta, resolve)(target, key, parameterIndex);
|