cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3d2fc132d5e8a5c08805fa9b1df9c63e2db466eb

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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