Skip to content

Add Airtable emulator - #192

Open
sahil-shubham wants to merge 9 commits into
vercel-labs:mainfrom
sahil-shubham:add-airtable-emulator
Open

Add Airtable emulator#192
sahil-shubham wants to merge 9 commits into
vercel-labs:mainfrom
sahil-shubham:add-airtable-emulator

Conversation

@sahil-shubham

Copy link
Copy Markdown

Airtable emulator

Adds a stateful Airtable Data API emulator (@emulators/airtable, port 4014) — a drop-in for the REST API used by the official Airtable.js and pyairtable SDKs, not a mock.

Airtable is the first schema-defined service in the project: bases, tables, fields, and views are user data, and the Data API validates records against them. The package carries a small schema registry (kept inside the package, not in core) and validates generic record blobs against it.

Records

  • GET /v0/:baseId/:tableIdOrName — list (filterByFormula, sort, fields, view, pageSize, maxRecords, offset, cellFormat, returnFieldsByFieldId)
  • POST /v0/:baseId/:tableIdOrName/listRecords — body-based list for long formulas
  • GET /v0/:baseId/:tableIdOrName/:recordId — get one
  • POST /v0/:baseId/:tableIdOrName — create single {fields} or batch {records} (up to 10, with typecast)
  • PATCH /v0/:baseId/:tableIdOrName — batch update, or upsert via performUpsert.fieldsToMergeOn
  • PUT /v0/:baseId/:tableIdOrName — batch replace
  • PATCH / PUT /v0/:baseId/:tableIdOrName/:recordId — update (merge) or replace one
  • DELETE /v0/:baseId/:tableIdOrName/:recordId and DELETE /v0/:baseId/:tableIdOrName?records[]=... — delete one or batch

Tables and fields are addressable by id or name. filterByFormula is a real recursive-descent parser + evaluator over the record's cells, covering the common subset (AND/OR/NOT/IF, comparisons, LOWER/FIND/SEARCH, RECORD_ID, BLANK, IS_AFTER/IS_SAME/DATEADD/TODAY, {Field} refs) with Airtable's loose coercion. It references fields by name (a {fldXXX} id token errors, matching Airtable); computed fields filter on their stored value. Unsupported functions return INVALID_FILTER_BY_FORMULA.

Record comments

  • GET / POST / DELETE /v0/:baseId/:tableIdOrName/:recordId/comments — threaded, offset-paginated, with author identity and @[usrXXX] mention parsing.

Meta and inspector

  • GET /v0/meta/whoami, GET /v0/meta/bases, GET /v0/meta/bases/:baseId/tables
  • GET / — tabbed inspector (bases, tables, records, identity) via the shared ui.ts design system.

Auth, seeding, error envelopes

Auth is relaxed by default so any bearer token works. Seeding takes an explicit schema, or infers fields from records when none are declared; base/table/field ids pass through verbatim. Error responses match the live API, including the two shapes Airtable uses (object form {"error":{"type","message"}} and the bare-string {"error":"NOT_FOUND"} for unknown base/record).

Testing

vitest conformance: a dedicated filterByFormula matrix plus records/comments/meta/error-envelope coverage (55 tests). Verified end to end over real HTTP via the CLI.

Not included (deferred)

Webhooks, attachment uploads, and Meta write endpoints are not implemented; filterByFormula is a documented subset; computed fields are stored, not recomputed; view filters are seeded rather than discovered (the public schema API does not expose them); per-base rate limiting is not emulated.

Notes

  • Docs updated in lockstep per AGENTS.md: README, docs site, agent skill, and emulate.config.example.yaml.
  • Per the release model, this PR does not bump the version or edit the changelog — left to the maintainer's release PR. sync-versions --check passes (the new package matches the current 0.9.0).
  • The branch is a clean series of atomic commits (scaffold, formula engine, records/meta, comments, inspector, CLI registration, tests, docs).

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@sahil-shubham is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant