Skip to content

feat: complete Zod schemas for all Assembly API resources - #3

Merged
priosshrsth merged 3 commits into
mainfrom
feature/schemas
Mar 1, 2026
Merged

feat: complete Zod schemas for all Assembly API resources#3
priosshrsth merged 3 commits into
mainfrom
feature/schemas

Conversation

@priosshrsth

Copy link
Copy Markdown
Collaborator

Summary

  • Implement complete Zod schemas (base types, request payloads, response wrappers) for all Assembly API resources matching docs/assembly-api-reference.md
  • Add shared MembershipType enum and typed status enums (TaskStatus, InvoiceStatus, ContractStatus, AppConnectionType, FileType, etc.) for DRY schema definitions
  • Create barrel index.ts files for schemas/base, schemas/responses, and schemas/requests using export * pattern
  • Add sub-entry points (assembly-kit/schemas/base, assembly-kit/schemas/responses, assembly-kit/schemas/requests) in bunup.config.ts and package.json exports
  • Make Client and Company generic over custom fields shape
  • Switch lint/format scripts from raw oxlint/oxfmt to ultracite check/ultracite fix
  • Configure .oxlintrc.json overrides to allow barrel files in entry points

New resources covered

Task, Note, Message, MessageChannel, FileChannel, File, AppConnection, AppInstall, Contract, ContractTemplate, Invoice, Subscription, Payment, Price, Product, Form, FormResponse, TaskTemplate, CustomFieldOption, Notification

Test plan

  • All 127 tests pass (bun test)
  • TypeScript type-check passes (tsc --noEmit)
  • Lint passes (ultracite check — 458 rules, 0 errors)
  • Build succeeds with all 7 entry points (bunup — 23 output files)

🤖 Generated with Claude Code

priosshrsth and others added 3 commits March 1, 2026 11:16
Adds assembly-kit/schemas with base, response, and request schemas
grounded in the official Assembly API reference. Includes object
discriminants, updatedAt, status/creationMethod on Client, and
PATCH request schemas for Client and Company. 48 tests passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Client<TCustomFields> and Company<TCustomFields> accept a custom fields
  type parameter (default: Record<string, unknown>) so callers can narrow
  the exact shape of their custom fields
- customFields is now TCustomFields | undefined — null removed as API
  either returns an object or omits the field entirely
- Zod schema stays loose (z.record(z.string(), z.unknown()).optional())
  so runtime validation passes regardless of field value types
- AddressValue, CustomFieldValue, and related helpers remain exported
  from assembly-kit/schemas as standalone type-narrowing utilities

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, configure ultracite

- Rewrite base schemas (task, note, message, invoice, contract, etc.) to match assembly-api-reference.md
- Extract shared MembershipType enum for DRY across message-channel, file-channel, app-connection
- Add typed enums: TaskStatus, InvoiceStatus, ContractStatus, AppConnectionType, FileType, etc.
- Create request schemas for note, message, invoice, subscription, contract, form-response, task, etc.
- Create response schemas for subscription, app-connection, app-install, contract-template, task-template
- Add barrel index files (base/, responses/, requests/) with export * pattern
- Add package.json exports and bunup entry points for schemas/base, schemas/responses, schemas/requests
- Configure oxlintrc overrides to allow barrel files in entry points
- Switch lint/format scripts from raw oxlint/oxfmt to ultracite check/fix
- Add assembly-api-reference.md as schema source of truth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@priosshrsth
priosshrsth merged commit 724dbb1 into main Mar 1, 2026
7 checks passed
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