♻️ uniformize with other sdks#470
Open
sebastianMindee wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to “uniformize with other SDKs” by tightening URL input handling (including redirect/auth behavior) and introducing a typed V2 job status enum that is re-exported through the V2 API surface.
Changes:
- Add URL validation and credential masking to
UrlInput, plus new tests for blocking loopback/private hosts. - Introduce
JobStatusenum and use it in V2 job polling logic. - Update exports and lockfile to align with the new public API surface and dependency metadata.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/input/urlInputSource.spec.ts | Adds tests for URL init validation (localhost/loopback/private ranges). |
| src/v2/parsing/job/jobStatus.ts | Introduces JobStatus enum for V2 job statuses. |
| src/v2/parsing/job/job.ts | Uses JobStatus for job status typing/parsing. |
| src/v2/parsing/job/index.ts | Re-exports JobStatus from the job module. |
| src/v2/parsing/index.ts | Re-exports JobStatus from parsing index. |
| src/v2/index.ts | Re-exports JobStatus in the public V2 API. |
| src/v2/client.ts | Compares polling job status against JobStatus enum values. |
| src/input/urlInput.ts | Adds URL validation, credential masking, and auth header handling; validates redirects. |
| package-lock.json | Lockfile metadata normalization (removes libc fields for some optional deps). |
Comments suppressed due to low confidence (1)
src/input/urlInput.ts:174
- UrlInput URL validation is only performed in init(). Callers can bypass the HTTPS/host checks by calling asLocalInputSource()/saveToFile() directly, since makeRequest() currently performs no validation on its url parameter.
redirects: number,
maxRedirects: number
): Promise<{ content: Buffer; finalUrl: string }> {
const parsedUrl = new URL(url);
d469614 to
ab49b90
Compare
ab49b90 to
07f3d44
Compare
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.
Description
Types of changes