@mendable/firecrawl 1.21.1 → 1.22.0

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 CHANGED
@@ -38,8 +38,15 @@ module.exports = __toCommonJS(src_exports);
38
38
  var import_axios = __toESM(require("axios"), 1);
39
39
  var zt = __toESM(require("zod"), 1);
40
40
  var import_zod_to_json_schema = require("zod-to-json-schema");
41
- var import_isows = require("isows");
42
- var import_typescript_event_target = require("typescript-event-target");
41
+
42
+ // node_modules/typescript-event-target/dist/index.mjs
43
+ var e = class extends EventTarget {
44
+ dispatchTypedEvent(s, t) {
45
+ return super.dispatchEvent(t);
46
+ }
47
+ };
48
+
49
+ // src/index.ts
43
50
  var FirecrawlError = class extends Error {
44
51
  statusCode;
45
52
  details;
@@ -1192,7 +1199,7 @@ var FirecrawlApp = class {
1192
1199
  return { success: false, error: "Internal server error." };
1193
1200
  }
1194
1201
  };
1195
- var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget {
1202
+ var CrawlWatcher = class extends e {
1196
1203
  ws;
1197
1204
  data;
1198
1205
  status;
@@ -1201,7 +1208,7 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
1201
1208
  super();
1202
1209
  this.id = id;
1203
1210
  const wsUrl = app.apiUrl.replace(/^http/, "ws");
1204
- this.ws = new import_isows.WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
1211
+ this.ws = new WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
1205
1212
  this.status = "scraping";
1206
1213
  this.data = [];
1207
1214
  const messageHandler = (msg) => {
package/dist/index.js CHANGED
@@ -2,8 +2,15 @@
2
2
  import axios, { AxiosError } from "axios";
3
3
  import * as zt from "zod";
4
4
  import { zodToJsonSchema } from "zod-to-json-schema";
5
- import { WebSocket } from "isows";
6
- import { TypedEventTarget } from "typescript-event-target";
5
+
6
+ // node_modules/typescript-event-target/dist/index.mjs
7
+ var e = class extends EventTarget {
8
+ dispatchTypedEvent(s, t) {
9
+ return super.dispatchEvent(t);
10
+ }
11
+ };
12
+
13
+ // src/index.ts
7
14
  var FirecrawlError = class extends Error {
8
15
  statusCode;
9
16
  details;
@@ -1156,7 +1163,7 @@ var FirecrawlApp = class {
1156
1163
  return { success: false, error: "Internal server error." };
1157
1164
  }
1158
1165
  };
1159
- var CrawlWatcher = class extends TypedEventTarget {
1166
+ var CrawlWatcher = class extends e {
1160
1167
  ws;
1161
1168
  data;
1162
1169
  status;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl",
3
- "version": "1.21.1",
3
+ "version": "1.22.0",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,6 @@
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
28
  "axios": "^1.6.8",
29
- "isows": "^1.0.4",
30
29
  "typescript-event-target": "^1.1.1",
31
30
  "zod": "^3.23.8",
32
31
  "zod-to-json-schema": "^3.23.0"
@@ -36,8 +35,6 @@
36
35
  },
37
36
  "homepage": "https://github.com/mendableai/firecrawl#readme",
38
37
  "devDependencies": {
39
- "uuid": "^9.0.1",
40
- "dotenv": "^16.4.5",
41
38
  "@jest/globals": "^29.7.0",
42
39
  "@types/axios": "^0.14.0",
43
40
  "@types/dotenv": "^8.2.0",
@@ -45,10 +42,12 @@
45
42
  "@types/mocha": "^10.0.6",
46
43
  "@types/node": "^20.12.12",
47
44
  "@types/uuid": "^9.0.8",
45
+ "dotenv": "^16.4.5",
48
46
  "jest": "^29.7.0",
49
47
  "ts-jest": "^29.2.2",
50
48
  "tsup": "^8.2.4",
51
- "typescript": "^5.4.5"
49
+ "typescript": "^5.4.5",
50
+ "uuid": "^9.0.1"
52
51
  },
53
52
  "keywords": [
54
53
  "firecrawl",
@@ -58,5 +57,8 @@
58
57
  "scraper",
59
58
  "api",
60
59
  "sdk"
61
- ]
60
+ ],
61
+ "engines": {
62
+ "node": ">=22.0.0"
63
+ }
62
64
  }
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import axios, { type AxiosResponse, type AxiosRequestHeaders, AxiosError } from "axios";
2
2
  import * as zt from "zod";
3
3
  import { zodToJsonSchema } from "zod-to-json-schema";
4
- import { WebSocket } from "isows";
5
4
  import { TypedEventTarget } from "typescript-event-target";
6
5
 
7
6
  /**
package/tsup.config.ts CHANGED
@@ -6,4 +6,13 @@ export default defineConfig({
6
6
  dts: true,
7
7
  outDir: "dist",
8
8
  clean: true,
9
+ platform: "node",
10
+ target: "node22",
11
+ noExternal: ["typescript-event-target"],
12
+ esbuildOptions(options) {
13
+ options.define = {
14
+ ...options.define,
15
+ "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || "production"),
16
+ };
17
+ },
9
18
  });