UNPKG

anchorbrowser

Version:

The official TypeScript library for the Anchorbrowser API

74 lines 2.06 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Profiles = void 0; const resource_1 = require("../core/resource.js"); const path_1 = require("../internal/utils/path.js"); class Profiles extends resource_1.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((0, path_1.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((0, path_1.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((0, path_1.path) `/v1/profiles/${name}`, options); } } exports.Profiles = Profiles; //# sourceMappingURL=profiles.js.map