cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
55849b2667173ad22825cba28fa9bb3f74a261d0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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