@loopback/context
Advanced tools
Comparing version 3.9.4 to 3.10.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.10.0](https://github.com/strongloop/loopback-next/compare/@loopback/context@3.9.4...@loopback/context@3.10.0) (2020-08-19) | ||
### Features | ||
* **context:** propagate resolution session to dynamic value factory ([60929f1](https://github.com/strongloop/loopback-next/commit/60929f1193b3ac0eadc3b70e3e3efc8206e40bab)) | ||
## [3.9.4](https://github.com/strongloop/loopback-next/compare/@loopback/context@3.9.3...@loopback/context@3.9.4) (2020-08-05) | ||
@@ -8,0 +19,0 @@ |
@@ -124,2 +124,3 @@ "use strict"; | ||
skipInterceptors: true, | ||
session: resolutionCtx.options.session, | ||
}); | ||
@@ -126,0 +127,0 @@ } |
import { Context } from './context'; | ||
import { ResolutionSession } from './resolution-session'; | ||
import { ValueOrPromise } from './value-promise'; | ||
@@ -85,2 +86,6 @@ /** | ||
source?: InvocationSource; | ||
/** | ||
* Resolution session | ||
*/ | ||
session?: ResolutionSession; | ||
}; | ||
@@ -87,0 +92,0 @@ /** |
@@ -83,3 +83,3 @@ "use strict"; | ||
if (!options.skipParameterInjection) { | ||
return invokeTargetMethodWithInjection(this, targetWithMethods, this.methodName, this.args); | ||
return invokeTargetMethodWithInjection(this, targetWithMethods, this.methodName, this.args, options.session); | ||
} | ||
@@ -107,3 +107,3 @@ return invokeTargetMethod(this, targetWithMethods, this.methodName, this.args); | ||
else { | ||
return invokeTargetMethodWithInjection(ctx, target, method, nonInjectedArgs); | ||
return invokeTargetMethodWithInjection(ctx, target, method, nonInjectedArgs, options.session); | ||
} | ||
@@ -123,3 +123,3 @@ } | ||
*/ | ||
function invokeTargetMethodWithInjection(ctx, target, method, nonInjectedArgs) { | ||
function invokeTargetMethodWithInjection(ctx, target, method, nonInjectedArgs, session) { | ||
const methodName = getTargetName(target, method); | ||
@@ -133,3 +133,3 @@ /* istanbul ignore if */ | ||
} | ||
const argsOrPromise = resolver_1.resolveInjectedArguments(target, method, ctx, undefined, nonInjectedArgs); | ||
const argsOrPromise = resolver_1.resolveInjectedArguments(target, method, ctx, session, nonInjectedArgs); | ||
const targetWithMethods = target; | ||
@@ -136,0 +136,0 @@ assert_1.default(typeof targetWithMethods[method] === 'function', `Method ${method} not found`); |
{ | ||
"name": "@loopback/context", | ||
"version": "3.9.4", | ||
"version": "3.10.0", | ||
"description": "Facilities to manage artifacts and their dependencies in your Node.js applications. The module exposes TypeScript/JavaScript APIs and decorators to register artifacts, declare dependencies, and resolve artifacts by keys. It also serves as an IoC container to support dependency injection", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@loopback/metadata": "^2.2.4", | ||
"@loopback/metadata": "^2.2.5", | ||
"@types/debug": "^4.1.5", | ||
@@ -32,12 +32,12 @@ "debug": "^4.1.1", | ||
"p-event": "^4.2.0", | ||
"tslib": "^2.0.0", | ||
"tslib": "^2.0.1", | ||
"uuid": "^8.3.0" | ||
}, | ||
"devDependencies": { | ||
"@loopback/build": "^6.2.0", | ||
"@loopback/eslint-config": "^9.0.0", | ||
"@loopback/testlab": "^3.2.2", | ||
"@loopback/build": "^6.2.1", | ||
"@loopback/eslint-config": "^9.0.1", | ||
"@loopback/testlab": "^3.2.3", | ||
"@types/bluebird": "^3.5.32", | ||
"@types/node": "^10.17.28", | ||
"@types/uuid": "^8.0.0", | ||
"@types/uuid": "^8.3.0", | ||
"bluebird": "^3.7.2" | ||
@@ -65,3 +65,3 @@ }, | ||
}, | ||
"gitHead": "1619bf0c29aa03853a7977212e60028664fca640" | ||
"gitHead": "a056555744367da9caccb6be64095e27d2fe2e28" | ||
} |
@@ -264,2 +264,3 @@ // Copyright IBM Corp. 2017,2020. All Rights Reserved. | ||
skipInterceptors: true, | ||
session: resolutionCtx.options.session, | ||
}); | ||
@@ -266,0 +267,0 @@ } |
@@ -11,2 +11,3 @@ // Copyright IBM Corp. 2019,2020. All Rights Reserved. | ||
import {invokeMethodWithInterceptors} from './interceptor'; | ||
import {ResolutionSession} from './resolution-session'; | ||
import {resolveInjectedArguments} from './resolver'; | ||
@@ -124,2 +125,3 @@ import {transformValueOrPromise, ValueOrPromise} from './value-promise'; | ||
this.args, | ||
options.session, | ||
); | ||
@@ -153,2 +155,6 @@ } | ||
source?: InvocationSource; | ||
/** | ||
* Resolution session | ||
*/ | ||
session?: ResolutionSession; | ||
}; | ||
@@ -183,2 +189,3 @@ | ||
nonInjectedArgs, | ||
options.session, | ||
); | ||
@@ -210,2 +217,3 @@ } | ||
nonInjectedArgs?: InvocationArgs, | ||
session?: ResolutionSession, | ||
): ValueOrPromise<InvocationResult> { | ||
@@ -224,3 +232,3 @@ const methodName = getTargetName(target, method); | ||
ctx, | ||
undefined, | ||
session, | ||
nonInjectedArgs, | ||
@@ -227,0 +235,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
685580
15137
Updated@loopback/metadata@^2.2.5
Updatedtslib@^2.0.1