|
1 | 1 | import { |
2 | | - DEFAULT_GITHUB_CACHE_TTL_SECONDS, |
3 | 2 | createCacheStore, |
4 | 3 | getCacheConfigFromEnv, |
5 | 4 | type CacheConfig, |
@@ -61,35 +60,6 @@ type PageInfo = { |
61 | 60 | endCursor: string | null; |
62 | 61 | }; |
63 | 62 |
|
64 | | -type FetchUserAndPullRequestsResponse = { |
65 | | - user: GitHubRawUser | null; |
66 | | - pullRequests: { |
67 | | - nodes: Array<PullRequestNode | null>; |
68 | | - pageInfo: PageInfo; |
69 | | - }; |
70 | | -}; |
71 | | - |
72 | | -type FetchPullRequestsPageResponse = { |
73 | | - pullRequests: { |
74 | | - nodes: Array<PullRequestNode | null>; |
75 | | - pageInfo: PageInfo; |
76 | | - }; |
77 | | -}; |
78 | | - |
79 | | -type FetchIssuesPageResponse = { |
80 | | - issues: { |
81 | | - nodes: Array<RawIssueNode | null>; |
82 | | - pageInfo: PageInfo; |
83 | | - }; |
84 | | -}; |
85 | | - |
86 | | -type FetchDiscussionsPageResponse = { |
87 | | - discussions: { |
88 | | - nodes: Array<RawDiscussionNode | null>; |
89 | | - pageInfo: PageInfo; |
90 | | - }; |
91 | | -}; |
92 | | - |
93 | 63 | type GitHubQueryExecutor = Pick<GitHubGraphQLClient, "execute">; |
94 | 64 |
|
95 | 65 | export type GitHubFetcherDependencies = { |
@@ -341,15 +311,6 @@ function isObject(value: unknown): value is Record<string, unknown> { |
341 | 311 | return typeof value === "object" && value !== null; |
342 | 312 | } |
343 | 313 |
|
344 | | -function isNumericRecord(value: unknown): value is Record<string, number> { |
345 | | - return ( |
346 | | - isObject(value) && |
347 | | - Object.values(value).every( |
348 | | - (item) => typeof item === "number" && Number.isFinite(item), |
349 | | - ) |
350 | | - ); |
351 | | -} |
352 | | - |
353 | 314 | function isGitHubUserData(value: unknown): value is GitHubUserData { |
354 | 315 | if (!isObject(value)) { |
355 | 316 | return false; |
@@ -759,14 +720,6 @@ function getStaleDays(): number { |
759 | 720 | return Number.isFinite(parsed) && parsed > 0 ? parsed : 14; |
760 | 721 | } |
761 | 722 |
|
762 | | -/** |
763 | | - * Fetch fresh user data from the GitHub API. |
764 | | - */ |
765 | | -async function fetchFromGitHubApi(username: string): Promise<GitHubUserData> { |
766 | | - const { data } = await fetchUserDataFromGitHub(executorSingleton, username); |
767 | | - return data; |
768 | | -} |
769 | | - |
770 | 723 | /** |
771 | 724 | * Unified function to get GitHub user data. |
772 | 725 | * |
|
0 commit comments