cloudflare
Version:
The official TypeScript library for the Cloudflare API
154 lines • 5.44 kB
TypeScript
import { APIResource } from "../../core/resource.js";
import { APIPromise } from "../../core/api-promise.js";
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class BaseExtensions extends APIResource {
static readonly _key: readonly ['registrarSandbox', 'extensions'];
/**
* 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.registrarSandbox.extensions.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params: ExtensionListParams, options?: RequestOptions): PagePromise<ExtensionListResponsesCursorPagination, ExtensionListResponse>;
/**
* 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.registrarSandbox.extensions.get('com', {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(extension: string, params: ExtensionGetParams, options?: RequestOptions): APIPromise<ExtensionGetResponse>;
}
export declare class Extensions extends BaseExtensions {
}
export type ExtensionListResponsesCursorPagination = CursorPagination<ExtensionListResponse>;
/**
* Extension entry with metadata and JSON Schema documents for registration and
* transfer operations.
*/
export interface ExtensionListResponse {
/**
* Extension metadata.
*/
metadata: ExtensionListResponse.Metadata;
/**
* JSON Schema describing the expected input structure for registration operations
* on this extension.
*/
registration_schema: unknown;
/**
* JSON Schema describing the expected input structure for transfer operations on
* this extension.
*/
transfer_schema: unknown;
}
export declare namespace ExtensionListResponse {
/**
* Extension metadata.
*/
interface Metadata {
/**
* The full name of the extension. For example, "co.uk", or "uk".
*/
name: string;
/**
* The TLD of the extension. For example, for "co.uk", it is "uk". For "uk", it is
* "uk".
*/
tld: string;
}
}
/**
* Extension entry with metadata and JSON Schema documents for registration and
* transfer operations.
*/
export interface ExtensionGetResponse {
/**
* Extension metadata.
*/
metadata: ExtensionGetResponse.Metadata;
/**
* JSON Schema describing the expected input structure for registration operations
* on this extension.
*/
registration_schema: unknown;
/**
* JSON Schema describing the expected input structure for transfer operations on
* this extension.
*/
transfer_schema: unknown;
}
export declare namespace ExtensionGetResponse {
/**
* Extension metadata.
*/
interface Metadata {
/**
* The full name of the extension. For example, "co.uk", or "uk".
*/
name: string;
/**
* The TLD of the extension. For example, for "co.uk", it is "uk". For "uk", it is
* "uk".
*/
tld: string;
}
}
export interface ExtensionListParams extends CursorPaginationParams {
/**
* Path param: Identifier.
*/
account_id: string;
/**
* Query param: Sort direction for results. Defaults to ascending order.
*/
direction?: 'asc' | 'desc';
/**
* Query param: Filter extensions by exact name match. For example, `name=com`
* returns only the `com` extension.
*/
name?: string;
/**
* Query param: Column to sort results by. Defaults to `name` when omitted.
*/
sort_by?: 'name' | 'created_at' | 'updated_at';
}
export interface ExtensionGetParams {
/**
* Identifier.
*/
account_id: string;
}
export declare namespace Extensions {
export { type ExtensionListResponse as ExtensionListResponse, type ExtensionGetResponse as ExtensionGetResponse, type ExtensionListResponsesCursorPagination as ExtensionListResponsesCursorPagination, type ExtensionListParams as ExtensionListParams, type ExtensionGetParams as ExtensionGetParams, };
}
//# sourceMappingURL=extensions.d.ts.map