@hyperbrowser/sdk 0.27.0 → 0.29.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, SessionDetail, SessionListParams, SessionListResponse, SessionRecording } from "../types/session";
|
|
1
|
+
import { BasicResponse, CreateSessionParams, GetSessionRecordingUrlResponse, SessionDetail, SessionListParams, SessionListResponse, SessionRecording } from "../types/session";
|
|
2
2
|
import { BaseService } from "./base";
|
|
3
3
|
export declare class SessionsService extends BaseService {
|
|
4
4
|
/**
|
|
@@ -26,4 +26,9 @@ export declare class SessionsService extends BaseService {
|
|
|
26
26
|
* @param id The ID of the session to get the recording from
|
|
27
27
|
*/
|
|
28
28
|
getRecording(id: string): Promise<SessionRecording[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the recording URL of a session
|
|
31
|
+
* @param id The ID of the session to get the recording URL from
|
|
32
|
+
*/
|
|
33
|
+
getRecordingURL(id: string): Promise<GetSessionRecordingUrlResponse>;
|
|
29
34
|
}
|
|
@@ -88,5 +88,20 @@ class SessionsService extends base_1.BaseService {
|
|
|
88
88
|
throw new client_1.HyperbrowserError(`Failed to get recording for session ${id}`, undefined);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Get the recording URL of a session
|
|
93
|
+
* @param id The ID of the session to get the recording URL from
|
|
94
|
+
*/
|
|
95
|
+
async getRecordingURL(id) {
|
|
96
|
+
try {
|
|
97
|
+
return await this.request(`/session/${id}/recording-url`);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
throw new client_1.HyperbrowserError(`Failed to get recording url for session ${id}`, undefined);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
91
106
|
}
|
|
92
107
|
exports.SessionsService = SessionsService;
|
package/dist/types/session.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export interface CreateSessionParams {
|
|
|
58
58
|
extensionIds?: Array<string>;
|
|
59
59
|
staticIpId?: string;
|
|
60
60
|
acceptCookies?: boolean;
|
|
61
|
+
urlBlocklist?: string[];
|
|
62
|
+
browserArgs?: string[];
|
|
61
63
|
}
|
|
62
64
|
export interface SessionRecording {
|
|
63
65
|
type: number;
|
|
@@ -65,3 +67,6 @@ export interface SessionRecording {
|
|
|
65
67
|
timestamp: number;
|
|
66
68
|
delay?: number;
|
|
67
69
|
}
|
|
70
|
+
export interface GetSessionRecordingUrlResponse {
|
|
71
|
+
recordingUrl: string;
|
|
72
|
+
}
|