Skip to content

feat: Add resouce types#938

Merged
razor-x merged 4 commits into
mainfrom
codex/investigate-using-blueprint-for-ts-types
Jul 24, 2026
Merged

feat: Add resouce types#938
razor-x merged 4 commits into
mainfrom
codex/investigate-using-blueprint-for-ts-types

Conversation

@razor-x

@razor-x razor-x commented Jul 24, 2026

Copy link
Copy Markdown
Member

Motivation

  • Replace ad-hoc @seamapi/types-based parameter and response shapes with types derived from the @seamapi/blueprint so documented endpoints expose accurate parameter optionality, nullability, lists, nested objects and enums.
  • Provide a single source of truth for resource response shapes to avoid duplicated, inconsistent resource declarations across generated routes.
  • Preserve legacy @seamapi/types route types for undocumented endpoints and action-attempt responses where the blueprint cannot be used without breaking existing helpers.

Description

  • Codegen now renders endpoint parameter types and shared resource types from the blueprint by extending codegen/lib/layouts/route.ts and codegen/lib/connect.ts and updating templates to conditionally use blueprint-derived types; undocumented endpoints and action-attempt responses keep @seamapi/types-based signatures.
  • Introduced a generated src/lib/seam/connect/routes/blueprint-resources.ts that contains exported resource types (e.g., DeviceResource, AccessCodeResource, ActionAttemptResource, etc.) and updated route files to import and reference these types where appropriate.
  • Updated codegen templates/partials to emit either RouteRequest/RouteResponse usage for legacy/undocumented cases or inline/declared blueprint-derived types for documented endpoints; added helpers (getResourceTypeName, renderBlueprintResources, object/enum renderers) to render TypeScript types from blueprint metadata.
  • Regenerated the Connect route sources under src/lib/seam/connect/routes/... so many route signatures now reference blueprint-derived parameter and response types while retaining legacy types where needed.

Testing

  • Ran generation with npm run generate and formatting/ESLint fixes as part of the pipeline, which completed successfully.
  • Performed static checking with npm run typecheck (TypeScript tsc) and npm run lint, both of which passed after the generator updates and template fixes.
  • Executed the test suite with an extended timeout using npx c8 ava --timeout=2m, which completed successfully; note that the default npm test run exceeded AVA’s default timeout, but the same suite passed with the explicit two-minute timeout.
  • Verified code formatting checks (prettier --check) and generation output consistency during the postgenerate step (no formatting errors reported).

Codex Task

@razor-x razor-x changed the title Generate documented SDK request and resource types from blueprint feat: Add resouce types Jul 24, 2026
@razor-x
razor-x merged commit 2495487 into main Jul 24, 2026
16 checks passed
@razor-x
razor-x deleted the codex/investigate-using-blueprint-for-ts-types branch July 24, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant