UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

65 lines • 2.85 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { CursorPagination } from "../../core/pagination.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseExtensions = /* @__PURE__ */ (() => { class BaseExtensions extends APIResource { /** * Returns metadata and JSON Schema documents describing the expected input * structure for registration and transfer operations on each supported extension * (TLD). * * This endpoint uses cursor-based pagination. Results are ordered by extension * name by default. To fetch the next page, pass the `cursor` value from the * `result_info` object in the response as the `cursor` query parameter in your * next request. An empty `cursor` string indicates there are no more pages. * * Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a * previous response in an `If-None-Match` header to receive a `304 Not Modified` * when the data has not changed. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const extensionListResponse of client.registrar.extensions.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/registrar/extensions`, (CursorPagination), { query, ...options }); } /** * Returns metadata and JSON Schema documents describing the expected input * structure for registration and transfer operations on a specific extension * (TLD). * * Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a * previous response in an `If-None-Match` header to receive a `304 Not Modified` * when the data has not changed. * * @example * ```ts * const extension = await client.registrar.extensions.get( * 'com', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(extension, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/registrar/extensions/${extension}`, options)._thenUnwrap((obj) => obj.result); } } BaseExtensions._key = Object.freeze([ 'registrar', 'extensions', ]); return BaseExtensions; })(); export class Extensions extends BaseExtensions { } //# sourceMappingURL=extensions.mjs.map