# @taylordb/forms-api
Type: api (framework-agnostic actions; pair with your router or routes)

## Overview

Factory for multi-step form sessions: `createSession`, `loadSession`, `saveAnswer`, `submitForm`. Wire format uses **step ids** (strings) and `sharedSteps` + `resolvers` from `@taylordb/forms-core`. Handlers and email HTML live in `@taylordb/forms-core`; runtime validation lives on normalized `defineForm` schemas (`src/types.ts` in forms-core is the source of truth for built-in defaults).

## Docs

- API reference (`createFormsActions`, actions, types): ./docs/api.md
- Errors (`FormsError`, codes): ./docs/errors.md
- Migration: ./docs/migration.md

## Attachment helpers

Use `attachmentsToFileAnswers()` in `session.loadSession` when a file question
is backed by a TaylorDB attachment column. It converts `Attachment` /
`AttachmentColumnValue` metadata to core `FileAnswer[]` so `file_upload`
validation and UI rehydration see accurate `name`, `size`, `type`, and `url`.

`AttachmentColumnType` accepts `Attachment[]`, `AttachmentId[]`, or
`{ newIds: AttachmentId[]; deletedIds: AttachmentId[] }`, where
`AttachmentId = number | string`.
