@mendable/firecrawl-js 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
- package/src/index.ts +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestHeaders, AxiosResponse } from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import * as zt from 'zod';
|
|
3
3
|
import { TypedEventTarget } from 'typescript-event-target';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -77,7 +77,7 @@ interface CrawlScrapeOptions {
|
|
|
77
77
|
waitFor?: number;
|
|
78
78
|
timeout?: number;
|
|
79
79
|
}
|
|
80
|
-
interface ScrapeParams<LLMSchema extends ZodSchema> extends CrawlScrapeOptions {
|
|
80
|
+
interface ScrapeParams<LLMSchema extends zt.ZodSchema> extends CrawlScrapeOptions {
|
|
81
81
|
extract?: {
|
|
82
82
|
prompt?: string;
|
|
83
83
|
schema?: LLMSchema;
|
|
@@ -177,7 +177,7 @@ declare class FirecrawlApp {
|
|
|
177
177
|
* @param params - Additional parameters for the scrape request.
|
|
178
178
|
* @returns The response from the scrape operation.
|
|
179
179
|
*/
|
|
180
|
-
scrapeUrl<T extends ZodSchema>(url: string, params?: ScrapeParams<T>): Promise<ScrapeResponse<infer<T>> | ErrorResponse>;
|
|
180
|
+
scrapeUrl<T extends zt.ZodSchema>(url: string, params?: ScrapeParams<T>): Promise<ScrapeResponse<zt.infer<T>> | ErrorResponse>;
|
|
181
181
|
/**
|
|
182
182
|
* This method is intended to search for a query using the Firecrawl API. However, it is not supported in version 1 of the API.
|
|
183
183
|
* @param query - The search query string.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestHeaders, AxiosResponse } from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import * as zt from 'zod';
|
|
3
3
|
import { TypedEventTarget } from 'typescript-event-target';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -77,7 +77,7 @@ interface CrawlScrapeOptions {
|
|
|
77
77
|
waitFor?: number;
|
|
78
78
|
timeout?: number;
|
|
79
79
|
}
|
|
80
|
-
interface ScrapeParams<LLMSchema extends ZodSchema> extends CrawlScrapeOptions {
|
|
80
|
+
interface ScrapeParams<LLMSchema extends zt.ZodSchema> extends CrawlScrapeOptions {
|
|
81
81
|
extract?: {
|
|
82
82
|
prompt?: string;
|
|
83
83
|
schema?: LLMSchema;
|
|
@@ -177,7 +177,7 @@ declare class FirecrawlApp {
|
|
|
177
177
|
* @param params - Additional parameters for the scrape request.
|
|
178
178
|
* @returns The response from the scrape operation.
|
|
179
179
|
*/
|
|
180
|
-
scrapeUrl<T extends ZodSchema>(url: string, params?: ScrapeParams<T>): Promise<ScrapeResponse<infer<T>> | ErrorResponse>;
|
|
180
|
+
scrapeUrl<T extends zt.ZodSchema>(url: string, params?: ScrapeParams<T>): Promise<ScrapeResponse<zt.infer<T>> | ErrorResponse>;
|
|
181
181
|
/**
|
|
182
182
|
* This method is intended to search for a query using the Firecrawl API. However, it is not supported in version 1 of the API.
|
|
183
183
|
* @param query - The search query string.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios, { type AxiosResponse, type AxiosRequestHeaders } from "axios";
|
|
2
|
-
import type
|
|
2
|
+
import type * as zt from "zod";
|
|
3
3
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
4
4
|
import { WebSocket } from "isows";
|
|
5
5
|
import { TypedEventTarget } from "typescript-event-target";
|
|
@@ -83,7 +83,7 @@ export interface CrawlScrapeOptions {
|
|
|
83
83
|
timeout?: number;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export interface ScrapeParams<LLMSchema extends ZodSchema> extends CrawlScrapeOptions {
|
|
86
|
+
export interface ScrapeParams<LLMSchema extends zt.ZodSchema> extends CrawlScrapeOptions {
|
|
87
87
|
extract?: {
|
|
88
88
|
prompt?: string;
|
|
89
89
|
schema?: LLMSchema;
|
|
@@ -200,10 +200,10 @@ export default class FirecrawlApp {
|
|
|
200
200
|
* @param params - Additional parameters for the scrape request.
|
|
201
201
|
* @returns The response from the scrape operation.
|
|
202
202
|
*/
|
|
203
|
-
async scrapeUrl<T extends ZodSchema>(
|
|
203
|
+
async scrapeUrl<T extends zt.ZodSchema>(
|
|
204
204
|
url: string,
|
|
205
205
|
params?: ScrapeParams<T>
|
|
206
|
-
): Promise<ScrapeResponse<
|
|
206
|
+
): Promise<ScrapeResponse<zt.infer<T>> | ErrorResponse> {
|
|
207
207
|
const headers: AxiosRequestHeaders = {
|
|
208
208
|
"Content-Type": "application/json",
|
|
209
209
|
Authorization: `Bearer ${this.apiKey}`,
|