@mendable/firecrawl 1.19.1 → 1.19.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.cjs +6 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -1
- package/package.json +1 -1
- package/src/index.ts +7 -1
package/dist/index.cjs
CHANGED
|
@@ -788,12 +788,14 @@ var FirecrawlApp = class {
|
|
|
788
788
|
*/
|
|
789
789
|
async monitorJobStatus(id, headers, checkInterval) {
|
|
790
790
|
try {
|
|
791
|
+
let failedTries = 0;
|
|
791
792
|
while (true) {
|
|
792
793
|
let statusResponse = await this.getRequest(
|
|
793
794
|
`${this.apiUrl}/v1/crawl/${id}`,
|
|
794
795
|
headers
|
|
795
796
|
);
|
|
796
797
|
if (statusResponse.status === 200) {
|
|
798
|
+
failedTries = 0;
|
|
797
799
|
let statusData = statusResponse.data;
|
|
798
800
|
if (statusData.status === "completed") {
|
|
799
801
|
if ("data" in statusData) {
|
|
@@ -823,7 +825,10 @@ var FirecrawlApp = class {
|
|
|
823
825
|
);
|
|
824
826
|
}
|
|
825
827
|
} else {
|
|
826
|
-
|
|
828
|
+
failedTries++;
|
|
829
|
+
if (failedTries >= 3) {
|
|
830
|
+
this.handleError(statusResponse, "check crawl status");
|
|
831
|
+
}
|
|
827
832
|
}
|
|
828
833
|
}
|
|
829
834
|
} catch (error) {
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -752,12 +752,14 @@ var FirecrawlApp = class {
|
|
|
752
752
|
*/
|
|
753
753
|
async monitorJobStatus(id, headers, checkInterval) {
|
|
754
754
|
try {
|
|
755
|
+
let failedTries = 0;
|
|
755
756
|
while (true) {
|
|
756
757
|
let statusResponse = await this.getRequest(
|
|
757
758
|
`${this.apiUrl}/v1/crawl/${id}`,
|
|
758
759
|
headers
|
|
759
760
|
);
|
|
760
761
|
if (statusResponse.status === 200) {
|
|
762
|
+
failedTries = 0;
|
|
761
763
|
let statusData = statusResponse.data;
|
|
762
764
|
if (statusData.status === "completed") {
|
|
763
765
|
if ("data" in statusData) {
|
|
@@ -787,7 +789,10 @@ var FirecrawlApp = class {
|
|
|
787
789
|
);
|
|
788
790
|
}
|
|
789
791
|
} else {
|
|
790
|
-
|
|
792
|
+
failedTries++;
|
|
793
|
+
if (failedTries >= 3) {
|
|
794
|
+
this.handleError(statusResponse, "check crawl status");
|
|
795
|
+
}
|
|
791
796
|
}
|
|
792
797
|
}
|
|
793
798
|
} catch (error) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -160,6 +160,7 @@ export interface CrawlParams {
|
|
|
160
160
|
includePaths?: string[];
|
|
161
161
|
excludePaths?: string[];
|
|
162
162
|
maxDepth?: number;
|
|
163
|
+
maxDiscoveryDepth?: number;
|
|
163
164
|
limit?: number;
|
|
164
165
|
allowBackwardLinks?: boolean;
|
|
165
166
|
allowExternalLinks?: boolean;
|
|
@@ -1331,12 +1332,14 @@ export default class FirecrawlApp {
|
|
|
1331
1332
|
checkInterval: number
|
|
1332
1333
|
): Promise<CrawlStatusResponse | ErrorResponse> {
|
|
1333
1334
|
try {
|
|
1335
|
+
let failedTries = 0;
|
|
1334
1336
|
while (true) {
|
|
1335
1337
|
let statusResponse: AxiosResponse = await this.getRequest(
|
|
1336
1338
|
`${this.apiUrl}/v1/crawl/${id}`,
|
|
1337
1339
|
headers
|
|
1338
1340
|
);
|
|
1339
1341
|
if (statusResponse.status === 200) {
|
|
1342
|
+
failedTries = 0;
|
|
1340
1343
|
let statusData = statusResponse.data;
|
|
1341
1344
|
if (statusData.status === "completed") {
|
|
1342
1345
|
if ("data" in statusData) {
|
|
@@ -1368,7 +1371,10 @@ export default class FirecrawlApp {
|
|
|
1368
1371
|
);
|
|
1369
1372
|
}
|
|
1370
1373
|
} else {
|
|
1371
|
-
|
|
1374
|
+
failedTries++;
|
|
1375
|
+
if (failedTries >= 3) {
|
|
1376
|
+
this.handleError(statusResponse, "check crawl status");
|
|
1377
|
+
}
|
|
1372
1378
|
}
|
|
1373
1379
|
}
|
|
1374
1380
|
} catch (error: any) {
|