Documents / @faasjs/core / DefineApiData
Type Alias: DefineApiData<TSchema>
DefineApiData<
TSchema> =InvokeData<Record<string,unknown>,unknown,unknown> &object&DefineApiInject
Handler data passed to defineApi.
Extends the normal invoke data with validated params, cookie, session,
and any plugin-provided fields declared through DefineApiInject. The built-in
HTTP plugin augments this type with headers, body, setHeader,
setContentType, setStatusCode, and setBody.
Type Declaration
cookie
cookie:
Cookie
Cookie helper injected by the HTTP plugin.
params
params:
SchemaOutput<TSchema,Record<string,never>>
Params validated by the optional Zod schema.
session
session:
Session
Session helper injected by the HTTP plugin.
Type Parameters
TSchema
TSchema extends ZodType | undefined = undefined
Zod schema used to validate event.params.