cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
8b68374ef2c5186764f466a3aaeffebdecd696bd

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/index.ts

778lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { type Agent } from './_shims/index';
4import * as qs from './internal/qs';
5import * as Core from './core';
6import * as Errors from './error';
7import * as Pagination from './pagination';
8import {
9 type CursorLimitPaginationParams,
10 CursorLimitPaginationResponse,
11 type CursorPaginationParams,
12 CursorPaginationResponse,
13 SinglePageResponse,
14 type V4PagePaginationArrayParams,
15 V4PagePaginationArrayResponse,
16 type V4PagePaginationParams,
17 V4PagePaginationResponse,
18} from './pagination';
19import * as Uploads from './uploads';
20import * as API from './resources/index';
21import { AuditLogs } from './resources/audit-logs';
22import { BotManagement } from './resources/bot-management';
23import { BrandProtection } from './resources/brand-protection';
24import { ClientCertificates } from './resources/client-certificates';
25import { CustomNameservers } from './resources/custom-nameservers';
26import { DCVDelegation } from './resources/dcv-delegation';
27import { Filters } from './resources/filters';
28import { IPs } from './resources/ips';
29import { KeylessCertificates } from './resources/keyless-certificates';
30import { ManagedTransforms } from './resources/managed-transforms';
31import { Memberships } from './resources/memberships';
32import { OriginCACertificates } from './resources/origin-ca-certificates';
33import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-encryption';
34import { Pagerules } from './resources/pagerules';
35import { RateLimits } from './resources/rate-limits';
36import { SecurityTXT } from './resources/security-txt';
37import { URLNormalization } from './resources/url-normalization';
38import { Accounts } from './resources/accounts/accounts';
39import { ACM } from './resources/acm/acm';
40import { Addressing } from './resources/addressing/addressing';
41import { AIGateway } from './resources/ai-gateway/ai-gateway';
42import { Alerting } from './resources/alerting/alerting';
43import { APIGateway } from './resources/api-gateway/api-gateway';
44import { Argo } from './resources/argo/argo';
45import { Billing } from './resources/billing/billing';
46import { BotnetFeed } from './resources/botnet-feed/botnet-feed';
47import { Cache } from './resources/cache/cache';
48import { Calls } from './resources/calls/calls';
49import { CertificateAuthorities } from './resources/certificate-authorities/certificate-authorities';
50import { CloudConnector } from './resources/cloud-connector/cloud-connector';
51import { CloudforceOne } from './resources/cloudforce-one/cloudforce-one';
52import { ContentScanning } from './resources/content-scanning/content-scanning';
53import { CustomCertificates } from './resources/custom-certificates/custom-certificates';
54import { CustomHostnames } from './resources/custom-hostnames/custom-hostnames';
55import { D1Resource } from './resources/d1/d1';
56import { Diagnostics } from './resources/diagnostics/diagnostics';
57import { DNSFirewall } from './resources/dns-firewall/dns-firewall';
58import { DNS } from './resources/dns/dns';
59import { DurableObjects } from './resources/durable-objects/durable-objects';
60import { EmailRouting } from './resources/email-routing/email-routing';
61import { EmailSecurity } from './resources/email-security/email-security';
62import { Firewall } from './resources/firewall/firewall';
63import { Healthchecks } from './resources/healthchecks/healthchecks';
64import { Hostnames } from './resources/hostnames/hostnames';
65import { HyperdriveResource } from './resources/hyperdrive/hyperdrive';
66import { IAM } from './resources/iam/iam';
67import { Images } from './resources/images/images';
68import { Intel } from './resources/intel/intel';
69import { KV } from './resources/kv/kv';
70import { LeakedCredentialChecks } from './resources/leaked-credential-checks/leaked-credential-checks';
71import { LoadBalancers } from './resources/load-balancers/load-balancers';
72import { Logpush } from './resources/logpush/logpush';
73import { Logs } from './resources/logs/logs';
74import { MagicNetworkMonitoring } from './resources/magic-network-monitoring/magic-network-monitoring';
75import { MagicTransit } from './resources/magic-transit/magic-transit';
76import { MTLSCertificates } from './resources/mtls-certificates/mtls-certificates';
77import { OriginTLSClientAuth } from './resources/origin-tls-client-auth/origin-tls-client-auth';
78import { PageShield } from './resources/page-shield/page-shield';
79import { Pages } from './resources/pages/pages';
80import { Queues } from './resources/queues/queues';
81import { R2 } from './resources/r2/r2';
82import { Radar } from './resources/radar/radar';
83import { Registrar } from './resources/registrar/registrar';
84import { RequestTracers } from './resources/request-tracers/request-tracers';
85import { ResourceSharing } from './resources/resource-sharing/resource-sharing';
86import { Rules } from './resources/rules/rules';
87import { Rulesets } from './resources/rulesets/rulesets';
88import { RUM } from './resources/rum/rum';
89import { Snippets } from './resources/snippets/snippets';
90import { Spectrum } from './resources/spectrum/spectrum';
91import { Speed } from './resources/speed/speed';
92import { SSL } from './resources/ssl/ssl';
93import { Stream } from './resources/stream/stream';
94import { Turnstile } from './resources/turnstile/turnstile';
95import { URLScanner } from './resources/url-scanner/url-scanner';
96import { User } from './resources/user/user';
97import { Vectorize } from './resources/vectorize/vectorize';
98import { WaitingRooms } from './resources/waiting-rooms/waiting-rooms';
99import { Web3 } from './resources/web3/web3';
100import { WorkersForPlatforms } from './resources/workers-for-platforms/workers-for-platforms';
101import { Workers } from './resources/workers/workers';
102import { Workflows } from './resources/workflows/workflows';
103import { ZeroTrust } from './resources/zero-trust/zero-trust';
104import { Zones } from './resources/zones/zones';
105
106export interface ClientOptions {
107 /**
108 * The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).
109 */
110 apiToken?: string | null | undefined;
111
112 /**
113 * The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
114 */
115 apiKey?: string | null | undefined;
116
117 /**
118 * The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
119 */
120 apiEmail?: string | null | undefined;
121
122 /**
123 * Used when interacting with the Origin CA certificates API. [View/change your key](https://developers.cloudflare.com/fundamentals/api/get-started/ca-keys/#viewchange-your-origin-ca-keys).
124 */
125 userServiceKey?: string | null | undefined;
126
127 /**
128 * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
129 *
130 * Defaults to process.env['CLOUDFLARE_BASE_URL'].
131 */
132 baseURL?: string | null | undefined;
133
134 /**
135 * The maximum amount of time (in milliseconds) that the client should wait for a response
136 * from the server before timing out a single request.
137 *
138 * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
139 * much longer than this timeout before the promise succeeds or fails.
140 */
141 timeout?: number;
142
143 /**
144 * An HTTP agent used to manage HTTP(S) connections.
145 *
146 * If not provided, an agent will be constructed by default in the Node.js environment,
147 * otherwise no agent is used.
148 */
149 httpAgent?: Agent;
150
151 /**
152 * Specify a custom `fetch` function implementation.
153 *
154 * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
155 * defined globally.
156 */
157 fetch?: Core.Fetch | undefined;
158
159 /**
160 * The maximum number of times that the client will retry a request in case of a
161 * temporary failure, like a network error or a 5XX error from the server.
162 *
163 * @default 2
164 */
165 maxRetries?: number;
166
167 /**
168 * Default headers to include with every request to the API.
169 *
170 * These can be removed in individual requests by explicitly setting the
171 * header to `undefined` or `null` in request options.
172 */
173 defaultHeaders?: Core.Headers;
174
175 /**
176 * Default query parameters to include with every request to the API.
177 *
178 * These can be removed in individual requests by explicitly setting the
179 * param to `undefined` in request options.
180 */
181 defaultQuery?: Core.DefaultQuery;
182}
183
184/**
185 * API Client for interfacing with the Cloudflare API.
186 */
187export class Cloudflare extends Core.APIClient {
188 apiToken: string | null;
189 apiKey: string | null;
190 apiEmail: string | null;
191 userServiceKey: string | null;
192
193 private _options: ClientOptions;
194
195 /**
196 * API Client for interfacing with the Cloudflare API.
197 *
198 * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null]
199 * @param {string | null | undefined} [opts.apiKey=process.env['CLOUDFLARE_API_KEY'] ?? null]
200 * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null]
201 * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null]
202 * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API.
203 * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
204 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
205 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
206 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
207 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
208 * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
209 */
210 constructor({
211 baseURL = Core.readEnv('CLOUDFLARE_BASE_URL'),
212 apiToken = Core.readEnv('CLOUDFLARE_API_TOKEN') ?? null,
213 apiKey = Core.readEnv('CLOUDFLARE_API_KEY') ?? null,
214 apiEmail = Core.readEnv('CLOUDFLARE_EMAIL') ?? null,
215 userServiceKey = Core.readEnv('CLOUDFLARE_API_USER_SERVICE_KEY') ?? null,
216 ...opts
217 }: ClientOptions = {}) {
218 const options: ClientOptions = {
219 apiToken,
220 apiKey,
221 apiEmail,
222 userServiceKey,
223 ...opts,
224 baseURL: baseURL || `https://api.cloudflare.com/client/v4`,
225 };
226
227 super({
228 baseURL: options.baseURL!,
229 timeout: options.timeout ?? 60000 /* 1 minute */,
230 httpAgent: options.httpAgent,
231 maxRetries: options.maxRetries,
232 fetch: options.fetch,
233 });
234
235 this._options = options;
236
237 this.apiToken = apiToken;
238 this.apiKey = apiKey;
239 this.apiEmail = apiEmail;
240 this.userServiceKey = userServiceKey;
241 }
242
243 accounts: API.Accounts = new API.Accounts(this);
244 originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this);
245 ips: API.IPs = new API.IPs(this);
246 memberships: API.Memberships = new API.Memberships(this);
247 user: API.User = new API.User(this);
248 zones: API.Zones = new API.Zones(this);
249 loadBalancers: API.LoadBalancers = new API.LoadBalancers(this);
250 cache: API.Cache = new API.Cache(this);
251 ssl: API.SSL = new API.SSL(this);
252 acm: API.ACM = new API.ACM(this);
253 argo: API.Argo = new API.Argo(this);
254 certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this);
255 clientCertificates: API.ClientCertificates = new API.ClientCertificates(this);
256 customCertificates: API.CustomCertificates = new API.CustomCertificates(this);
257 customHostnames: API.CustomHostnames = new API.CustomHostnames(this);
258 customNameservers: API.CustomNameservers = new API.CustomNameservers(this);
259 dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this);
260 dns: API.DNS = new API.DNS(this);
261 emailSecurity: API.EmailSecurity = new API.EmailSecurity(this);
262 emailRouting: API.EmailRouting = new API.EmailRouting(this);
263 filters: API.Filters = new API.Filters(this);
264 firewall: API.Firewall = new API.Firewall(this);
265 healthchecks: API.Healthchecks = new API.Healthchecks(this);
266 keylessCertificates: API.KeylessCertificates = new API.KeylessCertificates(this);
267 logpush: API.Logpush = new API.Logpush(this);
268 logs: API.Logs = new API.Logs(this);
269 originTLSClientAuth: API.OriginTLSClientAuth = new API.OriginTLSClientAuth(this);
270 pagerules: API.Pagerules = new API.Pagerules(this);
271 rateLimits: API.RateLimits = new API.RateLimits(this);
272 waitingRooms: API.WaitingRooms = new API.WaitingRooms(this);
273 web3: API.Web3 = new API.Web3(this);
274 workers: API.Workers = new API.Workers(this);
275 kv: API.KV = new API.KV(this);
276 durableObjects: API.DurableObjects = new API.DurableObjects(this);
277 queues: API.Queues = new API.Queues(this);
278 apiGateway: API.APIGateway = new API.APIGateway(this);
279 managedTransforms: API.ManagedTransforms = new API.ManagedTransforms(this);
280 pageShield: API.PageShield = new API.PageShield(this);
281 rulesets: API.Rulesets = new API.Rulesets(this);
282 urlNormalization: API.URLNormalization = new API.URLNormalization(this);
283 spectrum: API.Spectrum = new API.Spectrum(this);
284 addressing: API.Addressing = new API.Addressing(this);
285 auditLogs: API.AuditLogs = new API.AuditLogs(this);
286 billing: API.Billing = new API.Billing(this);
287 brandProtection: API.BrandProtection = new API.BrandProtection(this);
288 diagnostics: API.Diagnostics = new API.Diagnostics(this);
289 images: API.Images = new API.Images(this);
290 intel: API.Intel = new API.Intel(this);
291 magicTransit: API.MagicTransit = new API.MagicTransit(this);
292 magicNetworkMonitoring: API.MagicNetworkMonitoring = new API.MagicNetworkMonitoring(this);
293 mtlsCertificates: API.MTLSCertificates = new API.MTLSCertificates(this);
294 pages: API.Pages = new API.Pages(this);
295 registrar: API.Registrar = new API.Registrar(this);
296 requestTracers: API.RequestTracers = new API.RequestTracers(this);
297 rules: API.Rules = new API.Rules(this);
298 stream: API.Stream = new API.Stream(this);
299 alerting: API.Alerting = new API.Alerting(this);
300 d1: API.D1Resource = new API.D1Resource(this);
301 r2: API.R2 = new API.R2(this);
302 workersForPlatforms: API.WorkersForPlatforms = new API.WorkersForPlatforms(this);
303 zeroTrust: API.ZeroTrust = new API.ZeroTrust(this);
304 turnstile: API.Turnstile = new API.Turnstile(this);
305 hyperdrive: API.HyperdriveResource = new API.HyperdriveResource(this);
306 rum: API.RUM = new API.RUM(this);
307 vectorize: API.Vectorize = new API.Vectorize(this);
308 urlScanner: API.URLScanner = new API.URLScanner(this);
309 radar: API.Radar = new API.Radar(this);
310 botManagement: API.BotManagement = new API.BotManagement(this);
311 originPostQuantumEncryption: API.OriginPostQuantumEncryption = new API.OriginPostQuantumEncryption(this);
312 speed: API.Speed = new API.Speed(this);
313 dcvDelegation: API.DCVDelegation = new API.DCVDelegation(this);
314 hostnames: API.Hostnames = new API.Hostnames(this);
315 snippets: API.Snippets = new API.Snippets(this);
316 calls: API.Calls = new API.Calls(this);
317 cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this);
318 aiGateway: API.AIGateway = new API.AIGateway(this);
319 iam: API.IAM = new API.IAM(this);
320 cloudConnector: API.CloudConnector = new API.CloudConnector(this);
321 botnetFeed: API.BotnetFeed = new API.BotnetFeed(this);
322 securityTXT: API.SecurityTXT = new API.SecurityTXT(this);
323 workflows: API.Workflows = new API.Workflows(this);
324 resourceSharing: API.ResourceSharing = new API.ResourceSharing(this);
325 leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this);
326 contentScanning: API.ContentScanning = new API.ContentScanning(this);
327
328 protected override defaultQuery(): Core.DefaultQuery | undefined {
329 return this._options.defaultQuery;
330 }
331
332 protected override defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers {
333 return {
334 ...super.defaultHeaders(opts),
335 'X-Auth-Key': this.apiKey,
336 'X-Auth-Email': this.apiEmail,
337 ...this._options.defaultHeaders,
338 };
339 }
340
341 protected override validateHeaders(headers: Core.Headers, customHeaders: Core.Headers) {
342 if (this.apiEmail && headers['x-auth-email']) {
343 return;
344 }
345 if (customHeaders['x-auth-email'] === null) {
346 return;
347 }
348
349 if (this.apiKey && headers['x-auth-key']) {
350 return;
351 }
352 if (customHeaders['x-auth-key'] === null) {
353 return;
354 }
355
356 if (this.apiToken && headers['authorization']) {
357 return;
358 }
359 if (customHeaders['authorization'] === null) {
360 return;
361 }
362
363 if (this.userServiceKey && headers['x-auth-user-service-key']) {
364 return;
365 }
366 if (customHeaders['x-auth-user-service-key'] === null) {
367 return;
368 }
369
370 throw new Error(
371 'Could not resolve authentication method. Expected one of apiEmail, apiKey, apiToken or userServiceKey to be set. Or for one of the "X-Auth-Email", "X-Auth-Key", "Authorization" or "X-Auth-User-Service-Key" headers to be explicitly omitted',
372 );
373 }
374
375 protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
376 const apiEmailAuth = this.apiEmailAuth(opts);
377 const apiKeyAuth = this.apiKeyAuth(opts);
378 const apiTokenAuth = this.apiTokenAuth(opts);
379 const userServiceKeyAuth = this.userServiceKeyAuth(opts);
380
381 if (
382 apiEmailAuth != null &&
383 !Core.isEmptyObj(apiEmailAuth) &&
384 apiKeyAuth != null &&
385 !Core.isEmptyObj(apiKeyAuth)
386 ) {
387 return { ...apiEmailAuth, ...apiKeyAuth };
388 }
389
390 if (apiTokenAuth != null && !Core.isEmptyObj(apiTokenAuth)) {
391 return apiTokenAuth;
392 }
393
394 if (userServiceKeyAuth != null && !Core.isEmptyObj(userServiceKeyAuth)) {
395 return userServiceKeyAuth;
396 }
397 return {};
398 }
399
400 protected apiEmailAuth(opts: Core.FinalRequestOptions): Core.Headers {
401 if (this.apiEmail == null) {
402 return {};
403 }
404 return { 'X-Auth-Email': this.apiEmail };
405 }
406
407 protected apiKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
408 if (this.apiKey == null) {
409 return {};
410 }
411 return { 'X-Auth-Key': this.apiKey };
412 }
413
414 protected apiTokenAuth(opts: Core.FinalRequestOptions): Core.Headers {
415 if (this.apiToken == null) {
416 return {};
417 }
418 return { Authorization: `Bearer ${this.apiToken}` };
419 }
420
421 protected userServiceKeyAuth(opts: Core.FinalRequestOptions): Core.Headers {
422 if (this.userServiceKey == null) {
423 return {};
424 }
425 return { 'X-Auth-User-Service-Key': this.userServiceKey };
426 }
427
428 protected override stringifyQuery(query: Record<string, unknown>): string {
429 return qs.stringify(query, { allowDots: true, arrayFormat: 'repeat' });
430 }
431
432 static Cloudflare = this;
433 static DEFAULT_TIMEOUT = 60000; // 1 minute
434
435 static CloudflareError = Errors.CloudflareError;
436 static APIError = Errors.APIError;
437 static APIConnectionError = Errors.APIConnectionError;
438 static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
439 static APIUserAbortError = Errors.APIUserAbortError;
440 static NotFoundError = Errors.NotFoundError;
441 static ConflictError = Errors.ConflictError;
442 static RateLimitError = Errors.RateLimitError;
443 static BadRequestError = Errors.BadRequestError;
444 static AuthenticationError = Errors.AuthenticationError;
445 static InternalServerError = Errors.InternalServerError;
446 static PermissionDeniedError = Errors.PermissionDeniedError;
447 static UnprocessableEntityError = Errors.UnprocessableEntityError;
448
449 static toFile = Uploads.toFile;
450 static fileFromPath = Uploads.fileFromPath;
451}
452
453Cloudflare.Accounts = Accounts;
454Cloudflare.OriginCACertificates = OriginCACertificates;
455Cloudflare.IPs = IPs;
456Cloudflare.Memberships = Memberships;
457Cloudflare.User = User;
458Cloudflare.Zones = Zones;
459Cloudflare.LoadBalancers = LoadBalancers;
460Cloudflare.Cache = Cache;
461Cloudflare.SSL = SSL;
462Cloudflare.ACM = ACM;
463Cloudflare.Argo = Argo;
464Cloudflare.CertificateAuthorities = CertificateAuthorities;
465Cloudflare.ClientCertificates = ClientCertificates;
466Cloudflare.CustomCertificates = CustomCertificates;
467Cloudflare.CustomHostnames = CustomHostnames;
468Cloudflare.CustomNameservers = CustomNameservers;
469Cloudflare.DNSFirewall = DNSFirewall;
470Cloudflare.DNS = DNS;
471Cloudflare.EmailSecurity = EmailSecurity;
472Cloudflare.EmailRouting = EmailRouting;
473Cloudflare.Filters = Filters;
474Cloudflare.Firewall = Firewall;
475Cloudflare.Healthchecks = Healthchecks;
476Cloudflare.KeylessCertificates = KeylessCertificates;
477Cloudflare.Logpush = Logpush;
478Cloudflare.Logs = Logs;
479Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
480Cloudflare.Pagerules = Pagerules;
481Cloudflare.RateLimits = RateLimits;
482Cloudflare.WaitingRooms = WaitingRooms;
483Cloudflare.Web3 = Web3;
484Cloudflare.Workers = Workers;
485Cloudflare.KV = KV;
486Cloudflare.DurableObjects = DurableObjects;
487Cloudflare.Queues = Queues;
488Cloudflare.APIGateway = APIGateway;
489Cloudflare.ManagedTransforms = ManagedTransforms;
490Cloudflare.PageShield = PageShield;
491Cloudflare.Rulesets = Rulesets;
492Cloudflare.URLNormalization = URLNormalization;
493Cloudflare.Spectrum = Spectrum;
494Cloudflare.Addressing = Addressing;
495Cloudflare.AuditLogs = AuditLogs;
496Cloudflare.Billing = Billing;
497Cloudflare.BrandProtection = BrandProtection;
498Cloudflare.Diagnostics = Diagnostics;
499Cloudflare.Images = Images;
500Cloudflare.Intel = Intel;
501Cloudflare.MagicTransit = MagicTransit;
502Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
503Cloudflare.MTLSCertificates = MTLSCertificates;
504Cloudflare.Pages = Pages;
505Cloudflare.Registrar = Registrar;
506Cloudflare.RequestTracers = RequestTracers;
507Cloudflare.Rules = Rules;
508Cloudflare.Stream = Stream;
509Cloudflare.Alerting = Alerting;
510Cloudflare.D1Resource = D1Resource;
511Cloudflare.R2 = R2;
512Cloudflare.WorkersForPlatforms = WorkersForPlatforms;
513Cloudflare.ZeroTrust = ZeroTrust;
514Cloudflare.Turnstile = Turnstile;
515Cloudflare.HyperdriveResource = HyperdriveResource;
516Cloudflare.RUM = RUM;
517Cloudflare.Vectorize = Vectorize;
518Cloudflare.URLScanner = URLScanner;
519Cloudflare.Radar = Radar;
520Cloudflare.BotManagement = BotManagement;
521Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption;
522Cloudflare.Speed = Speed;
523Cloudflare.DCVDelegation = DCVDelegation;
524Cloudflare.Hostnames = Hostnames;
525Cloudflare.Snippets = Snippets;
526Cloudflare.Calls = Calls;
527Cloudflare.CloudforceOne = CloudforceOne;
528Cloudflare.AIGateway = AIGateway;
529Cloudflare.IAM = IAM;
530Cloudflare.CloudConnector = CloudConnector;
531Cloudflare.BotnetFeed = BotnetFeed;
532Cloudflare.SecurityTXT = SecurityTXT;
533Cloudflare.Workflows = Workflows;
534Cloudflare.ResourceSharing = ResourceSharing;
535Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
536Cloudflare.ContentScanning = ContentScanning;
537export declare namespace Cloudflare {
538 export type RequestOptions = Core.RequestOptions;
539
540 export import V4PagePagination = Pagination.V4PagePagination;
541 export {
542 type V4PagePaginationParams as V4PagePaginationParams,
543 type V4PagePaginationResponse as V4PagePaginationResponse,
544 };
545
546 export import V4PagePaginationArray = Pagination.V4PagePaginationArray;
547 export {
548 type V4PagePaginationArrayParams as V4PagePaginationArrayParams,
549 type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse,
550 };
551
552 export import CursorPagination = Pagination.CursorPagination;
553 export {
554 type CursorPaginationParams as CursorPaginationParams,
555 type CursorPaginationResponse as CursorPaginationResponse,
556 };
557
558 export import CursorLimitPagination = Pagination.CursorLimitPagination;
559 export {
560 type CursorLimitPaginationParams as CursorLimitPaginationParams,
561 type CursorLimitPaginationResponse as CursorLimitPaginationResponse,
562 };
563
564 export import SinglePage = Pagination.SinglePage;
565 export { type SinglePageResponse as SinglePageResponse };
566
567 export { Accounts as Accounts };
568
569 export { OriginCACertificates as OriginCACertificates };
570
571 export { IPs as IPs };
572
573 export { Memberships as Memberships };
574
575 export { User as User };
576
577 export { Zones as Zones };
578
579 export { LoadBalancers as LoadBalancers };
580
581 export { Cache as Cache };
582
583 export { SSL as SSL };
584
585 export { ACM as ACM };
586
587 export { Argo as Argo };
588
589 export { CertificateAuthorities as CertificateAuthorities };
590
591 export { ClientCertificates as ClientCertificates };
592
593 export { CustomCertificates as CustomCertificates };
594
595 export { CustomHostnames as CustomHostnames };
596
597 export { CustomNameservers as CustomNameservers };
598
599 export { DNSFirewall as DNSFirewall };
600
601 export { DNS as DNS };
602
603 export { EmailSecurity as EmailSecurity };
604
605 export { EmailRouting as EmailRouting };
606
607 export { Filters as Filters };
608
609 export { Firewall as Firewall };
610
611 export { Healthchecks as Healthchecks };
612
613 export { KeylessCertificates as KeylessCertificates };
614
615 export { Logpush as Logpush };
616
617 export { Logs as Logs };
618
619 export { OriginTLSClientAuth as OriginTLSClientAuth };
620
621 export { Pagerules as Pagerules };
622
623 export { RateLimits as RateLimits };
624
625 export { WaitingRooms as WaitingRooms };
626
627 export { Web3 as Web3 };
628
629 export { Workers as Workers };
630
631 export { KV as KV };
632
633 export { DurableObjects as DurableObjects };
634
635 export { Queues as Queues };
636
637 export { APIGateway as APIGateway };
638
639 export { ManagedTransforms as ManagedTransforms };
640
641 export { PageShield as PageShield };
642
643 export { Rulesets as Rulesets };
644
645 export { URLNormalization as URLNormalization };
646
647 export { Spectrum as Spectrum };
648
649 export { Addressing as Addressing };
650
651 export { AuditLogs as AuditLogs };
652
653 export { Billing as Billing };
654
655 export { BrandProtection as BrandProtection };
656
657 export { Diagnostics as Diagnostics };
658
659 export { Images as Images };
660
661 export { Intel as Intel };
662
663 export { MagicTransit as MagicTransit };
664
665 export { MagicNetworkMonitoring as MagicNetworkMonitoring };
666
667 export { MTLSCertificates as MTLSCertificates };
668
669 export { Pages as Pages };
670
671 export { Registrar as Registrar };
672
673 export { RequestTracers as RequestTracers };
674
675 export { Rules as Rules };
676
677 export { Stream as Stream };
678
679 export { Alerting as Alerting };
680
681 export { D1Resource as D1Resource };
682
683 export { R2 as R2 };
684
685 export { WorkersForPlatforms as WorkersForPlatforms };
686
687 export { ZeroTrust as ZeroTrust };
688
689 export { Turnstile as Turnstile };
690
691 export { HyperdriveResource as HyperdriveResource };
692
693 export { RUM as RUM };
694
695 export { Vectorize as Vectorize };
696
697 export { URLScanner as URLScanner };
698
699 export { Radar as Radar };
700
701 export { BotManagement as BotManagement };
702
703 export { OriginPostQuantumEncryption as OriginPostQuantumEncryption };
704
705 export { Speed as Speed };
706
707 export { DCVDelegation as DCVDelegation };
708
709 export { Hostnames as Hostnames };
710
711 export { Snippets as Snippets };
712
713 export { Calls as Calls };
714
715 export { CloudforceOne as CloudforceOne };
716
717 export { AIGateway as AIGateway };
718
719 export { IAM as IAM };
720
721 export { CloudConnector as CloudConnector };
722
723 export { BotnetFeed as BotnetFeed };
724
725 export { SecurityTXT as SecurityTXT };
726
727 export { Workflows as Workflows };
728
729 export { ResourceSharing as ResourceSharing };
730
731 export { LeakedCredentialChecks as LeakedCredentialChecks };
732
733 export { ContentScanning as ContentScanning };
734
735 export type ASN = API.ASN;
736 export type AuditLog = API.AuditLog;
737 export type CertificateCA = API.CertificateCA;
738 export type CertificateRequestType = API.CertificateRequestType;
739 export type CloudflareTunnel = API.CloudflareTunnel;
740 export type ErrorData = API.ErrorData;
741 export type Identifier = API.Identifier;
742 export type LoadBalancerPreview = API.LoadBalancerPreview;
743 export type Member = API.Member;
744 export type PaginationInfo = API.PaginationInfo;
745 export type Permission = API.Permission;
746 export type PermissionGrant = API.PermissionGrant;
747 export type RatePlan = API.RatePlan;
748 export type ResponseInfo = API.ResponseInfo;
749 export type Result = API.Result;
750 export type Role = API.Role;
751 export type SortDirection = API.SortDirection;
752 export type Subscription = API.Subscription;
753 export type SubscriptionComponent = API.SubscriptionComponent;
754 export type SubscriptionZone = API.SubscriptionZone;
755 export type Token = API.Token;
756 export type TokenConditionCIDRList = API.TokenConditionCIDRList;
757 export type TokenPolicy = API.TokenPolicy;
758 export type TokenValue = API.TokenValue;
759}
760
761export { toFile, fileFromPath } from './uploads';
762export {
763 CloudflareError,
764 APIError,
765 APIConnectionError,
766 APIConnectionTimeoutError,
767 APIUserAbortError,
768 NotFoundError,
769 ConflictError,
770 RateLimitError,
771 BadRequestError,
772 AuthenticationError,
773 InternalServerError,
774 PermissionDeniedError,
775 UnprocessableEntityError,
776} from './error';
777
778export default Cloudflare;
779