@mendable/firecrawl-js 4.13.0-beta.2 → 4.13.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/{chunk-VEC6CWSH.js → chunk-22A4MB4F.js} +1 -1
- package/dist/index.cjs +15 -14
- package/dist/index.d.cts +18 -10
- package/dist/index.d.ts +18 -10
- package/dist/index.js +14 -13
- package/dist/{package-BBT366VN.js → package-5SIMNZMX.js} +1 -1
- package/package.json +1 -1
- package/src/v2/client.ts +4 -4
- package/src/v2/methods/browser.ts +8 -6
- package/src/v2/types.ts +7 -0
- package/dump.rdb +0 -0
|
@@ -8,7 +8,7 @@ var require_package = __commonJS({
|
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
10
|
name: "@mendable/firecrawl-js",
|
|
11
|
-
version: "4.13.0
|
|
11
|
+
version: "4.13.0",
|
|
12
12
|
description: "JavaScript SDK for Firecrawl API",
|
|
13
13
|
main: "dist/index.js",
|
|
14
14
|
types: "dist/index.d.ts",
|
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var require_package = __commonJS({
|
|
|
35
35
|
"package.json"(exports2, module2) {
|
|
36
36
|
module2.exports = {
|
|
37
37
|
name: "@mendable/firecrawl-js",
|
|
38
|
-
version: "4.13.0
|
|
38
|
+
version: "4.13.0",
|
|
39
39
|
description: "JavaScript SDK for Firecrawl API",
|
|
40
40
|
main: "dist/index.js",
|
|
41
41
|
types: "dist/index.d.ts",
|
|
@@ -106,17 +106,17 @@ var require_package = __commonJS({
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
// src/index.ts
|
|
109
|
-
var
|
|
110
|
-
__export(
|
|
109
|
+
var index_exports = {};
|
|
110
|
+
__export(index_exports, {
|
|
111
111
|
Firecrawl: () => Firecrawl,
|
|
112
112
|
FirecrawlAppV1: () => FirecrawlApp,
|
|
113
113
|
FirecrawlClient: () => FirecrawlClient,
|
|
114
114
|
JobTimeoutError: () => JobTimeoutError,
|
|
115
115
|
SdkError: () => SdkError,
|
|
116
116
|
Watcher: () => Watcher,
|
|
117
|
-
default: () =>
|
|
117
|
+
default: () => index_default
|
|
118
118
|
});
|
|
119
|
-
module.exports = __toCommonJS(
|
|
119
|
+
module.exports = __toCommonJS(index_exports);
|
|
120
120
|
|
|
121
121
|
// src/v2/utils/httpClient.ts
|
|
122
122
|
var import_axios = __toESM(require("axios"), 1);
|
|
@@ -931,8 +931,8 @@ async function cancelAgent(http, jobId) {
|
|
|
931
931
|
// src/v2/methods/browser.ts
|
|
932
932
|
async function browser(http, args = {}) {
|
|
933
933
|
const body = {};
|
|
934
|
-
if (args.
|
|
935
|
-
if (args.
|
|
934
|
+
if (args.ttl != null) body.ttl = args.ttl;
|
|
935
|
+
if (args.activityTtl != null) body.activityTtl = args.activityTtl;
|
|
936
936
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
937
937
|
try {
|
|
938
938
|
const res = await http.post("/v2/browser", body);
|
|
@@ -946,8 +946,9 @@ async function browser(http, args = {}) {
|
|
|
946
946
|
async function browserExecute(http, sessionId, args) {
|
|
947
947
|
const body = {
|
|
948
948
|
code: args.code,
|
|
949
|
-
language: args.language ?? "
|
|
949
|
+
language: args.language ?? "bash"
|
|
950
950
|
};
|
|
951
|
+
if (args.timeout != null) body.timeout = args.timeout;
|
|
951
952
|
try {
|
|
952
953
|
const res = await http.post(
|
|
953
954
|
`/v2/browser/${sessionId}/execute`,
|
|
@@ -1481,8 +1482,8 @@ var FirecrawlClient = class {
|
|
|
1481
1482
|
// Browser
|
|
1482
1483
|
/**
|
|
1483
1484
|
* Create a new browser session.
|
|
1484
|
-
* @param args Session options (
|
|
1485
|
-
* @returns Session id and
|
|
1485
|
+
* @param args Session options (ttl, activityTtl, streamWebView).
|
|
1486
|
+
* @returns Session id, CDP URL, live view URL, and expiration time.
|
|
1486
1487
|
*/
|
|
1487
1488
|
async browser(args = {}) {
|
|
1488
1489
|
return browser(this.http, args);
|
|
@@ -1490,8 +1491,8 @@ var FirecrawlClient = class {
|
|
|
1490
1491
|
/**
|
|
1491
1492
|
* Execute code in a browser session.
|
|
1492
1493
|
* @param sessionId Browser session id.
|
|
1493
|
-
* @param args Code and
|
|
1494
|
-
* @returns Execution result.
|
|
1494
|
+
* @param args Code, language ("python" | "node" | "bash"), and optional timeout.
|
|
1495
|
+
* @returns Execution result including stdout, stderr, exitCode, and killed status.
|
|
1495
1496
|
*/
|
|
1496
1497
|
async browserExecute(sessionId, args) {
|
|
1497
1498
|
return browserExecute(this.http, sessionId, args);
|
|
@@ -1551,7 +1552,7 @@ var FirecrawlClient = class {
|
|
|
1551
1552
|
var import_axios3 = __toESM(require("axios"), 1);
|
|
1552
1553
|
var zt2 = require("zod");
|
|
1553
1554
|
|
|
1554
|
-
// node_modules/typescript-event-target/dist/index.mjs
|
|
1555
|
+
// node_modules/.pnpm/typescript-event-target@1.1.1/node_modules/typescript-event-target/dist/index.mjs
|
|
1555
1556
|
var e = class extends EventTarget {
|
|
1556
1557
|
dispatchTypedEvent(s, t) {
|
|
1557
1558
|
return super.dispatchEvent(t);
|
|
@@ -2951,7 +2952,7 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2951
2952
|
return this._v1;
|
|
2952
2953
|
}
|
|
2953
2954
|
};
|
|
2954
|
-
var
|
|
2955
|
+
var index_default = Firecrawl;
|
|
2955
2956
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2956
2957
|
0 && (module.exports = {
|
|
2957
2958
|
Firecrawl,
|
package/dist/index.d.cts
CHANGED
|
@@ -559,15 +559,22 @@ interface BrowserCreateResponse {
|
|
|
559
559
|
id?: string;
|
|
560
560
|
cdpUrl?: string;
|
|
561
561
|
liveViewUrl?: string;
|
|
562
|
+
expiresAt?: string;
|
|
562
563
|
error?: string;
|
|
563
564
|
}
|
|
564
565
|
interface BrowserExecuteResponse {
|
|
565
566
|
success: boolean;
|
|
567
|
+
stdout?: string;
|
|
566
568
|
result?: string;
|
|
569
|
+
stderr?: string;
|
|
570
|
+
exitCode?: number;
|
|
571
|
+
killed?: boolean;
|
|
567
572
|
error?: string;
|
|
568
573
|
}
|
|
569
574
|
interface BrowserDeleteResponse {
|
|
570
575
|
success: boolean;
|
|
576
|
+
sessionDurationMs?: number;
|
|
577
|
+
creditsBilled?: number;
|
|
571
578
|
error?: string;
|
|
572
579
|
}
|
|
573
580
|
interface BrowserSession {
|
|
@@ -603,9 +610,9 @@ declare class HttpClient {
|
|
|
603
610
|
getApiKey(): string;
|
|
604
611
|
private request;
|
|
605
612
|
private sleep;
|
|
606
|
-
post<T = any>(endpoint: string, body: Record<string, unknown>, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
607
|
-
get<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
608
|
-
delete<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
613
|
+
post<T = any>(endpoint: string, body: Record<string, unknown>, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
614
|
+
get<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
615
|
+
delete<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
609
616
|
prepareHeaders(idempotencyKey?: string): Record<string, string>;
|
|
610
617
|
}
|
|
611
618
|
|
|
@@ -637,13 +644,14 @@ declare function prepareAgentPayload(args: {
|
|
|
637
644
|
declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
|
|
638
645
|
|
|
639
646
|
declare function browser(http: HttpClient, args?: {
|
|
640
|
-
|
|
641
|
-
|
|
647
|
+
ttl?: number;
|
|
648
|
+
activityTtl?: number;
|
|
642
649
|
streamWebView?: boolean;
|
|
643
650
|
}): Promise<BrowserCreateResponse>;
|
|
644
651
|
declare function browserExecute(http: HttpClient, sessionId: string, args: {
|
|
645
652
|
code: string;
|
|
646
|
-
language?: "python" | "
|
|
653
|
+
language?: "python" | "node" | "bash";
|
|
654
|
+
timeout?: number;
|
|
647
655
|
}): Promise<BrowserExecuteResponse>;
|
|
648
656
|
declare function listBrowsers(http: HttpClient, args?: {
|
|
649
657
|
status?: "active" | "destroyed";
|
|
@@ -856,15 +864,15 @@ declare class FirecrawlClient {
|
|
|
856
864
|
cancelAgent(jobId: string): Promise<boolean>;
|
|
857
865
|
/**
|
|
858
866
|
* Create a new browser session.
|
|
859
|
-
* @param args Session options (
|
|
860
|
-
* @returns Session id and
|
|
867
|
+
* @param args Session options (ttl, activityTtl, streamWebView).
|
|
868
|
+
* @returns Session id, CDP URL, live view URL, and expiration time.
|
|
861
869
|
*/
|
|
862
870
|
browser(args?: Parameters<typeof browser>[1]): Promise<BrowserCreateResponse>;
|
|
863
871
|
/**
|
|
864
872
|
* Execute code in a browser session.
|
|
865
873
|
* @param sessionId Browser session id.
|
|
866
|
-
* @param args Code and
|
|
867
|
-
* @returns Execution result.
|
|
874
|
+
* @param args Code, language ("python" | "node" | "bash"), and optional timeout.
|
|
875
|
+
* @returns Execution result including stdout, stderr, exitCode, and killed status.
|
|
868
876
|
*/
|
|
869
877
|
browserExecute(sessionId: string, args: Parameters<typeof browserExecute>[2]): Promise<BrowserExecuteResponse>;
|
|
870
878
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -559,15 +559,22 @@ interface BrowserCreateResponse {
|
|
|
559
559
|
id?: string;
|
|
560
560
|
cdpUrl?: string;
|
|
561
561
|
liveViewUrl?: string;
|
|
562
|
+
expiresAt?: string;
|
|
562
563
|
error?: string;
|
|
563
564
|
}
|
|
564
565
|
interface BrowserExecuteResponse {
|
|
565
566
|
success: boolean;
|
|
567
|
+
stdout?: string;
|
|
566
568
|
result?: string;
|
|
569
|
+
stderr?: string;
|
|
570
|
+
exitCode?: number;
|
|
571
|
+
killed?: boolean;
|
|
567
572
|
error?: string;
|
|
568
573
|
}
|
|
569
574
|
interface BrowserDeleteResponse {
|
|
570
575
|
success: boolean;
|
|
576
|
+
sessionDurationMs?: number;
|
|
577
|
+
creditsBilled?: number;
|
|
571
578
|
error?: string;
|
|
572
579
|
}
|
|
573
580
|
interface BrowserSession {
|
|
@@ -603,9 +610,9 @@ declare class HttpClient {
|
|
|
603
610
|
getApiKey(): string;
|
|
604
611
|
private request;
|
|
605
612
|
private sleep;
|
|
606
|
-
post<T = any>(endpoint: string, body: Record<string, unknown>, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
607
|
-
get<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
608
|
-
delete<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any>>;
|
|
613
|
+
post<T = any>(endpoint: string, body: Record<string, unknown>, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
614
|
+
get<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
615
|
+
delete<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
609
616
|
prepareHeaders(idempotencyKey?: string): Record<string, string>;
|
|
610
617
|
}
|
|
611
618
|
|
|
@@ -637,13 +644,14 @@ declare function prepareAgentPayload(args: {
|
|
|
637
644
|
declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
|
|
638
645
|
|
|
639
646
|
declare function browser(http: HttpClient, args?: {
|
|
640
|
-
|
|
641
|
-
|
|
647
|
+
ttl?: number;
|
|
648
|
+
activityTtl?: number;
|
|
642
649
|
streamWebView?: boolean;
|
|
643
650
|
}): Promise<BrowserCreateResponse>;
|
|
644
651
|
declare function browserExecute(http: HttpClient, sessionId: string, args: {
|
|
645
652
|
code: string;
|
|
646
|
-
language?: "python" | "
|
|
653
|
+
language?: "python" | "node" | "bash";
|
|
654
|
+
timeout?: number;
|
|
647
655
|
}): Promise<BrowserExecuteResponse>;
|
|
648
656
|
declare function listBrowsers(http: HttpClient, args?: {
|
|
649
657
|
status?: "active" | "destroyed";
|
|
@@ -856,15 +864,15 @@ declare class FirecrawlClient {
|
|
|
856
864
|
cancelAgent(jobId: string): Promise<boolean>;
|
|
857
865
|
/**
|
|
858
866
|
* Create a new browser session.
|
|
859
|
-
* @param args Session options (
|
|
860
|
-
* @returns Session id and
|
|
867
|
+
* @param args Session options (ttl, activityTtl, streamWebView).
|
|
868
|
+
* @returns Session id, CDP URL, live view URL, and expiration time.
|
|
861
869
|
*/
|
|
862
870
|
browser(args?: Parameters<typeof browser>[1]): Promise<BrowserCreateResponse>;
|
|
863
871
|
/**
|
|
864
872
|
* Execute code in a browser session.
|
|
865
873
|
* @param sessionId Browser session id.
|
|
866
|
-
* @param args Code and
|
|
867
|
-
* @returns Execution result.
|
|
874
|
+
* @param args Code, language ("python" | "node" | "bash"), and optional timeout.
|
|
875
|
+
* @returns Execution result including stdout, stderr, exitCode, and killed status.
|
|
868
876
|
*/
|
|
869
877
|
browserExecute(sessionId: string, args: Parameters<typeof browserExecute>[2]): Promise<BrowserExecuteResponse>;
|
|
870
878
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-22A4MB4F.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -815,8 +815,8 @@ async function cancelAgent(http, jobId) {
|
|
|
815
815
|
// src/v2/methods/browser.ts
|
|
816
816
|
async function browser(http, args = {}) {
|
|
817
817
|
const body = {};
|
|
818
|
-
if (args.
|
|
819
|
-
if (args.
|
|
818
|
+
if (args.ttl != null) body.ttl = args.ttl;
|
|
819
|
+
if (args.activityTtl != null) body.activityTtl = args.activityTtl;
|
|
820
820
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
821
821
|
try {
|
|
822
822
|
const res = await http.post("/v2/browser", body);
|
|
@@ -830,8 +830,9 @@ async function browser(http, args = {}) {
|
|
|
830
830
|
async function browserExecute(http, sessionId, args) {
|
|
831
831
|
const body = {
|
|
832
832
|
code: args.code,
|
|
833
|
-
language: args.language ?? "
|
|
833
|
+
language: args.language ?? "bash"
|
|
834
834
|
};
|
|
835
|
+
if (args.timeout != null) body.timeout = args.timeout;
|
|
835
836
|
try {
|
|
836
837
|
const res = await http.post(
|
|
837
838
|
`/v2/browser/${sessionId}/execute`,
|
|
@@ -959,7 +960,7 @@ var loadPromise;
|
|
|
959
960
|
var loadNodeWebSocket = async () => {
|
|
960
961
|
if (!isNodeRuntime()) return void 0;
|
|
961
962
|
try {
|
|
962
|
-
const undici = await import("
|
|
963
|
+
const undici = await import("undici");
|
|
963
964
|
const ctor = undici.WebSocket ?? undici.default?.WebSocket;
|
|
964
965
|
return typeof ctor === "function" ? ctor : void 0;
|
|
965
966
|
} catch {
|
|
@@ -1365,8 +1366,8 @@ var FirecrawlClient = class {
|
|
|
1365
1366
|
// Browser
|
|
1366
1367
|
/**
|
|
1367
1368
|
* Create a new browser session.
|
|
1368
|
-
* @param args Session options (
|
|
1369
|
-
* @returns Session id and
|
|
1369
|
+
* @param args Session options (ttl, activityTtl, streamWebView).
|
|
1370
|
+
* @returns Session id, CDP URL, live view URL, and expiration time.
|
|
1370
1371
|
*/
|
|
1371
1372
|
async browser(args = {}) {
|
|
1372
1373
|
return browser(this.http, args);
|
|
@@ -1374,8 +1375,8 @@ var FirecrawlClient = class {
|
|
|
1374
1375
|
/**
|
|
1375
1376
|
* Execute code in a browser session.
|
|
1376
1377
|
* @param sessionId Browser session id.
|
|
1377
|
-
* @param args Code and
|
|
1378
|
-
* @returns Execution result.
|
|
1378
|
+
* @param args Code, language ("python" | "node" | "bash"), and optional timeout.
|
|
1379
|
+
* @returns Execution result including stdout, stderr, exitCode, and killed status.
|
|
1379
1380
|
*/
|
|
1380
1381
|
async browserExecute(sessionId, args) {
|
|
1381
1382
|
return browserExecute(this.http, sessionId, args);
|
|
@@ -1435,7 +1436,7 @@ var FirecrawlClient = class {
|
|
|
1435
1436
|
import axios2, { AxiosError } from "axios";
|
|
1436
1437
|
import "zod";
|
|
1437
1438
|
|
|
1438
|
-
// node_modules/typescript-event-target/dist/index.mjs
|
|
1439
|
+
// node_modules/.pnpm/typescript-event-target@1.1.1/node_modules/typescript-event-target/dist/index.mjs
|
|
1439
1440
|
var e = class extends EventTarget {
|
|
1440
1441
|
dispatchTypedEvent(s, t) {
|
|
1441
1442
|
return super.dispatchEvent(t);
|
|
@@ -1464,7 +1465,7 @@ var FirecrawlApp = class {
|
|
|
1464
1465
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
1465
1466
|
return process.env.npm_package_version;
|
|
1466
1467
|
}
|
|
1467
|
-
const packageJson = await import("./package-
|
|
1468
|
+
const packageJson = await import("./package-5SIMNZMX.js");
|
|
1468
1469
|
return packageJson.default.version;
|
|
1469
1470
|
} catch (error) {
|
|
1470
1471
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
|
@@ -2835,7 +2836,7 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2835
2836
|
return this._v1;
|
|
2836
2837
|
}
|
|
2837
2838
|
};
|
|
2838
|
-
var
|
|
2839
|
+
var index_default = Firecrawl;
|
|
2839
2840
|
export {
|
|
2840
2841
|
Firecrawl,
|
|
2841
2842
|
FirecrawlApp as FirecrawlAppV1,
|
|
@@ -2843,5 +2844,5 @@ export {
|
|
|
2843
2844
|
JobTimeoutError,
|
|
2844
2845
|
SdkError,
|
|
2845
2846
|
Watcher,
|
|
2846
|
-
|
|
2847
|
+
index_default as default
|
|
2847
2848
|
};
|
package/package.json
CHANGED
package/src/v2/client.ts
CHANGED
|
@@ -311,8 +311,8 @@ export class FirecrawlClient {
|
|
|
311
311
|
// Browser
|
|
312
312
|
/**
|
|
313
313
|
* Create a new browser session.
|
|
314
|
-
* @param args Session options (
|
|
315
|
-
* @returns Session id and
|
|
314
|
+
* @param args Session options (ttl, activityTtl, streamWebView).
|
|
315
|
+
* @returns Session id, CDP URL, live view URL, and expiration time.
|
|
316
316
|
*/
|
|
317
317
|
async browser(
|
|
318
318
|
args: Parameters<typeof browserMethod>[1] = {}
|
|
@@ -322,8 +322,8 @@ export class FirecrawlClient {
|
|
|
322
322
|
/**
|
|
323
323
|
* Execute code in a browser session.
|
|
324
324
|
* @param sessionId Browser session id.
|
|
325
|
-
* @param args Code and
|
|
326
|
-
* @returns Execution result.
|
|
325
|
+
* @param args Code, language ("python" | "node" | "bash"), and optional timeout.
|
|
326
|
+
* @returns Execution result including stdout, stderr, exitCode, and killed status.
|
|
327
327
|
*/
|
|
328
328
|
async browserExecute(
|
|
329
329
|
sessionId: string,
|
|
@@ -10,14 +10,14 @@ import { normalizeAxiosError, throwForBadResponse } from "../utils/errorHandler"
|
|
|
10
10
|
export async function browser(
|
|
11
11
|
http: HttpClient,
|
|
12
12
|
args: {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
ttl?: number;
|
|
14
|
+
activityTtl?: number;
|
|
15
15
|
streamWebView?: boolean;
|
|
16
16
|
} = {}
|
|
17
17
|
): Promise<BrowserCreateResponse> {
|
|
18
18
|
const body: Record<string, unknown> = {};
|
|
19
|
-
if (args.
|
|
20
|
-
if (args.
|
|
19
|
+
if (args.ttl != null) body.ttl = args.ttl;
|
|
20
|
+
if (args.activityTtl != null) body.activityTtl = args.activityTtl;
|
|
21
21
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
22
22
|
|
|
23
23
|
try {
|
|
@@ -35,13 +35,15 @@ export async function browserExecute(
|
|
|
35
35
|
sessionId: string,
|
|
36
36
|
args: {
|
|
37
37
|
code: string;
|
|
38
|
-
language?: "python" | "
|
|
38
|
+
language?: "python" | "node" | "bash";
|
|
39
|
+
timeout?: number;
|
|
39
40
|
}
|
|
40
41
|
): Promise<BrowserExecuteResponse> {
|
|
41
42
|
const body: Record<string, unknown> = {
|
|
42
43
|
code: args.code,
|
|
43
|
-
language: args.language ?? "
|
|
44
|
+
language: args.language ?? "bash",
|
|
44
45
|
};
|
|
46
|
+
if (args.timeout != null) body.timeout = args.timeout;
|
|
45
47
|
|
|
46
48
|
try {
|
|
47
49
|
const res = await http.post<BrowserExecuteResponse>(
|
package/src/v2/types.ts
CHANGED
|
@@ -690,17 +690,24 @@ export interface BrowserCreateResponse {
|
|
|
690
690
|
id?: string;
|
|
691
691
|
cdpUrl?: string;
|
|
692
692
|
liveViewUrl?: string;
|
|
693
|
+
expiresAt?: string;
|
|
693
694
|
error?: string;
|
|
694
695
|
}
|
|
695
696
|
|
|
696
697
|
export interface BrowserExecuteResponse {
|
|
697
698
|
success: boolean;
|
|
699
|
+
stdout?: string;
|
|
698
700
|
result?: string;
|
|
701
|
+
stderr?: string;
|
|
702
|
+
exitCode?: number;
|
|
703
|
+
killed?: boolean;
|
|
699
704
|
error?: string;
|
|
700
705
|
}
|
|
701
706
|
|
|
702
707
|
export interface BrowserDeleteResponse {
|
|
703
708
|
success: boolean;
|
|
709
|
+
sessionDurationMs?: number;
|
|
710
|
+
creditsBilled?: number;
|
|
704
711
|
error?: string;
|
|
705
712
|
}
|
|
706
713
|
|
package/dump.rdb
DELETED
|
Binary file
|