@hyperbrowser/sdk 0.21.0 → 0.23.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,5 +1,5 @@
|
|
|
1
1
|
import { BaseService } from "./base";
|
|
2
|
-
import { ProfileResponse, CreateProfileResponse } from "../types/profile";
|
|
2
|
+
import { ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse } from "../types/profile";
|
|
3
3
|
import { BasicResponse } from "../types";
|
|
4
4
|
export declare class ProfilesService extends BaseService {
|
|
5
5
|
/**
|
|
@@ -16,4 +16,9 @@ export declare class ProfilesService extends BaseService {
|
|
|
16
16
|
* @param id The ID of the profile to delete
|
|
17
17
|
*/
|
|
18
18
|
delete(id: string): Promise<BasicResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* List all profiles with optional pagination
|
|
21
|
+
* @param params Optional parameters to filter the profiles
|
|
22
|
+
*/
|
|
23
|
+
list(params?: ProfileListParams): Promise<ProfileListResponse>;
|
|
19
24
|
}
|
|
@@ -52,5 +52,23 @@ class ProfilesService extends base_1.BaseService {
|
|
|
52
52
|
throw new client_1.HyperbrowserError(`Failed to delete profile ${id}`, undefined);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* List all profiles with optional pagination
|
|
57
|
+
* @param params Optional parameters to filter the profiles
|
|
58
|
+
*/
|
|
59
|
+
async list(params = {}) {
|
|
60
|
+
try {
|
|
61
|
+
return await this.request("/profiles", undefined, {
|
|
62
|
+
page: params.page,
|
|
63
|
+
limit: params.limit,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error instanceof client_1.HyperbrowserError) {
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
throw new client_1.HyperbrowserError("Failed to list profiles", undefined);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
55
73
|
}
|
|
56
74
|
exports.ProfilesService = ProfilesService;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { HyperbrowserConfig } from "./config";
|
|
|
2
2
|
export { StartCrawlJobParams, StartCrawlJobResponse, CrawledPage, CrawlJobResponse, GetCrawlJobParams, } from "./crawl";
|
|
3
3
|
export { StartScrapeJobParams, StartScrapeJobResponse, ScrapeJobData, ScrapeJobResponse, } from "./scrape";
|
|
4
4
|
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, } from "./session";
|
|
5
|
-
export { ProfileResponse, CreateProfileResponse } from "./profile";
|
|
5
|
+
export { ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile";
|
|
6
6
|
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension";
|
|
7
7
|
export { ScrapeJobStatus, CrawlJobStatus, Country, ISO639_1, OperatingSystem, Platform, } from "./constants";
|
package/dist/types/profile.d.ts
CHANGED
|
@@ -7,3 +7,13 @@ export interface ProfileResponse {
|
|
|
7
7
|
createdAt: string;
|
|
8
8
|
updatedAt: string;
|
|
9
9
|
}
|
|
10
|
+
export interface ProfileListParams {
|
|
11
|
+
page?: number;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ProfileListResponse {
|
|
15
|
+
profiles: ProfileResponse[];
|
|
16
|
+
totalCount: number;
|
|
17
|
+
page: number;
|
|
18
|
+
perPage: number;
|
|
19
|
+
}
|
package/dist/types/session.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface SessionDetail extends Session {
|
|
|
21
21
|
export interface SessionListParams {
|
|
22
22
|
status?: SessionStatus;
|
|
23
23
|
page?: number;
|
|
24
|
+
limit?: number;
|
|
24
25
|
}
|
|
25
26
|
export interface SessionListResponse {
|
|
26
27
|
sessions: Session[];
|
|
@@ -56,6 +57,7 @@ export interface CreateSessionParams {
|
|
|
56
57
|
profile?: CreateSessionProfile;
|
|
57
58
|
extensionIds?: Array<string>;
|
|
58
59
|
staticIpId?: string;
|
|
60
|
+
acceptCookies?: boolean;
|
|
59
61
|
}
|
|
60
62
|
export interface SessionRecording {
|
|
61
63
|
type: number;
|