@mendable/firecrawl-js 0.0.16 → 0.0.17-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "0.0.16",
3
+ "version": "0.0.17-beta.1",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "build/index.js",
6
6
  "types": "types/index.d.ts",
@@ -8,6 +8,7 @@
8
8
  "scripts": {
9
9
  "build": "tsc",
10
10
  "publish": "npm run build && npm publish --access public",
11
+ "publish:beta": "npm run build && npm publish --access public --tag beta",
11
12
  "test": "jest src/**/*.test.ts"
12
13
  },
13
14
  "repository": {
package/src/index.ts CHANGED
@@ -19,7 +19,7 @@ export interface Params {
19
19
  */
20
20
  export interface ScrapeResponse {
21
21
  success: boolean;
22
- data?: any;
22
+ data?: Document;
23
23
  error?: string;
24
24
  }
25
25
 
@@ -28,7 +28,7 @@ export interface ScrapeResponse {
28
28
  */
29
29
  export interface SearchResponse {
30
30
  success: boolean;
31
- data?: any;
31
+ data?: Document[] | { url: string, title: string, description: string }[];
32
32
  error?: string;
33
33
  }
34
34
  /**
@@ -37,7 +37,7 @@ export interface SearchResponse {
37
37
  export interface CrawlResponse {
38
38
  success: boolean;
39
39
  jobId?: string;
40
- data?: any;
40
+ data?: Document[];
41
41
  error?: string;
42
42
  }
43
43
 
@@ -52,6 +52,27 @@ export interface JobStatusResponse {
52
52
  error?: string;
53
53
  }
54
54
 
55
+ /**
56
+ * Return type for scraping, crawling and search operations.
57
+ */
58
+ export interface Document{
59
+ id?: string;
60
+ content: string;
61
+ markdown?: string;
62
+ html?: string;
63
+ llm_extraction?: Record<string, any>;
64
+ createdAt?: Date;
65
+ updatedAt?: Date;
66
+ type?: string;
67
+ metadata: {
68
+ sourceURL?: string;
69
+ [key: string]: any;
70
+ };
71
+ childrenLinks?: string[];
72
+ provider?: string;
73
+ url?: string; // Used only in /search for now
74
+ }
75
+
55
76
  /**
56
77
  * Main class for interacting with the Firecrawl API.
57
78
  */
package/types/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export interface Params {
16
16
  */
17
17
  export interface ScrapeResponse {
18
18
  success: boolean;
19
- data?: any;
19
+ data?: Document;
20
20
  error?: string;
21
21
  }
22
22
  /**
@@ -24,7 +24,11 @@ export interface ScrapeResponse {
24
24
  */
25
25
  export interface SearchResponse {
26
26
  success: boolean;
27
- data?: any;
27
+ data?: Document[] | {
28
+ url: string;
29
+ title: string;
30
+ description: string;
31
+ }[];
28
32
  error?: string;
29
33
  }
30
34
  /**
@@ -33,7 +37,7 @@ export interface SearchResponse {
33
37
  export interface CrawlResponse {
34
38
  success: boolean;
35
39
  jobId?: string;
36
- data?: any;
40
+ data?: Document[];
37
41
  error?: string;
38
42
  }
39
43
  /**
@@ -46,6 +50,26 @@ export interface JobStatusResponse {
46
50
  data?: any;
47
51
  error?: string;
48
52
  }
53
+ /**
54
+ * Return type for scraping, crawling and search operations.
55
+ */
56
+ export interface Document {
57
+ id?: string;
58
+ content: string;
59
+ markdown?: string;
60
+ html?: string;
61
+ llm_extraction?: Record<string, any>;
62
+ createdAt?: Date;
63
+ updatedAt?: Date;
64
+ type?: string;
65
+ metadata: {
66
+ sourceURL?: string;
67
+ [key: string]: any;
68
+ };
69
+ childrenLinks?: string[];
70
+ provider?: string;
71
+ url?: string;
72
+ }
49
73
  /**
50
74
  * Main class for interacting with the Firecrawl API.
51
75
  */