feat: replace browser login with imported Reddit sessions

This commit is contained in:
jjbrunton committed 2026-08-08 16:48:59 +01:00
1 parent 2b0545afcf
commit c483c7b8be
76 files changed
+2048 -2828

No files matched your search

@@ -5,6 +5,7 @@ import {
SuccessfulExamplesResponseSchema,
} from '../../../../../packages/api-contracts/src/index.js';
import type { z } from 'zod';
import { createDashboardRequest } from '../../api/request.js';
type SubredditPerformanceResponse = z.infer<typeof SubredditPerformanceResponseSchema>;
type StrategyPerformanceResponse = z.infer<typeof StrategyPerformanceResponseSchema>;
@@ -39,9 +40,7 @@ export interface PerformanceApi {
export function createPerformanceApi(
fetchImplementation?: typeof fetch,
) {
function request(path: string): Promise<Response> {
return (fetchImplementation ?? globalThis.fetch)(path);
}
const request = createDashboardRequest(fetchImplementation);
return {
async getSubredditPerformance() {
return parseResponse(