Skip to content

feat: Restore discriminated union types - #623

Merged
razor-x merged 1 commit into
mainfrom
better-union-types
Aug 19, 2026
Merged

feat: Restore discriminated union types#623
razor-x merged 1 commit into
mainfrom
better-union-types

Conversation

@razor-x

@razor-x razor-x commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • generate per-variant dataclasses and literal-discriminated unions for events and action attempts
  • generate discriminated variants for resource error, warning, and other discriminated-object lists
  • dispatch known variants during deserialization while preserving unknown API variants as DeepAttrDict
  • emit blueprint enums as Literal[...] types when values are available
  • update generated routes, webhook parsing, action-attempt polling, and narrowing tests

Compatibility

This changes SeamEvent and ActionAttempt from dataclasses to type aliases over variant dataclasses. It needs an explicit major/minor release decision.

No @seamapi/types bump and no changes to shared merge semantics.

Verification

  • npm run typecheck
  • npm run lint
  • just lint
  • just test — 179 passed
  • npm run generate twice with an identical diff

@razor-x
razor-x marked this pull request as ready for review August 19, 2026 20:59
@razor-x
razor-x requested a review from a team as a code owner August 19, 2026 20:59
@razor-x
razor-x force-pushed the better-union-types branch from a0e3c56 to ffd6098 Compare August 19, 2026 20:59
@razor-x razor-x changed the title Restore discriminated union types feat: Restore discriminated union types Aug 19, 2026
@razor-x
razor-x merged commit cd507cd into main Aug 19, 2026
23 checks passed
@razor-x
razor-x deleted the better-union-types branch August 19, 2026 21:05
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