fix!: prevent path traversal in FilenameSchema#25
Merged
Conversation
feat: trigger patch release
Removed development setup instructions and commit conventions.
Basename filenames before stripping reserved chars so "../" and absolute
paths can't escape cwd via saveResults / SnapshotAPI.download.
BREAKING CHANGE: filenames passed to saveResults and snapshot download
are now reduced to their final path segment. Callers relying on nested
subdirectory paths (e.g. "output/data.json") will now write to the
basename only ("data.json") in the working directory.
Adds the Bright Data Crawl API as a top-level service on bdclient,
mirroring brightdata.crawler from the Python SDK. Backed by the same
/datasets/v3/{scrape,trigger,progress,snapshot} endpoints already used
by the platform scrapers — dataset_id gd_m6gjtfmeh43we6cqc.
API surface:
- client.crawler.crawl(urls) — sync /scrape → CrawlResult
- client.crawler.trigger(urls) — async /trigger → ScrapeJob (CrawlJob alias)
- client.crawler.status(snapshotId) — GET /progress → status string
- client.crawler.download(snapshotId) — poll + fetch → CrawlResult
Design choices:
- CrawlResult is a new BaseResult subclass with pageCount + snapshotId,
matching the per-service Result pattern used by ScrapeResult,
SearchResult, and DiscoverResult.
- CrawlJob is a type alias for ScrapeJob — the snapshot-job wrapper is
already generic over SnapshotOperations, no fork needed.
- crawl() and download() never throw on HTTP/network errors, matching
the never-throws-on-orchestrated convention used by toResult().
Tests: 33 unit + 3 gated integration.
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.
Basename filenames before stripping reserved chars so "../" and absolute paths can't escape cwd via saveResults / SnapshotAPI.download.
BREAKING CHANGE: filenames passed to saveResults and snapshot download are now reduced to their final path segment. Callers relying on nested subdirectory paths (e.g. "output/data.json") will now write to the basename only ("data.json") in the working directory.