Skip to content

feat: convert lib/baseURL and API routes to TypeScript#58

Merged
mjdavidson merged 1 commit intomasterfrom
mattd/explore-ts-server
May 7, 2026
Merged

feat: convert lib/baseURL and API routes to TypeScript#58
mjdavidson merged 1 commit intomasterfrom
mattd/explore-ts-server

Conversation

@mjdavidson
Copy link
Copy Markdown
Contributor

5 server-side files migrated: lib/baseURL.ts and the 4 pages/api/* routes.

Picked up two latent SDK-v8 API renames the .js code was getting away with:

  • clientIDclientId
  • sso.getAuthorizationURLsso.getAuthorizationUrl

Also dropped domains: [...] from createOrganization — v8's CreateOrganizationOptions no longer accepts it. The throwaway demo orgs still work; visitors add domains via the Admin Portal UI.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explore Ready Ready Preview, Comment May 7, 2026 9:24pm

Request Review

Comment thread pages/api/callback.ts Fixed
5 files migrated server-side:
- lib/baseURL.js → lib/baseURL.ts (pure rename)
- pages/api/{admin-portal,sso,callback,magic-link}.js → .ts

Type-annotated handler signatures (NextApiRequest, NextApiResponse),
Organization type for the audit-log helper, narrowed catch errors via
`e instanceof Error`, and a runtime guard on req.query.code in the
callback (typed as string | string[] | undefined).

Picked up two latent SDK-v8 API renames that the .js code was getting
away with at runtime:
- clientID → clientId
- sso.getAuthorizationURL → sso.getAuthorizationUrl

Also dropped `domains: [...]` from createOrganization — v8's
CreateOrganizationOptions no longer accepts that field. The throwaway
demo org still works; visitors add domains through the Admin Portal UI
when needed.

Verified: typecheck (strict), lint, format:check, build all clean.
@mjdavidson mjdavidson force-pushed the mattd/explore-ts-server branch from 4c4e7a6 to 7ad383f Compare May 7, 2026 21:24
@mjdavidson mjdavidson merged commit 29a2d03 into master May 7, 2026
9 checks passed
@mjdavidson mjdavidson deleted the mattd/explore-ts-server branch May 7, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants