@bunt/app
Advanced tools
Comparing version 0.24.3 to 0.24.4
@@ -1,2 +0,2 @@ | ||
import { ActionAny, ApplyContext, Context, ContextArg, Unit } from "@bunt/unit"; | ||
import { ActionAny, ActionTransactionHandlers, ApplyContext, Context, ContextArg, Unit } from "@bunt/unit"; | ||
import { Logger } from "@bunt/util"; | ||
@@ -15,3 +15,4 @@ import { ActionResponse, IRequest } from "./interfaces"; | ||
run(request: IRequest): Promise<ActionResponse>; | ||
on(handlers: ActionTransactionHandlers): void; | ||
getRoutes(): IRoute<ActionAny<C>>[]; | ||
} |
@@ -64,16 +64,17 @@ "use strict"; | ||
const matches = route.match(request.route); | ||
const routeContext = { | ||
request, | ||
context: __classPrivateFieldGet(this, _Application_unit, "f").context, | ||
args: new Map(Object.entries(matches)), | ||
}; | ||
if ((0, util_1.isDefined)(route.payload)) { | ||
const { payload } = route; | ||
Object.assign(state, await payload.validate(routeContext)); | ||
Object.assign(state, await payload.validate({ | ||
request, | ||
context: __classPrivateFieldGet(this, _Application_unit, "f").context, | ||
args: new Map(Object.entries(matches)), | ||
})); | ||
} | ||
Object.freeze(state); | ||
await request.linkState?.(state); | ||
// @todo | ||
return __classPrivateFieldGet(this, _Application_unit, "f").run(route.action, state); | ||
const freezedState = Object.freeze(state); | ||
await request.linkState?.(freezedState); | ||
return __classPrivateFieldGet(this, _Application_unit, "f").run(route.action, freezedState); | ||
} | ||
on(handlers) { | ||
__classPrivateFieldGet(this, _Application_unit, "f").on(handlers); | ||
} | ||
getRoutes() { | ||
@@ -80,0 +81,0 @@ return __classPrivateFieldGet(this, _Application_index, "f"); |
{ | ||
"name": "@bunt/app", | ||
"version": "0.24.3", | ||
"version": "0.24.4", | ||
"keywords": [ | ||
@@ -30,3 +30,3 @@ "typescript" | ||
"@bunt/input": "^0.24.3", | ||
"@bunt/unit": "^0.24.1", | ||
"@bunt/unit": "^0.24.4", | ||
"@bunt/util": "^0.24.0", | ||
@@ -36,3 +36,3 @@ "path-to-regexp": "^6.2.0" | ||
"license": "MIT", | ||
"gitHead": "33d041ae569666126e781996cff7da2b3a30ee47" | ||
"gitHead": "4d8b090f69cbef7d60f4d7d7b73a4ef8d80adbd1" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50843
838
Updated@bunt/unit@^0.24.4