feat(core): gitea read client behind an injected fetch (#1)
createGiteaClient(config, fetchImpl).getIssue(index) fetches one issue and normalizes raw gitea JSON to a typed GiteaIssue with scheduler facts precomputed via extractLabelFacts. Network is an injected FetchLike (core has no DOM lib; global fetch is structurally assignable), so it unit-tests against a stub — no live calls in the suite. Non-2xx responses throw GiteaApiError carrying status + body. Closes P1-1. Verified end-to-end against the live repo's issue #9. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,3 +8,15 @@ export {
|
||||
parsePriorityLabel,
|
||||
} from './labels/label-schema.js'
|
||||
export type { EstimateLabel, LabelFacts, PriorityLabel } from './labels/label-schema.js'
|
||||
|
||||
export { createGiteaClient, normalizeIssue } from './gitea/client.js'
|
||||
export type { GiteaClient } from './gitea/client.js'
|
||||
export { GiteaApiError } from './gitea/types.js'
|
||||
export type {
|
||||
FetchLike,
|
||||
GiteaConfig,
|
||||
GiteaHttpResponse,
|
||||
GiteaIssue,
|
||||
GiteaMilestoneRef,
|
||||
GiteaRequestInit,
|
||||
} from './gitea/types.js'
|
||||
|
||||
Reference in New Issue
Block a user