Initial commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
export interface Progress {
|
||||
current: number;
|
||||
total: number;
|
||||
status: string;
|
||||
metadata?: {
|
||||
sourceURL?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
currentDocumentUrl?: string;
|
||||
}
|
||||
|
||||
export class Document {
|
||||
id?: string;
|
||||
content: string;
|
||||
markdown?: string;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
type?: string;
|
||||
metadata: {
|
||||
sourceURL?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
childrenLinks?: string[];
|
||||
|
||||
constructor(data: Partial<Document>) {
|
||||
if (!data.content) {
|
||||
throw new Error("Missing required fields");
|
||||
}
|
||||
this.content = data.content;
|
||||
this.createdAt = data.createdAt || new Date();
|
||||
this.updatedAt = data.updatedAt || new Date();
|
||||
this.type = data.type || "unknown";
|
||||
this.metadata = data.metadata || { sourceURL: "" };
|
||||
this.markdown = data.markdown || "";
|
||||
this.childrenLinks = data.childrenLinks || undefined;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user