Skip to content

Dev#20

Open
shahar-brd wants to merge 4 commits intomainfrom
dev
Open

Dev#20
shahar-brd wants to merge 4 commits intomainfrom
dev

Conversation

@shahar-brd
Copy link
Copy Markdown
Collaborator

Introducing three entirely new services natively, fixes broken internal dataset tests, adds strong typing to dataset records, and thoroughly documents the SDK's architecture.

New Features & Services:

  • Discover API (client.discover() & client.discoverTrigger()):
    • Brings native AI-powered web search with intent-based relevance ranking.
    • Implemented DiscoverJob and DiscoverResult with a generalized pollUntilReady loop (configured for 'done' status).
    • Added Zod schemas for strict input and response validation.
  • Scraper Studio (client.scraperStudio):
    • Added native support for custom scrapers (DCA API).
    • Built a custom fetch-or-202 retry loop using a Deadline and transient NetworkError fallbacks (max 3 retries).
    • Added JobStatusResponseSchema with mixed-case field validation to normalize Bright Data API responses (Id/Status/Success_rate).
  • Browser API (client.browser.getConnectUrl()):
    • Synchronous URL builder for CDP WebSockets (for Playwright/Puppeteer integration).
    • Features lazy credential validation (fails on access, not construction), port validation (capped at 65535), and automatic encodeURIComponent parsing for special characters.

Datasets & Maintenance:

  • Dataset Probe Tests Fixed: Updated all 16 dataset probe test filters to use the correct structured format ({ name, operator, value }) expected by the /datasets/filter endpoint.
  • Dataset Typing: Created AmazonBestSellerRecord interface mapping all 44 API fields, serving as the baseline pattern for typing the remaining 125 dataset records.

Architecture & Documentation:

  • Architecture Docs: Added 15 behavioral traces across 6 categories (lifecycle, data transformation, error recovery, etc.) to map out the previously undocumented codebase.
  • Scoped Planning Docs: Added full architectural planning and critic traces for the new services to /docs/scoped (Tasks 3, 4, 5, and 6).
  • README Update: Added code examples for Discover API, Scraper Studio, and Browser API. Corrected dataset count (19 -> 126) and added Pinterest to the platforms list.

Testing & Validation:

  • Added 49 new unit tests (19 Discover, 20 Scraper Studio, 10 Browser).
  • Added 3 new Probe test scripts mirroring Python notebook scenarios (Discover, Scraper Studio, Browser API).
  • Validated all 16 dataset filters against the live API.

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