Skip to content

fix(sdk): correct endpoints and improve type safety#478

Open
jdalton wants to merge 1 commit intomainfrom
fix/sdk-endpoint-types
Open

fix(sdk): correct endpoints and improve type safety#478
jdalton wants to merge 1 commit intomainfrom
fix/sdk-endpoint-types

Conversation

@jdalton
Copy link
Contributor

@jdalton jdalton commented Feb 6, 2026

Fixes five SDK bugs with incorrect endpoints and weak typing:

Changes

Endpoint Fixes

  • createOrgDiffScanFromIds: Fixed endpoint URL /diff-scans/diff-scans/from-ids
  • getDiffScanGfm: Added missing method for /orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm
  • getSupportedFiles: Added missing non-deprecated method for /orgs/{org_slug}/supported-files

Type Improvements

  • createOrgDiffScanFromIds: Replaced QueryParams with typed options (after, before, description, external_href, merge)
  • createRepository: Replaced QueryParams with specific typed fields (name, description, homepage, visibility, archived, default_branch, workspace)
  • RepositoryItem: Split into RepositoryListItem (for list endpoint) and RepositoryItem (for get endpoint) to remove fields only available on get (integration_meta, slig)

Testing

  • Added 5 new unit tests covering new methods and updated signatures
  • All 484 tests passing

- Fix createOrgDiffScanFromIds endpoint URL (/diff-scans → /diff-scans/from-ids)
  and replace QueryParams with properly typed options (after, before, description, external_href, merge)
- Add getDiffScanGfm method for /orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm endpoint
- Add getSupportedFiles method for /orgs/{org_slug}/supported-files endpoint (non-deprecated)
- Fix createRepository options type with specific fields instead of generic QueryParams
- Split RepositoryItem type: RepositoryListItem (for list endpoint) and RepositoryItem (for get endpoint)
  to remove integration_meta and slig from list results where they're not available
- Add unit tests for all new methods and updated signatures
@jdalton jdalton requested a review from jhiesey February 6, 2026 23:49
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.

1 participant