@mendable/firecrawl-js 0.0.29-beta.7 → 0.0.29
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/build/index.js +7 -7
- package/build_and_publish.sh +34 -0
- package/package.json +2 -8
package/build/index.js
CHANGED
|
@@ -31,9 +31,9 @@ export default class FirecrawlApp {
|
|
|
31
31
|
* @param {Params | null} params - Additional parameters for the scrape request.
|
|
32
32
|
* @returns {Promise<ScrapeResponse>} The response from the scrape operation.
|
|
33
33
|
*/
|
|
34
|
-
scrapeUrl(
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
scrapeUrl(url, params = null) {
|
|
35
|
+
var _a;
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
37
|
const headers = {
|
|
38
38
|
"Content-Type": "application/json",
|
|
39
39
|
Authorization: `Bearer ${this.apiKey}`,
|
|
@@ -74,8 +74,8 @@ export default class FirecrawlApp {
|
|
|
74
74
|
* @param {Params | null} params - Additional parameters for the search request.
|
|
75
75
|
* @returns {Promise<SearchResponse>} The response from the search operation.
|
|
76
76
|
*/
|
|
77
|
-
search(
|
|
78
|
-
return __awaiter(this,
|
|
77
|
+
search(query, params = null) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
const headers = {
|
|
80
80
|
"Content-Type": "application/json",
|
|
81
81
|
Authorization: `Bearer ${this.apiKey}`,
|
|
@@ -114,8 +114,8 @@ export default class FirecrawlApp {
|
|
|
114
114
|
* @param {string} idempotencyKey - Optional idempotency key for the request.
|
|
115
115
|
* @returns {Promise<CrawlResponse | any>} The response from the crawl operation.
|
|
116
116
|
*/
|
|
117
|
-
crawlUrl(
|
|
118
|
-
return __awaiter(this,
|
|
117
|
+
crawlUrl(url, params = null, waitUntilDone = true, pollInterval = 2, idempotencyKey) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
119
|
const headers = this.prepareHeaders(idempotencyKey);
|
|
120
120
|
let jsonData = { url };
|
|
121
121
|
if (params) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
function build_and_publish {
|
|
4
|
+
PACKAGE_NAME=$1
|
|
5
|
+
|
|
6
|
+
# Replace placeholder with the package name in package.json
|
|
7
|
+
sed -i '' "s/\"name\": \"PLACEHOLDER_NAME\"/\"name\": \"$PACKAGE_NAME\"/" package.json
|
|
8
|
+
|
|
9
|
+
# Debug: show modified state
|
|
10
|
+
echo "Modified package.json for $PACKAGE_NAME:"
|
|
11
|
+
cat package.json
|
|
12
|
+
|
|
13
|
+
# Publish the package using npm
|
|
14
|
+
npm publish
|
|
15
|
+
|
|
16
|
+
# Check if publish was successful
|
|
17
|
+
if [ $? -ne 0 ]; then
|
|
18
|
+
echo "Publish failed for $PACKAGE_NAME"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Revert the changes to the original placeholder in package.json
|
|
23
|
+
sed -i '' "s/\"name\": \"$PACKAGE_NAME\"/\"name\": \"PLACEHOLDER_NAME\"/" package.json
|
|
24
|
+
|
|
25
|
+
# Debug: show reverted state
|
|
26
|
+
echo "Reverted package.json to placeholder:"
|
|
27
|
+
cat package.json
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Build and publish the first package to npm
|
|
31
|
+
build_and_publish "@mendable/firecrawl-js"
|
|
32
|
+
|
|
33
|
+
# Build and publish the second package to npm
|
|
34
|
+
build_and_publish "firecrawl"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mendable/firecrawl-js",
|
|
3
|
-
"version": "0.0.29
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "JavaScript SDK for Firecrawl API",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -48,11 +48,5 @@
|
|
|
48
48
|
"scraper",
|
|
49
49
|
"api",
|
|
50
50
|
"sdk"
|
|
51
|
-
]
|
|
52
|
-
"exports": {
|
|
53
|
-
".": {
|
|
54
|
-
"import": "./build/index.js"
|
|
55
|
-
},
|
|
56
|
-
"./types": "./types/index.d.ts"
|
|
57
|
-
}
|
|
51
|
+
]
|
|
58
52
|
}
|