UNPKG

anchorbrowser

Version:

The official TypeScript library for the Anchorbrowser API

63 lines 1.95 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Extensions = void 0; const resource_1 = require("../core/resource.js"); const uploads_1 = require("../internal/uploads.js"); const path_1 = require("../internal/utils/path.js"); class Extensions extends resource_1.APIResource { /** * Get details of a specific extension by its ID * * @example * ```ts * const extension = await client.extensions.retrieve( * '550e8400-e29b-41d4-a716-446655440000', * ); * ``` */ retrieve(id, options) { return this._client.get((0, path_1.path) `/v1/extensions/${id}`, options); } /** * Get all extensions for the authenticated user * * @example * ```ts * const extensions = await client.extensions.list(); * ``` */ list(options) { return this._client.get('/v1/extensions', options); } /** * Delete an extension and remove it from storage * * @example * ```ts * const extension = await client.extensions.delete( * '550e8400-e29b-41d4-a716-446655440000', * ); * ``` */ delete(id, options) { return this._client.delete((0, path_1.path) `/v1/extensions/${id}`, options); } /** * Upload a new browser extension as a ZIP file. The extension will be validated * and stored for use in browser sessions. * * @example * ```ts * const response = await client.extensions.upload({ * file: fs.createReadStream('path/to/file'), * name: 'My Custom Extension', * }); * ``` */ upload(body, options) { return this._client.post('/v1/extensions', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client)); } } exports.Extensions = Extensions; //# sourceMappingURL=extensions.js.map