@hyperbrowser/sdk
Advanced tools
Comparing version 0.21.0 to 0.22.0
import { BaseService } from "./base"; | ||
import { ProfileResponse, CreateProfileResponse } from "../types/profile"; | ||
import { ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse } from "../types/profile"; | ||
import { BasicResponse } from "../types"; | ||
@@ -19,2 +19,7 @@ export declare class ProfilesService extends BaseService { | ||
delete(id: string): Promise<BasicResponse>; | ||
/** | ||
* List all profiles with optional pagination | ||
* @param params Optional parameters to filter the profiles | ||
*/ | ||
list(params?: ProfileListParams): Promise<ProfileListResponse>; | ||
} |
@@ -55,3 +55,21 @@ "use strict"; | ||
} | ||
/** | ||
* List all profiles with optional pagination | ||
* @param params Optional parameters to filter the profiles | ||
*/ | ||
async list(params = {}) { | ||
try { | ||
return await this.request("/profiles", undefined, { | ||
page: params.page, | ||
limit: params.limit, | ||
}); | ||
} | ||
catch (error) { | ||
if (error instanceof client_1.HyperbrowserError) { | ||
throw error; | ||
} | ||
throw new client_1.HyperbrowserError("Failed to list profiles", undefined); | ||
} | ||
} | ||
} | ||
exports.ProfilesService = ProfilesService; |
@@ -66,2 +66,3 @@ "use strict"; | ||
page: params.page, | ||
limit: params.limit, | ||
}); | ||
@@ -68,0 +69,0 @@ } |
@@ -5,4 +5,4 @@ export { HyperbrowserConfig } from "./config"; | ||
export { BasicResponse, SessionStatus, Session, SessionDetail, SessionListParams, SessionListResponse, ScreenConfig, CreateSessionParams, } from "./session"; | ||
export { ProfileResponse, CreateProfileResponse } from "./profile"; | ||
export { ProfileResponse, CreateProfileResponse, ProfileListParams, ProfileListResponse, } from "./profile"; | ||
export { CreateExtensionParams, CreateExtensionResponse, ListExtensionsResponse, } from "./extension"; | ||
export { ScrapeJobStatus, CrawlJobStatus, Country, ISO639_1, OperatingSystem, Platform, } from "./constants"; |
@@ -10,1 +10,11 @@ export interface CreateProfileResponse { | ||
} | ||
export interface ProfileListParams { | ||
page?: number; | ||
limit?: number; | ||
} | ||
export interface ProfileListResponse { | ||
profiles: ProfileResponse[]; | ||
totalCount: number; | ||
page: number; | ||
perPage: number; | ||
} |
@@ -24,2 +24,3 @@ import { Country, ISO639_1, OperatingSystem, Platform } from "./constants"; | ||
page?: number; | ||
limit?: number; | ||
} | ||
@@ -26,0 +27,0 @@ export interface SessionListResponse { |
{ | ||
"name": "@hyperbrowser/sdk", | ||
"version": "0.21.0", | ||
"version": "0.22.0", | ||
"description": "Node SDK for Hyperbrowser API", | ||
@@ -5,0 +5,0 @@ "author": "", |
53174
1345