@hyperbrowser/sdk 0.80.2 → 0.81.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, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse } from "../types/session";
1
+ import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams } from "../types/session";
2
2
  import { BaseService } from "./base";
3
3
  /**
4
4
  * Service for managing session event logs
@@ -76,11 +76,10 @@ export declare class SessionsService extends BaseService {
76
76
  * @param durationMinutes The duration in minutes to extend the session by
77
77
  */
78
78
  extendSession(id: string, durationMinutes: number): Promise<BasicResponse>;
79
- /**
80
- * Update the profile parameters of a session
81
- * @param id The ID of the session to update the profile parameters of
82
- * @param persistChanges Whether to persist the changes to the profile
83
- */
79
+ updateProfileParams(id: string, params: UpdateSessionProfileParams): Promise<BasicResponse>;
80
+ /** @deprecated Pass an UpdateSessionProfileParams object instead of a boolean. */
84
81
  updateProfileParams(id: string, persistChanges: boolean): Promise<BasicResponse>;
82
+ private static hasWarnedUpdateSessionProfileParamsBooleanDeprecated;
83
+ private warnUpdateSessionProfileParamsBooleanDeprecated;
85
84
  }
86
85
  export {};
@@ -317,16 +317,23 @@ class SessionsService extends base_1.BaseService {
317
317
  throw new client_1.HyperbrowserError(`Failed to extend session ${id}`, undefined);
318
318
  }
319
319
  }
320
- /**
321
- * Update the profile parameters of a session
322
- * @param id The ID of the session to update the profile parameters of
323
- * @param persistChanges Whether to persist the changes to the profile
324
- */
325
- async updateProfileParams(id, persistChanges) {
320
+ async updateProfileParams(id, paramsOrPersist) {
321
+ let params;
322
+ if (typeof paramsOrPersist === "boolean") {
323
+ this.warnUpdateSessionProfileParamsBooleanDeprecated();
324
+ params = {
325
+ persistChanges: paramsOrPersist,
326
+ // Legacy signature didn’t include this field; default to false.
327
+ persistNetworkCache: undefined,
328
+ };
329
+ }
330
+ else {
331
+ params = paramsOrPersist;
332
+ }
326
333
  try {
327
334
  return await this.request(`/session/${id}/update`, {
328
335
  method: "PUT",
329
- body: JSON.stringify({ type: "profile", params: { persistChanges } }),
336
+ body: JSON.stringify({ type: "profile", params }),
330
337
  });
331
338
  }
332
339
  catch (error) {
@@ -336,5 +343,13 @@ class SessionsService extends base_1.BaseService {
336
343
  throw new client_1.HyperbrowserError(`Failed to update profile for session ${id}`, undefined);
337
344
  }
338
345
  }
346
+ warnUpdateSessionProfileParamsBooleanDeprecated() {
347
+ if (SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated) {
348
+ return;
349
+ }
350
+ SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated = true;
351
+ console.warn("[DEPRECATED] updateSessionProfileParams(id, boolean) will be removed; pass an UpdateSessionProfileParams object instead.");
352
+ }
339
353
  }
340
354
  exports.SessionsService = SessionsService;
355
+ SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated = false;
@@ -7,7 +7,7 @@ export { StartClaudeComputerUseTaskParams, StartClaudeComputerUseTaskResponse, C
7
7
  export { StartCuaTaskParams, StartCuaTaskResponse, CuaTaskStatusResponse, CuaTaskResponse, CuaTaskData, CuaStepResponse, CuaApiKeys, CuaTaskMetadata, } from "./agents/cua";
8
8
  export { StartHyperAgentTaskParams, StartHyperAgentTaskResponse, HyperAgentTaskStatusResponse, HyperAgentTaskResponse, HyperAgentTaskData, HyperAgentStep, HyperAgentOutput, HyperAgentActionOutput, HyperAgentApiKeys, HyperAgentTaskMetadata, HyperAgentOutputV110, HyperAgentStepV110, } from "./agents/hyper-agent";
9
9
  export { StartGeminiComputerUseTaskParams, StartGeminiComputerUseTaskResponse, GeminiComputerUseTaskStatusResponse, GeminiComputerUseTaskResponse, GeminiComputerUseTaskData, GeminiComputerUseStepResponse, GeminiComputerUseApiKeys, GeminiComputerUseTaskMetadata, } from "./agents/gemini-computer-use";
10
- export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, } from "./session";
10
+ export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, UpdateSessionProfileParams, } from "./session";
11
11
  export { CreateProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
12
12
  export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
13
13
  export { ExtractJobStatus, BrowserUseTaskStatus, BrowserUseLlm, ClaudeComputerUseLlm, GeminiComputerUseLlm, ScrapeScreenshotFormat, ScrapeJobStatus, CrawlJobStatus, Country, State, ISO639_1, OperatingSystem, Platform, ScrapeFormat, ScrapeWaitUntil, ScrapePageStatus, CrawlPageStatus, RecordingStatus, DownloadsStatus, HyperAgentLlm, HyperAgentTaskStatus, ClaudeComputerUseTaskStatus, CuaTaskStatus, GeminiComputerUseTaskStatus, SessionEventLogType, SessionRegion, BrowserUseVersion, HyperAgentVersion, } from "./constants";
@@ -68,6 +68,7 @@ export interface ScreenConfig {
68
68
  export interface CreateSessionProfile {
69
69
  id?: string;
70
70
  persistChanges?: boolean;
71
+ persistNetworkCache?: boolean;
71
72
  }
72
73
  export interface ImageCaptchaParam {
73
74
  imageSelector: string;
@@ -168,3 +169,7 @@ export interface SessionEventLogListResponse {
168
169
  page: number;
169
170
  perPage: number;
170
171
  }
172
+ export interface UpdateSessionProfileParams {
173
+ persistChanges?: boolean;
174
+ persistNetworkCache?: boolean;
175
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.80.2",
3
+ "version": "0.81.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "main": "dist/index.js",