@mendable/firecrawl-js 1.18.0-beta.2 → 1.18.0-beta.3
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 +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -870,13 +870,13 @@ var FirecrawlApp = class {
|
|
|
870
870
|
if ("error" in researchStatus && !researchStatus.success) {
|
|
871
871
|
return researchStatus;
|
|
872
872
|
}
|
|
873
|
-
if (researchStatus.status === "completed") {
|
|
873
|
+
if (researchStatus.status === "completed" && researchStatus.data) {
|
|
874
874
|
return researchStatus;
|
|
875
875
|
} else if (researchStatus.status === "failed") {
|
|
876
876
|
throw new FirecrawlError(`Research job failed. Error: ${researchStatus.error}`, 500);
|
|
877
877
|
}
|
|
878
878
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
879
|
-
} while (researchStatus.status === "processing");
|
|
879
|
+
} while (researchStatus.status === "processing" || researchStatus.status === "completed");
|
|
880
880
|
}
|
|
881
881
|
throw new FirecrawlError(`Failed to start research. No job ID returned.`, 500);
|
|
882
882
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -834,13 +834,13 @@ var FirecrawlApp = class {
|
|
|
834
834
|
if ("error" in researchStatus && !researchStatus.success) {
|
|
835
835
|
return researchStatus;
|
|
836
836
|
}
|
|
837
|
-
if (researchStatus.status === "completed") {
|
|
837
|
+
if (researchStatus.status === "completed" && researchStatus.data) {
|
|
838
838
|
return researchStatus;
|
|
839
839
|
} else if (researchStatus.status === "failed") {
|
|
840
840
|
throw new FirecrawlError(`Research job failed. Error: ${researchStatus.error}`, 500);
|
|
841
841
|
}
|
|
842
842
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
843
|
-
} while (researchStatus.status === "processing");
|
|
843
|
+
} while (researchStatus.status === "processing" || researchStatus.status === "completed");
|
|
844
844
|
}
|
|
845
845
|
throw new FirecrawlError(`Failed to start research. No job ID returned.`, 500);
|
|
846
846
|
} catch (error) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1372,13 +1372,13 @@ export default class FirecrawlApp {
|
|
|
1372
1372
|
return researchStatus;
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
|
-
if (researchStatus.status === "completed") {
|
|
1375
|
+
if (researchStatus.status === "completed" && researchStatus.data) {
|
|
1376
1376
|
return researchStatus;
|
|
1377
1377
|
} else if (researchStatus.status === "failed") {
|
|
1378
1378
|
throw new FirecrawlError(`Research job failed. Error: ${researchStatus.error}`, 500);
|
|
1379
1379
|
}
|
|
1380
1380
|
await new Promise(resolve => setTimeout(resolve, 1000)); // Polling interval
|
|
1381
|
-
} while (researchStatus.status === "processing");
|
|
1381
|
+
} while (researchStatus.status === "processing" || researchStatus.status === "completed");
|
|
1382
1382
|
}
|
|
1383
1383
|
throw new FirecrawlError(`Failed to start research. No job ID returned.`, 500);
|
|
1384
1384
|
} catch (error: any) {
|