Skip to content

feat: consolidate shared ecosystem types and schemas - #4

Merged
Bccorb merged 1 commit into
mainfrom
feat/consolidate-ecosystem-schemas
Jul 29, 2026
Merged

feat: consolidate shared ecosystem types and schemas#4
Bccorb merged 1 commit into
mainfrom
feat/consolidate-ecosystem-schemas

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

Pulls the domain models and API contracts that were duplicated across seamless-auth-api, seamless-auth-react, seamless-auth-server, seamless-auth-admin-dashboard, seamless-auth-messaging, and seamless-cli into this package, so there is one definition of each.

New modules: common, role, messaging, systemConfig, oauth, webauthn, totp, stepUp, organization, me, metrics, admin.
Extended: user, credential, session, authEvent, auth.

Duplication this replaces

Consolidated into Was duplicated in
role scopedRoles.ts, maintained separately in the api (src/lib/) and the server (packages/core/src/)
messaging Three places: seamless-auth-messaging packages/core/src/types.ts, server packages/core/src/authMessaging.ts, server packages/express/src/messaging.ts (the last two byte-identical)
systemConfig api schemas, dashboard useSystemConfig.ts, cli core/systemConfig.ts (as Record<string, unknown>)
organization api, react types.ts, dashboard useOrganizations.ts, cli core/admin.ts
authEvent AUTH_EVENT_TYPES hand-copied into the dashboard, already drifted from the api
oauth, webauthn, totp, stepUp api schemas vs react hand-written interfaces in createSeamlessAuthClient.ts
metrics api internalMetrics.responses.ts vs four dashboard hooks
me api me.response.ts, identical to the server's SeamlessUser
admin api admin schemas, dashboard types/user.ts, cli UserList / UserDetail / DeviceReplacementOptions

seamless-cli needed nothing new: every shared shape it hand-rolls now has a home here, and the rest of its types are genuinely CLI-local.

Changes to existing schemas

Per AGENTS.md, calling these out as potentially breaking for downstream consumers. All three widen rather than narrow at runtime, so a minor bump should cover it.

  • TransportSchema widened from usb | ble | nfc | internal to the full WebAuthn AuthenticatorTransportFuture set. The old enum rejected hybrid, which is what cross-device passkeys report. Tracked as a possible live bug in fells-code/seamless-auth-api.
  • CreateUserSchema / UpdateUserSchema accept a null phone (.nullish()), matching what the api already accepts.
  • OrganizationSchema timestamps are parsed as ISO dates rather than z.any().

AUTH_EVENT_TYPES is the union of the api and dashboard lists minus the bootstrap_admin_* entries, since that functionality has been removed. 74 entries.

Checks

npm run typecheck, npm run lint, npm run format:check, npm test (142 tests, 14 files), and npm run build all pass.

Pull the domain models and API contracts that were duplicated across
seamless-auth-api, -react, -server, -admin-dashboard, seamless-messaging,
and seamless-cli into this package.

New modules: common, role, messaging, systemConfig, oauth, webauthn, totp,
stepUp, organization, me, metrics, admin. Extended: user, credential,
session, authEvent, auth.

Notable duplication this replaces:

- scopedRoles was maintained separately in the api and the server
- the messaging message shapes existed in three places, two of them
  byte-identical files
- AUTH_EVENT_TYPES was hand-copied into the admin dashboard and had drifted

Changes to existing schemas that downstream consumers should review:

- TransportSchema widened to the full WebAuthn AuthenticatorTransportFuture
  set, so cross-device passkeys reporting "hybrid" now parse
- CreateUserSchema and UpdateUserSchema accept a null phone, matching what
  the api already accepts
- OrganizationSchema timestamps are parsed as ISO dates rather than z.any()
@Bccorb
Bccorb merged commit ca336fb into main Jul 29, 2026
1 check passed
@Bccorb
Bccorb deleted the feat/consolidate-ecosystem-schemas branch July 29, 2026 00:43
Bccorb added a commit that referenced this pull request Jul 29, 2026
#4 merged before its changeset landed, so the consolidation would have shipped
without a version bump or changelog entry. Carrying the changeset here, where
the tooling that consumes it is introduced.

Minor rather than major: the consolidation is additive, and the three changes
to existing schemas widen what they accept rather than narrowing it, so nothing
breaks at runtime. Each does change an inferred type, which the changeset
spells out.
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