@hyperbrowser/sdk 0.39.0 → 0.40.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.
@@ -1,4 +1,4 @@
1
- import { BasicResponse, CreateSessionParams, GetSessionRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording } from "../types/session";
1
+ import { BasicResponse, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording } from "../types/session";
2
2
  import { BaseService } from "./base";
3
3
  export declare class SessionsService extends BaseService {
4
4
  /**
@@ -31,4 +31,9 @@ export declare class SessionsService extends BaseService {
31
31
  * @param id The ID of the session to get the recording URL from
32
32
  */
33
33
  getRecordingURL(id: string): Promise<GetSessionRecordingUrlResponse>;
34
+ /**
35
+ * Get the downloads URL of a session
36
+ * @param id The ID of the session to get the downloads URL from
37
+ */
38
+ getDownloadsURL(id: string): Promise<GetSessionDownloadsUrlResponse>;
34
39
  }
@@ -103,5 +103,20 @@ class SessionsService extends base_1.BaseService {
103
103
  throw new client_1.HyperbrowserError(`Failed to get recording url for session ${id}`, undefined);
104
104
  }
105
105
  }
106
+ /**
107
+ * Get the downloads URL of a session
108
+ * @param id The ID of the session to get the downloads URL from
109
+ */
110
+ async getDownloadsURL(id) {
111
+ try {
112
+ return await this.request(`/session/${id}/downloads-url`);
113
+ }
114
+ catch (error) {
115
+ if (error instanceof client_1.HyperbrowserError) {
116
+ throw error;
117
+ }
118
+ throw new client_1.HyperbrowserError(`Failed to get downloads url for session ${id}`, undefined);
119
+ }
120
+ }
106
121
  }
107
122
  exports.SessionsService = SessionsService;
@@ -9,6 +9,8 @@ export type ScrapePageStatus = "completed" | "failed" | "pending" | "running";
9
9
  export type CrawlPageStatus = "completed" | "failed";
10
10
  export type ScrapeWaitUntil = "load" | "domcontentloaded" | "networkidle";
11
11
  export type ScrapeScreenshotFormat = "jpeg" | "png" | "webp";
12
+ export type RecordingStatus = "not_enabled" | "pending" | "in_progress" | "completed" | "failed";
13
+ export type DownloadsStatus = "not_enabled" | "pending" | "in_progress" | "completed" | "failed";
12
14
  export declare const POLLING_ATTEMPTS = 5;
13
15
  export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "claude-3-7-sonnet-20250219" | "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022" | "gemini-2.0-flash";
14
16
  export type Country = "AD" | "AE" | "AF" | "AL" | "AM" | "AO" | "AR" | "AT" | "AU" | "AW" | "AZ" | "BA" | "BD" | "BE" | "BG" | "BH" | "BJ" | "BO" | "BR" | "BS" | "BT" | "BY" | "BZ" | "CA" | "CF" | "CH" | "CI" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "EC" | "EE" | "EG" | "ES" | "ET" | "EU" | "FI" | "FJ" | "FR" | "GB" | "GE" | "GH" | "GM" | "GR" | "HK" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IN" | "IQ" | "IR" | "IS" | "IT" | "JM" | "JO" | "JP" | "KE" | "KH" | "KR" | "KW" | "KZ" | "LB" | "LI" | "LR" | "LT" | "LU" | "LV" | "MA" | "MC" | "MD" | "ME" | "MG" | "MK" | "ML" | "MM" | "MN" | "MR" | "MT" | "MU" | "MV" | "MX" | "MY" | "MZ" | "NG" | "NL" | "NO" | "NZ" | "OM" | "PA" | "PE" | "PH" | "PK" | "PL" | "PR" | "PT" | "PY" | "QA" | "RANDOM_COUNTRY" | "RO" | "RS" | "RU" | "SA" | "SC" | "SD" | "SE" | "SG" | "SI" | "SK" | "SN" | "SS" | "TD" | "TG" | "TH" | "TM" | "TN" | "TR" | "TT" | "TW" | "UA" | "UG" | "US" | "UY" | "UZ" | "VE" | "VG" | "VN" | "YE" | "ZA" | "ZM" | "ZW" | "ad" | "ae" | "af" | "al" | "am" | "ao" | "ar" | "at" | "au" | "aw" | "az" | "ba" | "bd" | "be" | "bg" | "bh" | "bj" | "bo" | "br" | "bs" | "bt" | "by" | "bz" | "ca" | "cf" | "ch" | "ci" | "cl" | "cm" | "cn" | "co" | "cr" | "cu" | "cy" | "cz" | "de" | "dj" | "dk" | "dm" | "ec" | "ee" | "eg" | "es" | "et" | "eu" | "fi" | "fj" | "fr" | "gb" | "ge" | "gh" | "gm" | "gr" | "hk" | "hn" | "hr" | "ht" | "hu" | "id" | "ie" | "il" | "in" | "iq" | "ir" | "is" | "it" | "jm" | "jo" | "jp" | "ke" | "kh" | "kr" | "kw" | "kz" | "lb" | "li" | "lr" | "lt" | "lu" | "lv" | "ma" | "mc" | "md" | "me" | "mg" | "mk" | "ml" | "mm" | "mn" | "mr" | "mt" | "mu" | "mv" | "mx" | "my" | "mz" | "ng" | "nl" | "no" | "nz" | "om" | "pa" | "pe" | "ph" | "pk" | "pl" | "pr" | "pt" | "py" | "qa" | "ro" | "rs" | "ru" | "sa" | "sc" | "sd" | "se" | "sg" | "si" | "sk" | "sn" | "ss" | "td" | "tg" | "th" | "tm" | "tn" | "tr" | "tt" | "tw" | "ua" | "ug" | "us" | "uy" | "uz" | "ve" | "vg" | "vn" | "ye" | "za" | "zm" | "zw";
@@ -5,7 +5,7 @@ export { StartExtractJobParams, StartExtractJobResponse, ExtractJobResponse, Ext
5
5
  export { StartBrowserUseTaskParams, StartBrowserUseTaskResponse, BrowserUseTaskStatusResponse, BrowserUseTaskResponse, BrowserUseTaskData, } from "./agents/browser-use";
6
6
  export { StartClaudeComputerUseTaskParams, StartClaudeComputerUseTaskResponse, ClaudeComputerUseTaskStatusResponse, ClaudeComputerUseTaskResponse, ClaudeComputerUseTaskData, ClaudeComputerUseStepResponse, } from "./agents/claude-computer-use";
7
7
  export { StartCuaTaskParams, StartCuaTaskResponse, CuaTaskStatusResponse, CuaTaskResponse, CuaTaskData, CuaStepResponse, } from "./agents/cua";
8
- export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, } from "./session";
8
+ export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, } from "./session";
9
9
  export { ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
10
10
  export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
11
- export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, } from "./constants";
11
+ export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, } from "./constants";
@@ -1,4 +1,4 @@
1
- import { Country, ISO639_1, OperatingSystem, Platform, State } from "./constants";
1
+ import { Country, DownloadsStatus, ISO639_1, OperatingSystem, Platform, RecordingStatus, State } from "./constants";
2
2
  export type SessionStatus = "active" | "closed" | "error";
3
3
  export interface BasicResponse {
4
4
  success: boolean;
@@ -62,6 +62,7 @@ export interface CreateSessionParams {
62
62
  acceptCookies?: boolean;
63
63
  urlBlocklist?: string[];
64
64
  browserArgs?: string[];
65
+ saveDownloads?: boolean;
65
66
  }
66
67
  export interface SessionRecording {
67
68
  type: number;
@@ -70,5 +71,12 @@ export interface SessionRecording {
70
71
  delay?: number;
71
72
  }
72
73
  export interface GetSessionRecordingUrlResponse {
73
- recordingUrl: string;
74
+ status: RecordingStatus;
75
+ recordingUrl?: string | null;
76
+ error?: string | null;
77
+ }
78
+ export interface GetSessionDownloadsUrlResponse {
79
+ status: DownloadsStatus;
80
+ downloadsUrl?: string | null;
81
+ error?: string | null;
74
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "main": "dist/index.js",