feat: consolidate shared ecosystem types and schemas - #4
Merged
Conversation
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()
This was referenced Jul 29, 2026
Closed
Closed
Closed
Replace the hand-copied types with @seamless-auth/types
fells-code/seamless-auth-admin-dashboard#197
Open
This was referenced Jul 29, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andseamless-cliinto 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
rolescopedRoles.ts, maintained separately in the api (src/lib/) and the server (packages/core/src/)messagingseamless-auth-messagingpackages/core/src/types.ts, serverpackages/core/src/authMessaging.ts, serverpackages/express/src/messaging.ts(the last two byte-identical)systemConfiguseSystemConfig.ts, clicore/systemConfig.ts(asRecord<string, unknown>)organizationtypes.ts, dashboarduseOrganizations.ts, clicore/admin.tsauthEventAUTH_EVENT_TYPEShand-copied into the dashboard, already drifted from the apioauth,webauthn,totp,stepUpcreateSeamlessAuthClient.tsmetricsinternalMetrics.responses.tsvs four dashboard hooksmeme.response.ts, identical to the server'sSeamlessUseradmintypes/user.ts, cliUserList/UserDetail/DeviceReplacementOptionsseamless-clineeded 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.
TransportSchemawidened fromusb | ble | nfc | internalto the full WebAuthnAuthenticatorTransportFutureset. The old enum rejectedhybrid, which is what cross-device passkeys report. Tracked as a possible live bug in fells-code/seamless-auth-api.CreateUserSchema/UpdateUserSchemaaccept a null phone (.nullish()), matching what the api already accepts.OrganizationSchematimestamps are parsed as ISO dates rather thanz.any().AUTH_EVENT_TYPESis the union of the api and dashboard lists minus thebootstrap_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), andnpm run buildall pass.