UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

169 lines • 7.05 kB
import { APIResource } from "../../core/resource.mjs"; import * as ConfigsAPI from "./configs.mjs"; import { BaseConfigs, ConfigCreateParams, ConfigCreateResponse, ConfigDeleteParams, ConfigDeleteResponse, ConfigEditParams, ConfigEditResponse, ConfigGetParams, ConfigGetResponse, ConfigListParams, ConfigListResponse, ConfigListResponsesV4PagePaginationArray, ConfigRestartParams, ConfigRestartResponse, ConfigUpdateParams, ConfigUpdateResponse, Configs } from "./configs.mjs"; export declare class BaseHyperdriveResource extends APIResource { static readonly _key: readonly ['hyperdrive']; } export declare class HyperdriveResource extends BaseHyperdriveResource { configs: ConfigsAPI.Configs; } export interface Hyperdrive { /** * Define configurations using a unique string identifier. */ id: string; /** * The name of the Hyperdrive configuration. Used to identify the configuration in * the Cloudflare dashboard and API. */ name: string; /** * Combines database connection fields with exactly one supported network location. */ origin: Hyperdrive.PublicDatabase | Hyperdrive.AccessProtectedDatabaseBehindCloudflareTunnel | Hyperdrive.DatabaseReachableThroughAWorkersVPC; caching?: Hyperdrive.HyperdriveHyperdriveCachingCommon | Hyperdrive.HyperdriveHyperdriveCachingEnabled; /** * Defines the creation time of the Hyperdrive configuration. */ created_on?: string; /** * Defines the last modified time of the Hyperdrive configuration. */ modified_on?: string; /** * mTLS configuration for the origin connection. Cannot be used with VPC Service * origins; TLS must be managed on the VPC Service. */ mtls?: Hyperdrive.MTLS; /** * The (soft) maximum number of connections the Hyperdrive is allowed to make to * the origin database. * * Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not * specified, defaults to 20 for free tier and 60 for paid tier. Certain * Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare * if you need a higher limit. */ origin_connection_limit?: number; /** * Defines the last time the Hyperdrive connection pool was explicitly restarted * via the restart endpoint. Omitted if the pool has never been explicitly * restarted. */ restarted_on?: string | null; } export declare namespace Hyperdrive { interface PublicDatabase { /** * Set the name of your origin database. */ database: string; /** * Defines the publicly reachable hostname or IP of your origin database. Private, * loopback, and link-local IP addresses are not allowed. */ host: string; /** * Defines the port of your origin database. Defaults to 5432 for PostgreSQL or * 3306 for MySQL if not specified. */ port: number; /** * Specifies the URL scheme used to connect to your origin database. */ scheme: 'postgres' | 'postgresql' | 'mysql'; /** * Set the user of your origin database. */ user: string; } interface AccessProtectedDatabaseBehindCloudflareTunnel { /** * Defines the Client ID of the Access token to use when connecting to the origin * database. */ access_client_id: string; /** * Set the name of your origin database. */ database: string; /** * Defines the host (hostname or IP) of your origin database. */ host: string; /** * Specifies the URL scheme used to connect to your origin database. */ scheme: 'postgres' | 'postgresql' | 'mysql'; /** * Set the user of your origin database. */ user: string; } interface DatabaseReachableThroughAWorkersVPC { /** * Set the name of your origin database. */ database: string; /** * Specifies the URL scheme used to connect to your origin database. */ scheme: 'postgres' | 'postgresql' | 'mysql'; /** * The identifier of the Workers VPC Service to connect through. Hyperdrive will * egress through the specified VPC Service to reach the origin database. */ service_id: string; /** * Set the user of your origin database. */ user: string; } interface HyperdriveHyperdriveCachingCommon { /** * Set to true to disable caching of SQL responses. Default is false. */ disabled?: boolean; } interface HyperdriveHyperdriveCachingEnabled { /** * Set to true to disable caching of SQL responses. Default is false. */ disabled?: boolean; /** * Specify the maximum duration (in seconds) items should persist in the cache. * Defaults to 60 seconds if not specified. */ max_age?: number; /** * Specify the number of seconds the cache may serve a stale response. Defaults to * 15 seconds if not specified. */ stale_while_revalidate?: number; } /** * mTLS configuration for the origin connection. Cannot be used with VPC Service * origins; TLS must be managed on the VPC Service. */ interface MTLS { /** * Define CA certificate ID obtained after uploading CA cert. */ ca_certificate_id?: string; /** * Define mTLS certificate ID obtained after uploading client cert. */ mtls_certificate_id?: string; /** * PostgreSQL accepts `require`, `verify-ca`, and `verify-full`. MySQL accepts * `REQUIRED`, `VERIFY_CA`, and `VERIFY_IDENTITY`. The verify modes require a CA * certificate; the require modes cannot be used with a CA certificate. */ sslmode?: string; } } export declare namespace HyperdriveResource { export { type Hyperdrive as Hyperdrive }; export { Configs as Configs, BaseConfigs as BaseConfigs, type ConfigCreateResponse as ConfigCreateResponse, type ConfigUpdateResponse as ConfigUpdateResponse, type ConfigListResponse as ConfigListResponse, type ConfigDeleteResponse as ConfigDeleteResponse, type ConfigEditResponse as ConfigEditResponse, type ConfigGetResponse as ConfigGetResponse, type ConfigRestartResponse as ConfigRestartResponse, type ConfigListResponsesV4PagePaginationArray as ConfigListResponsesV4PagePaginationArray, type ConfigCreateParams as ConfigCreateParams, type ConfigUpdateParams as ConfigUpdateParams, type ConfigListParams as ConfigListParams, type ConfigDeleteParams as ConfigDeleteParams, type ConfigEditParams as ConfigEditParams, type ConfigGetParams as ConfigGetParams, type ConfigRestartParams as ConfigRestartParams, }; } //# sourceMappingURL=hyperdrive.d.mts.map