fix(core): update

This commit is contained in:
Philipp Kunz 2021-11-07 15:40:01 +01:00
parent 556ba6cb30
commit 9b5ff4b1b5
2 changed files with 1670 additions and 1541 deletions

3200
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -91,7 +91,7 @@ export class TypedRouter {
* if typedrequest object has correlation.phase === 'response' -> routes a typed request object to request fire event
* @param typedRequestArg
*/
public async routeAndAddResponse<T extends plugins.typedRequestInterfaces.ITypedRequest = any>(typedRequestArg: T) {
public async routeAndAddResponse<T extends plugins.typedRequestInterfaces.ITypedRequest = any>(typedRequestArg: T): Promise<T> {
if (!typedRequestArg?.correlation?.phase || typedRequestArg.correlation.phase === 'request') {
const typedHandler = this.getTypedHandlerForMethod(typedRequestArg.method);
@ -112,13 +112,8 @@ export class TypedRouter {
} else {
console.log('received weirdly shaped request');
console.log(typedRequestArg);
return {}
return null
}
return {
...typedRequestArg,
...{
method: 'nullPathFromResponse',
},
};
return typedRequestArg;
}
}