@hyperbrowser/sdk 0.20.0 → 0.22.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;
@@ -63,6 +63,7 @@ class SessionsService extends base_1.BaseService {
63
63
  return await this.request("/sessions", undefined, {
64
64
  status: params.status,
65
65
  page: params.page,
66
+ limit: params.limit,
66
67
  });
67
68
  }
68
69
  catch (error) {
@@ -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";
@@ -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
+ }
@@ -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[];
@@ -55,6 +56,7 @@ export interface CreateSessionParams {
55
56
  enableWebRecording?: boolean;
56
57
  profile?: CreateSessionProfile;
57
58
  extensionIds?: Array<string>;
59
+ staticIpId?: string;
58
60
  }
59
61
  export interface SessionRecording {
60
62
  type: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperbrowser/sdk",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Node SDK for Hyperbrowser API",
5
5
  "author": "",
6
6
  "main": "dist/index.js",