Skip to content

feat(adapter-github): extract canonical GitHub REST operation builders + request types#25

Merged
khaliqgant merged 4 commits intomainfrom
feat/github-operations-module
Apr 26, 2026
Merged

feat(adapter-github): extract canonical GitHub REST operation builders + request types#25
khaliqgant merged 4 commits intomainfrom
feat/github-operations-module

Conversation

@kjgbot
Copy link
Copy Markdown
Contributor

@kjgbot kjgbot commented Apr 26, 2026

Summary

First of three extract PRs for relayfile-adapters#24. Adds canonical GitHub REST operation builders + request types under .

Bump: @relayfile/adapter-github minor → 0.2.0.

What changed

  • New packages/github/src/operations.ts with canonical REST operation builders for issues, pull requests, comments, releases, repository lookup, org listing, and repo listing.
  • Re-exported from packages/github/src/index.ts.
  • Tests in packages/github/src/operations.test.ts covering paths, query parameters, path encoding, pagination, and undefined-query omission.

Sources

Live verification

Representative operations in this PR were sent through the real Nango proxy using sage NANGO_SECRET_KEY, with the connection ID dynamically discovered via nango.listConnections(). Operations returned non-error responses. This catches endpoint/scope drift at extract time.

Follow-up PRs

After this PR merges and @relayfile/adapter-github@0.2.0 republishes:

  • cloud refactor: import shared operations, drop local copies in route.ts + apifallback
  • sage refactor: same for nango-integrations/github-sage/syncs/*

Validation

  • npm test --workspace @relayfile/adapter-github green
  • tsc -p packages/github/tsconfig.json --noEmit clean
  • Live Nango proxy verification passed for representative operations
  • Self-reviewed against Nango + cloud + sage consumers (UNION of endpoint shapes)
  • Peer-reviewed by Claude Opus

🤖 Generated with Claude Code

RelayFile Adapters Bot and others added 4 commits April 26, 2026 20:42
…s + request types

Tracks relayfile-adapters#24 — one canonical home for GitHub API knowledge
so cloud route.ts, cloud apifallback, and sage nango-integrations syncs
all consume the same operations instead of holding duplicate REST path builders.

New exports under @relayfile/adapter-github:
  - Operation builders: listIssues, listPullRequests, listComments, listReleases
  - Repository helpers: getRepository, listOrgs, listRepos
  - Request/operation types: GitHubOperation, GitHubRepoRef, pagination and input interfaces

Endpoint and query-parameter shapes are the UNION of what Nango, cloud, and sage consumers need. Validated
against:
  1. Nango integration-templates for GitHub (canonical baseline)
  2. sage nango-integrations/github-sage/syncs/*.ts (production-proven)
  3. cloud packages/web/app/api/v1/github/query/route.ts + apifallback (consumers)

Live verification:
  Representative operations were sent through the real Nango proxy using sage NANGO_SECRET_KEY,
  with connection IDs dynamically discovered via nango.listConnections(). Operations
  returned non-error responses. Catches endpoint/scope drift at extract time
  so we never publish an operation builder that fails in production.

Version: minor bump (additive — new exports, no breaking changes).

Follow-up PRs (tracked in relayfile-adapters#24):
  - cloud refactor: import from @relayfile/adapter-github, drop local copies
  - sage refactor: same for nango-integrations/github-sage/syncs/*

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 36c8d43 into main Apr 26, 2026
1 check passed
@khaliqgant khaliqgant deleted the feat/github-operations-module branch April 26, 2026 22:02
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