@hyperbrowser/sdk 0.86.0 → 0.87.1
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, UpdateSessionProfileParams, SessionGetParams } from "../types/session";
|
|
1
|
+
import { BasicResponse, CreateSessionParams, GetActiveSessionsCountResponse, GetSessionDownloadsUrlResponse, GetSessionRecordingUrlResponse, GetSessionVideoRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording, UploadFileOptions, UploadFileResponse, SessionEventLogListParams, SessionEventLogListResponse, UpdateSessionProfileParams, UpdateSessionProxyParams, SessionGetParams } from "../types/session";
|
|
2
2
|
import { BaseService } from "./base";
|
|
3
3
|
/**
|
|
4
4
|
* Service for managing session event logs
|
|
@@ -79,6 +79,7 @@ export declare class SessionsService extends BaseService {
|
|
|
79
79
|
updateProfileParams(id: string, params: UpdateSessionProfileParams): Promise<BasicResponse>;
|
|
80
80
|
/** @deprecated Pass an UpdateSessionProfileParams object instead of a boolean. */
|
|
81
81
|
updateProfileParams(id: string, persistChanges: boolean): Promise<BasicResponse>;
|
|
82
|
+
updateProxyParams(id: string, params: UpdateSessionProxyParams): Promise<BasicResponse>;
|
|
82
83
|
private static hasWarnedUpdateSessionProfileParamsBooleanDeprecated;
|
|
83
84
|
private warnUpdateSessionProfileParamsBooleanDeprecated;
|
|
84
85
|
}
|
|
@@ -345,6 +345,20 @@ class SessionsService extends base_1.BaseService {
|
|
|
345
345
|
throw new client_1.HyperbrowserError(`Failed to update profile for session ${id}`, undefined);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
+
async updateProxyParams(id, params) {
|
|
349
|
+
try {
|
|
350
|
+
return await this.request(`/session/${id}/update`, {
|
|
351
|
+
method: "PUT",
|
|
352
|
+
body: JSON.stringify({ type: "proxy", params }),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
359
|
+
throw new client_1.HyperbrowserError(`Failed to update proxy for session ${id}`, undefined);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
348
362
|
warnUpdateSessionProfileParamsBooleanDeprecated() {
|
|
349
363
|
if (SessionsService.hasWarnedUpdateSessionProfileParamsBooleanDeprecated) {
|
|
350
364
|
return;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, UpdateSessionProfileParams, } from "./session";
|
|
10
|
+
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionGetParams, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, GetSessionDownloadsUrlResponse, GetSessionVideoRecordingUrlResponse, GetSessionRecordingUrlResponse, ImageCaptchaParam, UploadFileResponse, UploadFileOptions, GetActiveSessionsCountResponse, SessionEventLogListParams, SessionEventLogListResponse, SessionEventLog, SessionProfile, SessionLaunchState, SessionCreditBreakdown, UpdateSessionProfileParams, UpdateSessionProxyLocationParams, UpdateSessionProxyParams, } from "./session";
|
|
11
11
|
export { SandboxStatus, SandboxRuntimeTarget, Sandbox, SandboxDetail, SandboxListParams, SandboxListResponse, SandboxImageSummary, SandboxImageListResponse, SandboxSnapshotStatus, SandboxSnapshotSummary, SandboxSnapshotListParams, SandboxSnapshotListResponse, CreateSandboxParams, SandboxMemorySnapshotParams, SandboxMemorySnapshotResult, SandboxExposeParams, SandboxExposeResult, SandboxProcessStatus, SandboxExecParams, SandboxProcessSummary, SandboxProcessResult, SandboxProcessListParams, SandboxProcessListResponse, SandboxProcessWaitParams, SandboxProcessSignal, SandboxProcessStdinParams, SandboxProcessStreamEvent, SandboxFileType, SandboxFileInfo, SandboxFileWriteInfo, SandboxFileListOptions, SandboxFileReadFormat, SandboxFileReadOptions, SandboxFileWriteData, SandboxFileWriteEntry, SandboxFileTextWriteOptions, SandboxFileBytesWriteOptions, SandboxFileMakeDirOptions, SandboxFileCopyParams, SandboxFileChmodParams, SandboxFileChownParams, SandboxFileTransferResult, SandboxFileSystemEventType, SandboxFileSystemEvent, SandboxWatchDirOptions, SandboxPresignFileParams, SandboxPresignedUrl, SandboxTerminalCreateParams, SandboxTerminalOutputChunk, SandboxTerminalStatus, SandboxTerminalWaitParams, SandboxTerminalKillParams, SandboxTerminalEvent, } from "./sandbox";
|
|
12
12
|
export { CreateProfileParams, ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
|
|
13
13
|
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
|
package/dist/types/session.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface SessionLaunchState {
|
|
|
33
33
|
appendTimestampToDownloads?: boolean;
|
|
34
34
|
disablePostQuantumKeyAgreement?: boolean;
|
|
35
35
|
}
|
|
36
|
+
export interface SessionCreditBreakdown {
|
|
37
|
+
creditsUsed: number | null;
|
|
38
|
+
browserTimeCreditsUsed: number | null;
|
|
39
|
+
proxyDataCreditsUsed: number | null;
|
|
40
|
+
}
|
|
36
41
|
export interface Session {
|
|
37
42
|
id: string;
|
|
38
43
|
teamId: string;
|
|
@@ -44,6 +49,7 @@ export interface Session {
|
|
|
44
49
|
sessionUrl: string;
|
|
45
50
|
launchState?: SessionLaunchState | null;
|
|
46
51
|
creditsUsed: number | null;
|
|
52
|
+
creditBreakdown: SessionCreditBreakdown;
|
|
47
53
|
}
|
|
48
54
|
export interface SessionDetail extends Session {
|
|
49
55
|
wsEndpoint: string;
|
|
@@ -186,3 +192,13 @@ export interface UpdateSessionProfileParams {
|
|
|
186
192
|
persistChanges?: boolean;
|
|
187
193
|
persistNetworkCache?: boolean;
|
|
188
194
|
}
|
|
195
|
+
export interface UpdateSessionProxyLocationParams {
|
|
196
|
+
country?: Country;
|
|
197
|
+
state?: State;
|
|
198
|
+
city?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface UpdateSessionProxyParams {
|
|
201
|
+
enabled: boolean;
|
|
202
|
+
staticIpId?: string;
|
|
203
|
+
location?: UpdateSessionProxyLocationParams;
|
|
204
|
+
}
|