cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
d522ba22e23da8afda28422084b495da8bf5ce25

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

845lines · 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
485export {
486 CloudflareError,
487 APIError,
488 APIConnectionError,
489 APIConnectionTimeoutError,
490 APIUserAbortError,
491 NotFoundError,
492 ConflictError,
493 RateLimitError,
494 BadRequestError,
495 AuthenticationError,
496 InternalServerError,
497 PermissionDeniedError,
498 UnprocessableEntityError,
499} from './error';
500
501export import toFile = Uploads.toFile;
502export import fileFromPath = Uploads.fileFromPath;
503
504Cloudflare.Accounts = Accounts;
505Cloudflare.OriginCACertificates = OriginCACertificates;
506Cloudflare.IPs = IPs;
507Cloudflare.Memberships = Memberships;
508Cloudflare.User = User;
509Cloudflare.Zones = Zones;
510Cloudflare.LoadBalancers = LoadBalancers;
511Cloudflare.Cache = Cache;
512Cloudflare.SSL = SSL;
513Cloudflare.ACM = ACM;
514Cloudflare.Argo = Argo;
515Cloudflare.CertificateAuthorities = CertificateAuthorities;
516Cloudflare.ClientCertificates = ClientCertificates;
517Cloudflare.CustomCertificates = CustomCertificates;
518Cloudflare.CustomHostnames = CustomHostnames;
519Cloudflare.CustomNameservers = CustomNameservers;
520Cloudflare.DNS = DNS;
521Cloudflare.DNSSECResource = DNSSECResource;
522Cloudflare.EmailSecurity = EmailSecurity;
523Cloudflare.EmailRouting = EmailRouting;
524Cloudflare.Filters = Filters;
525Cloudflare.Firewall = Firewall;
526Cloudflare.Healthchecks = Healthchecks;
527Cloudflare.KeylessCertificates = KeylessCertificates;
528Cloudflare.Logpush = Logpush;
529Cloudflare.Logs = Logs;
530Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
531Cloudflare.Pagerules = Pagerules;
532Cloudflare.RateLimits = RateLimits;
533Cloudflare.SecondaryDNS = SecondaryDNS;
534Cloudflare.WaitingRooms = WaitingRooms;
535Cloudflare.Web3 = Web3;
536Cloudflare.Workers = Workers;
537Cloudflare.KV = KV;
538Cloudflare.DurableObjects = DurableObjects;
539Cloudflare.Queues = Queues;
540Cloudflare.APIGateway = APIGateway;
541Cloudflare.ManagedTransforms = ManagedTransforms;
542Cloudflare.PageShield = PageShield;
543Cloudflare.Rulesets = Rulesets;
544Cloudflare.URLNormalization = URLNormalization;
545Cloudflare.Spectrum = Spectrum;
546Cloudflare.Addressing = Addressing;
547Cloudflare.AuditLogs = AuditLogs;
548Cloudflare.Billing = Billing;
549Cloudflare.BrandProtection = BrandProtection;
550Cloudflare.Diagnostics = Diagnostics;
551Cloudflare.Images = Images;
552Cloudflare.Intel = Intel;
553Cloudflare.MagicTransit = MagicTransit;
554Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring;
555Cloudflare.MTLSCertificates = MTLSCertificates;
556Cloudflare.Pages = Pages;
557Cloudflare.Registrar = Registrar;
558Cloudflare.RequestTracers = RequestTracers;
559Cloudflare.Rules = Rules;
560Cloudflare.Storage = Storage;
561Cloudflare.Stream = Stream;
562Cloudflare.Alerting = Alerting;
563Cloudflare.D1Resource = D1Resource;
564Cloudflare.R2 = R2;
565Cloudflare.WARPConnector = WARPConnector;
566Cloudflare.WorkersForPlatforms = WorkersForPlatforms;
567Cloudflare.ZeroTrust = ZeroTrust;
568Cloudflare.Turnstile = Turnstile;
569Cloudflare.HyperdriveResource = HyperdriveResource;
570Cloudflare.RUM = RUM;
571Cloudflare.Vectorize = Vectorize;
572Cloudflare.URLScanner = URLScanner;
573Cloudflare.Radar = Radar;
574Cloudflare.BotManagement = BotManagement;
575Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption;
576Cloudflare.Speed = Speed;
577Cloudflare.DCVDelegation = DCVDelegation;
578Cloudflare.Hostnames = Hostnames;
579Cloudflare.Snippets = Snippets;
580Cloudflare.Calls = Calls;
581Cloudflare.CloudforceOne = CloudforceOne;
582Cloudflare.AIGateway = AIGateway;
583Cloudflare.IAM = IAM;
584Cloudflare.CloudConnector = CloudConnector;
585Cloudflare.BotnetFeed = BotnetFeed;
586Cloudflare.SecurityTXT = SecurityTXT;
587Cloudflare.Workflows = Workflows;
588Cloudflare.WorkflowListResponsesV4PagePaginationArray = WorkflowListResponsesV4PagePaginationArray;
589Cloudflare.ResourceSharing = ResourceSharing;
590Cloudflare.ResourceSharingListResponsesV4PagePaginationArray =
591 ResourceSharingListResponsesV4PagePaginationArray;
592
593export declare namespace Cloudflare {
594 export type RequestOptions = Core.RequestOptions;
595
596 export import V4PagePagination = Pagination.V4PagePagination;
597 export {
598 type V4PagePaginationParams as V4PagePaginationParams,
599 type V4PagePaginationResponse as V4PagePaginationResponse,
600 };
601
602 export import V4PagePaginationArray = Pagination.V4PagePaginationArray;
603 export {
604 type V4PagePaginationArrayParams as V4PagePaginationArrayParams,
605 type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse,
606 };
607
608 export import CursorPagination = Pagination.CursorPagination;
609 export {
610 type CursorPaginationParams as CursorPaginationParams,
611 type CursorPaginationResponse as CursorPaginationResponse,
612 };
613
614 export import CursorLimitPagination = Pagination.CursorLimitPagination;
615 export {
616 type CursorLimitPaginationParams as CursorLimitPaginationParams,
617 type CursorLimitPaginationResponse as CursorLimitPaginationResponse,
618 };
619
620 export import SinglePage = Pagination.SinglePage;
621 export { type SinglePageResponse as SinglePageResponse };
622
623 export { Accounts as Accounts };
624
625 export { OriginCACertificates as OriginCACertificates };
626
627 export { IPs as IPs };
628
629 export { Memberships as Memberships };
630
631 export { User as User };
632
633 export { Zones as Zones };
634
635 export { LoadBalancers as LoadBalancers };
636
637 export { Cache as Cache };
638
639 export { SSL as SSL };
640
641 export { ACM as ACM };
642
643 export { Argo as Argo };
644
645 export { CertificateAuthorities as CertificateAuthorities };
646
647 export { ClientCertificates as ClientCertificates };
648
649 export { CustomCertificates as CustomCertificates };
650
651 export { CustomHostnames as CustomHostnames };
652
653 export { CustomNameservers as CustomNameservers };
654
655 export { DNS as DNS };
656
657 export { DNSSECResource as DNSSECResource };
658
659 export { EmailSecurity as EmailSecurity };
660
661 export { EmailRouting as EmailRouting };
662
663 export { Filters as Filters };
664
665 export { Firewall as Firewall };
666
667 export { Healthchecks as Healthchecks };
668
669 export { KeylessCertificates as KeylessCertificates };
670
671 export { Logpush as Logpush };
672
673 export { Logs as Logs };
674
675 export { OriginTLSClientAuth as OriginTLSClientAuth };
676
677 export { Pagerules as Pagerules };
678
679 export { RateLimits as RateLimits };
680
681 export { SecondaryDNS as SecondaryDNS };
682
683 export { WaitingRooms as WaitingRooms };
684
685 export { Web3 as Web3 };
686
687 export { Workers as Workers };
688
689 export { KV as KV };
690
691 export { DurableObjects as DurableObjects };
692
693 export { Queues as Queues };
694
695 export { APIGateway as APIGateway };
696
697 export { ManagedTransforms as ManagedTransforms };
698
699 export { PageShield as PageShield };
700
701 export { Rulesets as Rulesets };
702
703 export { URLNormalization as URLNormalization };
704
705 export { Spectrum as Spectrum };
706
707 export { Addressing as Addressing };
708
709 export { AuditLogs as AuditLogs };
710
711 export { Billing as Billing };
712
713 export { BrandProtection as BrandProtection };
714
715 export { Diagnostics as Diagnostics };
716
717 export { Images as Images };
718
719 export { Intel as Intel };
720
721 export { MagicTransit as MagicTransit };
722
723 export { MagicNetworkMonitoring as MagicNetworkMonitoring };
724
725 export { MTLSCertificates as MTLSCertificates };
726
727 export { Pages as Pages };
728
729 export { Registrar as Registrar };
730
731 export { RequestTracers as RequestTracers };
732
733 export { Rules as Rules };
734
735 export { Storage as Storage };
736
737 export { Stream as Stream };
738
739 export { Alerting as Alerting };
740
741 export { D1Resource as D1Resource };
742
743 export { R2 as R2 };
744
745 export { WARPConnector as WARPConnector };
746
747 export { WorkersForPlatforms as WorkersForPlatforms };
748
749 export { ZeroTrust as ZeroTrust };
750
751 export { Turnstile as Turnstile };
752
753 export { HyperdriveResource as HyperdriveResource };
754
755 export { RUM as RUM };
756
757 export { Vectorize as Vectorize };
758
759 export { URLScanner as URLScanner };
760
761 export { Radar as Radar };
762
763 export { BotManagement as BotManagement };
764
765 export { OriginPostQuantumEncryption as OriginPostQuantumEncryption };
766
767 export { Speed as Speed };
768
769 export { DCVDelegation as DCVDelegation };
770
771 export { Hostnames as Hostnames };
772
773 export { Snippets as Snippets };
774
775 export { Calls as Calls };
776
777 export { CloudforceOne as CloudforceOne };
778
779 export { AIGateway as AIGateway };
780
781 export { IAM as IAM };
782
783 export { CloudConnector as CloudConnector };
784
785 export { BotnetFeed as BotnetFeed };
786
787 export {
788 SecurityTXT as SecurityTXT,
789 type SecurityTXTUpdateResponse as SecurityTXTUpdateResponse,
790 type SecurityTXTDeleteResponse as SecurityTXTDeleteResponse,
791 type SecurityTXTGetResponse as SecurityTXTGetResponse,
792 type SecurityTXTUpdateParams as SecurityTXTUpdateParams,
793 type SecurityTXTDeleteParams as SecurityTXTDeleteParams,
794 type SecurityTXTGetParams as SecurityTXTGetParams,
795 };
796
797 export {
798 Workflows as Workflows,
799 type WorkflowUpdateResponse as WorkflowUpdateResponse,
800 type WorkflowListResponse as WorkflowListResponse,
801 type WorkflowGetResponse as WorkflowGetResponse,
802 WorkflowListResponsesV4PagePaginationArray as WorkflowListResponsesV4PagePaginationArray,
803 type WorkflowUpdateParams as WorkflowUpdateParams,
804 type WorkflowListParams as WorkflowListParams,
805 type WorkflowGetParams as WorkflowGetParams,
806 };
807
808 export {
809 ResourceSharing as ResourceSharing,
810 type ResourceSharingCreateResponse as ResourceSharingCreateResponse,
811 type ResourceSharingUpdateResponse as ResourceSharingUpdateResponse,
812 type ResourceSharingListResponse as ResourceSharingListResponse,
813 type ResourceSharingDeleteResponse as ResourceSharingDeleteResponse,
814 type ResourceSharingGetResponse as ResourceSharingGetResponse,
815 ResourceSharingListResponsesV4PagePaginationArray as ResourceSharingListResponsesV4PagePaginationArray,
816 type ResourceSharingCreateParams as ResourceSharingCreateParams,
817 type ResourceSharingUpdateParams as ResourceSharingUpdateParams,
818 type ResourceSharingListParams as ResourceSharingListParams,
819 type ResourceSharingDeleteParams as ResourceSharingDeleteParams,
820 type ResourceSharingGetParams as ResourceSharingGetParams,
821 };
822
823 export type ASN = API.ASN;
824 export type AuditLog = API.AuditLog;
825 export type CertificateCA = API.CertificateCA;
826 export type CertificateRequestType = API.CertificateRequestType;
827 export type CloudflareTunnel = API.CloudflareTunnel;
828 export type ErrorData = API.ErrorData;
829 export type Identifier = API.Identifier;
830 export type LoadBalancerPreview = API.LoadBalancerPreview;
831 export type Member = API.Member;
832 export type PaginationInfo = API.PaginationInfo;
833 export type Permission = API.Permission;
834 export type PermissionGrant = API.PermissionGrant;
835 export type RatePlan = API.RatePlan;
836 export type ResponseInfo = API.ResponseInfo;
837 export type Result = API.Result;
838 export type Role = API.Role;
839 export type SortDirection = API.SortDirection;
840 export type Subscription = API.Subscription;
841 export type SubscriptionComponent = API.SubscriptionComponent;
842 export type SubscriptionZone = API.SubscriptionZone;
843}
844
845export default Cloudflare;
846