feat: introduce streamers that handle the stream and anonymization from github

This commit is contained in:
tdurieux
2024-04-03 11:13:01 +01:00
parent 73019c1b44
commit 4d12641c7e
64 changed files with 419 additions and 257 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Readable } from "stream";
import AnonymizedFile from "../AnonymizedFile";
import { Tree } from "../types";
import { SourceBase } from "./Source";
export interface GitHubBaseData {
getToken: () => string | Promise<string>;
repoId: string;
organization: string;
repoName: string;
commit: string;
}
export default abstract class GitHubBase implements SourceBase {
abstract type: "GitHubDownload" | "GitHubStream" | "Zip";
accessToken: string | undefined;
constructor(readonly data: GitHubBaseData) {}
abstract getFileContent(
file: AnonymizedFile,
progress?: (status: string) => void
): Promise<Readable>;
abstract getFiles(progress?: (status: string) => void): Promise<Tree>;
}