Skip to content

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
Copy link
Member

@jhiesey jhiesey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except we should tighten up the type on createRepository to match the code not the schema

visibility?: 'private' | 'public' | undefined
workspace?: string | undefined
}
| undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined shouldn't be allowed, and name should be required too. Yes the schema on the endpoint technically has everything optional, but it throws immediately if params.name is falsy

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