anchorbrowser
Version:
The official TypeScript library for the Anchorbrowser API
70 lines • 1.89 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../core/resource.mjs";
import { path } from "../internal/utils/path.mjs";
export 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, options) {
return this._client.post('/v1/profiles', { body, ...options });
}
/**
* Retrieves details of a specific profile by its name.
*
* @example
* ```ts
* const profile = await client.profiles.retrieve(
* 'my-profile',
* );
* ```
*/
retrieve(name, options) {
return this._client.get(path `/v1/profiles/${name}`, options);
}
/**
* 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, body, options) {
return this._client.put(path `/v1/profiles/${name}`, { body, ...options });
}
/**
* Fetches all stored profiles.
*
* @example
* ```ts
* const profiles = await client.profiles.list();
* ```
*/
list(options) {
return this._client.get('/v1/profiles', options);
}
/**
* Deletes an existing profile by its name.
*
* @example
* ```ts
* const successResponse = await client.profiles.delete(
* 'my-profile',
* );
* ```
*/
delete(name, options) {
return this._client.delete(path `/v1/profiles/${name}`, options);
}
}
//# sourceMappingURL=profiles.mjs.map