This commit is contained in:
Nicolas
2024-08-26 17:13:00 -03:00
parent b0bd71a3a9
commit 6f68678b5d
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -28,6 +28,7 @@ export async function mapController(
req.body = mapRequestSchema.parse(req.body); req.body = mapRequestSchema.parse(req.body);
const limit = req.body.limit; const limit = req.body.limit;
const id = uuidv4(); const id = uuidv4();
let links: string[] = [req.body.url]; let links: string[] = [req.body.url];
+2 -1
View File
@@ -27,6 +27,7 @@ const url = z.preprocess(
.string() .string()
.url() .url()
.regex(/^https?:\/\//, "URL uses unsupported protocol") .regex(/^https?:\/\//, "URL uses unsupported protocol")
.regex(/\.[a-z]{2,}$/i, "URL must have a valid top-level domain")
.refine( .refine(
(x) => !isUrlBlocked(x), (x) => !isUrlBlocked(x),
"Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it." "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it."
@@ -121,7 +122,7 @@ export const mapRequestSchema = crawlerOptions.extend({
includeSubdomains: z.boolean().default(true), includeSubdomains: z.boolean().default(true),
search: z.string().optional(), search: z.string().optional(),
ignoreSitemap: z.boolean().default(false), ignoreSitemap: z.boolean().default(false),
limit: z.number().min(1).max(50).default(5000), limit: z.number().min(1).max(50).default(5000).optional(),
}).strict(strictMessage); }).strict(strictMessage);
// export type MapRequest = { // export type MapRequest = {