Skip to content

feat: typed API responses + sync/async fix#10

Merged
VinciGit00 merged 2 commits intomainfrom
feat/typed-api-responses
Feb 17, 2026
Merged

feat: typed API responses + sync/async fix#10
VinciGit00 merged 2 commits intomainfrom
feat/typed-api-responses

Conversation

@FrancescoSaverioZuppichini
Copy link
Member

@FrancescoSaverioZuppichini FrancescoSaverioZuppichini commented Feb 17, 2026

Summary

  • Typed all API responses — replaced every ApiResult<unknown> with proper response types (SmartScraperResponse, SearchScraperResponse, MarkdownifyResponse, CrawlResponse, ScrapeResponse, AgenticScraperResponse, GenerateSchemaResponse, SitemapResponse, CreditsResponse, HealthResponse, HistoryResponse)
  • Fixed sync/async classification — only crawl actually needs polling. Switched smartScraper, searchScraper, markdownify, scrape, agenticScraper, generateSchema from submitAndPoll to direct request() calls
  • Removed unused onPoll params from all non-polling functions and their command callers
  • Cleaned internals — inlined getTimeoutMs(), extracted isDone() helper, simplified PollResponse type

Test plan

  • All 29 tests pass (bun test)
  • tsc --noEmit clean
  • Polling tests moved from smartScraper to crawl where they belong
  • Build passes (bun run build)

🤖 Generated with Claude Code

Replace ApiResult<unknown> with proper response types for all endpoints.
Only crawl uses polling now — all other endpoints are direct POST calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@VinciGit00 VinciGit00 merged commit c6af391 into main Feb 17, 2026
3 checks passed
@VinciGit00 VinciGit00 deleted the feat/typed-api-responses branch February 17, 2026 12:26
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.

2 participants