Nick: making it optional for the user

This commit is contained in:
Nicolas 2024-12-26 12:43:58 -03:00
parent 233f347f5e
commit 4332f18a8f
2 changed files with 3 additions and 2 deletions

View File

@ -199,6 +199,7 @@ export const extractV1Options = z
includeSubdomains: z.boolean().default(true),
allowExternalLinks: z.boolean().default(false),
origin: z.string().optional().default("api"),
urlTrace: z.boolean().default(false),
timeout: z.number().int().positive().finite().safe().default(60000),
})
.strict(strictMessage);

View File

@ -20,7 +20,7 @@ interface ExtractResult {
data?: any;
scrapeId: string;
warning?: string;
urlTrace: URLTrace[];
urlTrace?: URLTrace[];
error?: string;
}
@ -140,6 +140,6 @@ export async function performExtraction(options: ExtractServiceOptions): Promise
data: completions.extract ?? {},
scrapeId,
warning: completions.warning,
urlTrace: urlTraces,
urlTrace: request.urlTrace ? urlTraces : undefined,
};
}