(route: Node, root: Node | null)
| 627 | |
| 628 | /** The request a route's handler serves, as its trigger; a Next page's own work fires from its load. */ |
| 629 | const requestTrigger = async (route: Node, root: Node | null): Promise<WireStepTrigger | null> => { |
| 630 | const { method, path } = splitRouteName(route.name); |
| 631 | if (method === null) { |
| 632 | if (nextRouteForFile(route.filePath)?.kind === 'page') return { kind: 'load', name: 'GET', of: path, in: basename(route.filePath) }; |
| 633 | return null; |
| 634 | } |
| 635 | const after = await chainFor(route, root); |
| 636 | return { kind: 'request', name: method, of: path, in: basename(route.filePath), ...(after.length > 0 ? { after } : {}) }; |
| 637 | }; |
| 638 | |
| 639 | /** A job, an event, a message or a schedule that fires a function, from its decorators. */ |
| 640 | const consumerTrigger = async (node: Node): Promise<WireStepTrigger | null> => { |
no test coverage detected