refactor: move home query ID methods to mixin as private

Follow the pattern from twitter-client-timelines.ts where query ID
methods are private to the mixin that uses them, rather than protected
in the base class.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
George Zhang
2026-01-11 11:35:57 +00:00
committed by Peter Steinberger
co-authored by Claude Opus 4.5
parent 73b8cff1b2
commit 5bb9e48252
2 changed files with 10 additions and 10 deletions
-10
View File
@@ -67,16 +67,6 @@ export abstract class TwitterClientBase {
return Array.from(new Set([primary, 'M1jEez78PEfVfbQLvlWMvQ', '5h0kNbk3ii97rmfY6CdgAA', 'Tp1sewRU1AsZpBWhqCZicQ'])); return Array.from(new Set([primary, 'M1jEez78PEfVfbQLvlWMvQ', '5h0kNbk3ii97rmfY6CdgAA', 'Tp1sewRU1AsZpBWhqCZicQ']));
} }
protected async getHomeTimelineQueryIds(): Promise<string[]> {
const primary = await this.getQueryId('HomeTimeline');
return Array.from(new Set([primary, 'edseUwk9sP5Phz__9TIRnA']));
}
protected async getHomeLatestTimelineQueryIds(): Promise<string[]> {
const primary = await this.getQueryId('HomeLatestTimeline');
return Array.from(new Set([primary, 'iOEZpOdfekFsxSlPQCQtPg']));
}
protected async fetchWithTimeout(url: string, init: RequestInit): Promise<Response> { protected async fetchWithTimeout(url: string, init: RequestInit): Promise<Response> {
if (!this.timeoutMs || this.timeoutMs <= 0) { if (!this.timeoutMs || this.timeoutMs <= 0) {
return fetch(url, init); return fetch(url, init);
+10
View File
@@ -24,6 +24,16 @@ export function withHome<TBase extends AbstractConstructor<TwitterClientBase>>(
super(...args); super(...args);
} }
private async getHomeTimelineQueryIds(): Promise<string[]> {
const primary = await this.getQueryId('HomeTimeline');
return Array.from(new Set([primary, 'edseUwk9sP5Phz__9TIRnA']));
}
private async getHomeLatestTimelineQueryIds(): Promise<string[]> {
const primary = await this.getQueryId('HomeLatestTimeline');
return Array.from(new Set([primary, 'iOEZpOdfekFsxSlPQCQtPg']));
}
/** /**
* Get the authenticated user's "For You" home timeline * Get the authenticated user's "For You" home timeline
*/ */