anchorbrowser
Version:
The official TypeScript library for the Anchorbrowser API
174 lines • 5.03 kB
text/typescript
import { APIResource } from "../core/resource.mjs";
import * as Shared from "./shared.mjs";
import { APIPromise } from "../core/api-promise.mjs";
import { RequestOptions } from "../internal/request-options.mjs";
export declare class Profiles extends APIResource {
/**
* Creates a new profile from a browser session. A Profile stores cookies, local
* storage, and cache.
*
* @example
* ```ts
* const successResponse = await client.profiles.create({
* name: 'my-profile',
* });
* ```
*/
create(body: ProfileCreateParams, options?: RequestOptions): APIPromise<Shared.SuccessResponse>;
/**
* Retrieves details of a specific profile by its name.
*
* @example
* ```ts
* const profile = await client.profiles.retrieve(
* 'my-profile',
* );
* ```
*/
retrieve(name: string, options?: RequestOptions): APIPromise<ProfileRetrieveResponse>;
/**
* Updates the description or data of an existing profile using a browser session.
*
* @example
* ```ts
* const successResponse = await client.profiles.update(
* 'my-profile',
* );
* ```
*/
update(name: string, body: ProfileUpdateParams, options?: RequestOptions): APIPromise<Shared.SuccessResponse>;
/**
* Fetches all stored profiles.
*
* @example
* ```ts
* const profiles = await client.profiles.list();
* ```
*/
list(options?: RequestOptions): APIPromise<ProfileListResponse>;
/**
* Deletes an existing profile by its name.
*
* @example
* ```ts
* const successResponse = await client.profiles.delete(
* 'my-profile',
* );
* ```
*/
delete(name: string, options?: RequestOptions): APIPromise<Shared.SuccessResponse>;
}
export interface ProfileRetrieveResponse {
data?: ProfileRetrieveResponse.Data;
}
export declare namespace ProfileRetrieveResponse {
interface Data {
/**
* The timestamp when the profile was created.
*/
created_at?: string;
/**
* A description of the profile.
*/
description?: string;
/**
* The name of the profile.
*/
name?: string;
/**
* The browser session ID used to create this profile, if applicable.
*/
session_id?: string;
/**
* The source of the profile data.
*/
source?: 'session';
/**
* The current status of the profile.
*/
status?: string;
}
}
export interface ProfileListResponse {
data?: ProfileListResponse.Data;
}
export declare namespace ProfileListResponse {
interface Data {
/**
* Total number of profiles
*/
count?: number;
items?: Array<Data.Item>;
}
namespace Data {
interface Item {
/**
* The timestamp when the profile was created.
*/
created_at?: string;
/**
* A description of the profile.
*/
description?: string;
/**
* The name of the profile.
*/
name?: string;
/**
* The browser session ID used to create this profile, if applicable.
*/
session_id?: string;
/**
* The source of the profile data.
*/
source?: 'session';
/**
* The current status of the profile.
*/
status?: string;
}
}
}
export interface ProfileCreateParams {
/**
* The name of the profile.
*/
name: string;
/**
* Whether to use a dedicated sticky IP for this profile. Defaults to false.
*/
dedicated_sticky_ip?: boolean;
/**
* A description of the profile.
*/
description?: string;
/**
* The browser session ID is required if the source is set to `session`. The
* browser session must be running, and the profile will be stored once the browser
* session terminates.
*/
session_id?: string;
/**
* The source of the profile data. currently only `session` is supported.
*/
source?: 'session';
}
export interface ProfileUpdateParams {
/**
* The new description for the profile.
*/
description?: string;
/**
* The browser session ID is required if the source is set to `session`. The
* browser session must belong to the user and be active.
*/
session_id?: string;
/**
* The source of the profile data. Currently, only `session` is supported.
*/
source?: 'session';
}
export declare namespace Profiles {
export { type ProfileRetrieveResponse as ProfileRetrieveResponse, type ProfileListResponse as ProfileListResponse, type ProfileCreateParams as ProfileCreateParams, type ProfileUpdateParams as ProfileUpdateParams, };
}
//# sourceMappingURL=profiles.d.mts.map