cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
cddc5fd8e12a7ead25665f415d3e250bf2ea36f9

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/index.ts

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