feat: replace browser login with imported Reddit sessions
This commit is contained in:
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(
|
||||
|
||||
Reference in new issue
Block a user