Noir::WaspExtractor
Wasp (https://wasp.sh) app declarations.
A Wasp app declares its HTTP surface in a config file rather than in route calls, in one of three syntaxes:
- The Wasp DSL (
main.wasp, any*.waspfile up to Wasp 0.23):api fooBar { fn: import { fooBar } from "@src/apis", httpRoute: (GET, "/foo/bar") } - The Wasp Spec (
main.wasp.tsplus any*.wasp.ts, Wasp 0.24+, imported from@wasp.sh/spec):api("GET", "/foo/bar", fooBar, { auth: false }) - The preview TS config (Wasp 0.15–0.23, imported from
wasp-config):app.api("fooBar", { fn: { import: "fooBar", from: "@src/apis" }, httpRoute: { method: "GET", route: "/foo/bar" } })
All three describe the same declarations, so each parser fills the same
Spec. Mapping declarations to server routes is left to the analyzer.
Constants
Instance methods
auth: { methods: { usernameAndPassword: {}, google: {} } } → the
enabled method keys.
Finds the exported function name (default for the default export)
in a handler module: export const x = async (args, ctx) => {...},
export function x(req, res) {...}, export default async function.
The text between the braces of an object literal, or nil when the
value is not one. Trailing TS as X / satisfies X are tolerated.
Top-level key: value entries of an object literal body (the text
between its braces). Shorthand entries map a key to itself; spreads
are skipped.
The object literal bound to name (const name: Auth = { ... }),
for an app({ auth: name }) declared in another file.
The fields an operation reads from its first argument (args):
destructured in the signature (({ id, title }, context)), or read
as args.x / const { x } = args in the body.