Skip to content

Commit a240853

Browse files
chore(api): update composite API spec
1 parent 7dc3f58 commit a240853

File tree

10 files changed

+84
-34
lines changed

10 files changed

+84
-34
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1940
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5fc91fe703941755eabe8e53f6d53056d31c38bff2f098dfa2389512e52b586f.yml
3-
openapi_spec_hash: 7d4707f46e5b07408d6a083bfe164f51
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d3b3813ba8fb0b5303cfad8fcbd363941c494711e4cce61069553692b664774f.yml
3+
openapi_spec_hash: 4f467a53fd61500db4f7561dcfaaa088
44
config_hash: 3e9cdaaf8fbff19639d218f89b85a116

src/resources/load-balancers/monitors/monitors.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export interface Monitor {
240240
* SMTP checks. HTTP and HTTPS checks should only define the port when using a
241241
* non-standard port (HTTP: default 80, HTTPS: default 443).
242242
*/
243-
port?: number;
243+
port?: number | null;
244244

245245
/**
246246
* Assign this monitor to emulate the specified zone while probing. This parameter
@@ -350,7 +350,7 @@ export interface MonitorCreateParams {
350350
* TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port
351351
* when using a non-standard port (HTTP: default 80, HTTPS: default 443).
352352
*/
353-
port?: number;
353+
port?: number | null;
354354

355355
/**
356356
* Body param: Assign this monitor to emulate the specified zone while probing.
@@ -456,7 +456,7 @@ export interface MonitorUpdateParams {
456456
* TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port
457457
* when using a non-standard port (HTTP: default 80, HTTPS: default 443).
458458
*/
459-
port?: number;
459+
port?: number | null;
460460

461461
/**
462462
* Body param: Assign this monitor to emulate the specified zone while probing.
@@ -576,7 +576,7 @@ export interface MonitorEditParams {
576576
* TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port
577577
* when using a non-standard port (HTTP: default 80, HTTPS: default 443).
578578
*/
579-
port?: number;
579+
port?: number | null;
580580

581581
/**
582582
* Body param: Assign this monitor to emulate the specified zone while probing.

src/resources/load-balancers/monitors/previews.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export interface PreviewCreateParams {
121121
* TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port
122122
* when using a non-standard port (HTTP: default 80, HTTPS: default 443).
123123
*/
124-
port?: number;
124+
port?: number | null;
125125

126126
/**
127127
* Body param: Assign this monitor to emulate the specified zone while probing.

src/resources/load-balancers/pools/health.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export interface HealthCreateParams {
206206
* TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port
207207
* when using a non-standard port (HTTP: default 80, HTTPS: default 443).
208208
*/
209-
port?: number;
209+
port?: number | null;
210210

211211
/**
212212
* Body param: Assign this monitor to emulate the specified zone while probing.

src/resources/load-balancers/pools/pools.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export interface Pool {
227227
/**
228228
* Configures load shedding policies and percentages for the pool.
229229
*/
230-
load_shedding?: LoadBalancersAPI.LoadShedding;
230+
load_shedding?: LoadBalancersAPI.LoadShedding | null;
231231

232232
/**
233233
* The longitude of the data center containing the origins used in this pool in
@@ -286,7 +286,7 @@ export interface Pool {
286286
* Configures origin steering for the pool. Controls how origins are selected for
287287
* new sessions and traffic without session affinity.
288288
*/
289-
origin_steering?: LoadBalancersAPI.OriginSteering;
289+
origin_steering?: LoadBalancersAPI.OriginSteering | null;
290290

291291
/**
292292
* The list of origins within this pool. Traffic directed at this pool is balanced
@@ -339,7 +339,7 @@ export interface PoolCreateParams {
339339
/**
340340
* Body param: Configures load shedding policies and percentages for the pool.
341341
*/
342-
load_shedding?: LoadBalancersAPI.LoadSheddingParam;
342+
load_shedding?: LoadBalancersAPI.LoadSheddingParam | null;
343343

344344
/**
345345
* Body param: The longitude of the data center containing the origins used in this
@@ -385,7 +385,7 @@ export interface PoolCreateParams {
385385
* Body param: Configures origin steering for the pool. Controls how origins are
386386
* selected for new sessions and traffic without session affinity.
387387
*/
388-
origin_steering?: LoadBalancersAPI.OriginSteeringParam;
388+
origin_steering?: LoadBalancersAPI.OriginSteeringParam | null;
389389
}
390390

391391
export interface PoolUpdateParams {
@@ -434,7 +434,7 @@ export interface PoolUpdateParams {
434434
/**
435435
* Body param: Configures load shedding policies and percentages for the pool.
436436
*/
437-
load_shedding?: LoadBalancersAPI.LoadSheddingParam;
437+
load_shedding?: LoadBalancersAPI.LoadSheddingParam | null;
438438

439439
/**
440440
* Body param: The longitude of the data center containing the origins used in this
@@ -480,7 +480,7 @@ export interface PoolUpdateParams {
480480
* Body param: Configures origin steering for the pool. Controls how origins are
481481
* selected for new sessions and traffic without session affinity.
482482
*/
483-
origin_steering?: LoadBalancersAPI.OriginSteeringParam;
483+
origin_steering?: LoadBalancersAPI.OriginSteeringParam | null;
484484
}
485485

486486
export interface PoolListParams {
@@ -550,7 +550,7 @@ export interface PoolEditParams {
550550
/**
551551
* Body param: Configures load shedding policies and percentages for the pool.
552552
*/
553-
load_shedding?: LoadBalancersAPI.LoadSheddingParam;
553+
load_shedding?: LoadBalancersAPI.LoadSheddingParam | null;
554554

555555
/**
556556
* Body param: The longitude of the data center containing the origins used in this
@@ -602,7 +602,7 @@ export interface PoolEditParams {
602602
* Body param: Configures origin steering for the pool. Controls how origins are
603603
* selected for new sessions and traffic without session affinity.
604604
*/
605-
origin_steering?: LoadBalancersAPI.OriginSteeringParam;
605+
origin_steering?: LoadBalancersAPI.OriginSteeringParam | null;
606606

607607
/**
608608
* Body param: The list of origins within this pool. Traffic directed at this pool

src/resources/radar/bots/web-crawlers.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,22 @@ export class WebCrawlers extends APIResource {
1212
* @example
1313
* ```ts
1414
* const response =
15-
* await client.radar.bots.webCrawlers.summary('USER_AGENT');
15+
* await client.radar.bots.webCrawlers.summary(
16+
* 'CLIENT_TYPE',
17+
* );
1618
* ```
1719
*/
1820
summary(
19-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
21+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
2022
query?: WebCrawlerSummaryParams,
2123
options?: Core.RequestOptions,
2224
): Core.APIPromise<WebCrawlerSummaryResponse>;
2325
summary(
24-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
26+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
2527
options?: Core.RequestOptions,
2628
): Core.APIPromise<WebCrawlerSummaryResponse>;
2729
summary(
28-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
30+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
2931
query: WebCrawlerSummaryParams | Core.RequestOptions = {},
3032
options?: Core.RequestOptions,
3133
): Core.APIPromise<WebCrawlerSummaryResponse> {
@@ -48,21 +50,21 @@ export class WebCrawlers extends APIResource {
4850
* ```ts
4951
* const response =
5052
* await client.radar.bots.webCrawlers.timeseriesGroups(
51-
* 'USER_AGENT',
53+
* 'CLIENT_TYPE',
5254
* );
5355
* ```
5456
*/
5557
timeseriesGroups(
56-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
58+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
5759
query?: WebCrawlerTimeseriesGroupsParams,
5860
options?: Core.RequestOptions,
5961
): Core.APIPromise<WebCrawlerTimeseriesGroupsResponse>;
6062
timeseriesGroups(
61-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
63+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
6264
options?: Core.RequestOptions,
6365
): Core.APIPromise<WebCrawlerTimeseriesGroupsResponse>;
6466
timeseriesGroups(
65-
dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
67+
dimension: 'CLIENT_TYPE' | 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO' | 'VERTICAL' | 'INDUSTRY',
6668
query: WebCrawlerTimeseriesGroupsParams | Core.RequestOptions = {},
6769
options?: Core.RequestOptions,
6870
): Core.APIPromise<WebCrawlerTimeseriesGroupsResponse> {
@@ -353,6 +355,11 @@ export interface WebCrawlerSummaryParams {
353355
*/
354356
botOperator?: Array<string>;
355357

358+
/**
359+
* Filters results by agent type.
360+
*/
361+
clientType?: Array<'HUMAN' | 'NON_AI_BOT' | 'AI_BOT' | 'MIXED_PURPOSE'>;
362+
356363
/**
357364
* End of the date range (inclusive).
358365
*/
@@ -411,6 +418,11 @@ export interface WebCrawlerTimeseriesGroupsParams {
411418
*/
412419
botOperator?: Array<string>;
413420

421+
/**
422+
* Filters results by agent type.
423+
*/
424+
clientType?: Array<'HUMAN' | 'NON_AI_BOT' | 'AI_BOT' | 'MIXED_PURPOSE'>;
425+
414426
/**
415427
* End of the date range (inclusive).
416428
*/

src/resources/zero-trust/gateway/lists/lists.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export interface GatewayList {
199199
/**
200200
* Specify the list type.
201201
*/
202-
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
202+
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP' | 'CATEGORY' | 'LOCATION' | 'DEVICE';
203203

204204
updated_at?: string;
205205
}
@@ -230,7 +230,7 @@ export interface ListCreateResponse {
230230
/**
231231
* Specify the list type.
232232
*/
233-
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
233+
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP' | 'CATEGORY' | 'LOCATION' | 'DEVICE';
234234

235235
updated_at?: string;
236236
}
@@ -251,7 +251,7 @@ export interface ListCreateParams {
251251
/**
252252
* Body param: Specify the list type.
253253
*/
254-
type: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
254+
type: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP' | 'CATEGORY' | 'LOCATION' | 'DEVICE';
255255

256256
/**
257257
* Body param: Provide the list description.
@@ -323,7 +323,7 @@ export interface ListListParams {
323323
/**
324324
* Query param: Specify the list type.
325325
*/
326-
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP';
326+
type?: 'SERIAL' | 'URL' | 'DOMAIN' | 'EMAIL' | 'IP' | 'CATEGORY' | 'LOCATION' | 'DEVICE';
327327
}
328328

329329
export interface ListDeleteParams {

src/resources/zero-trust/gateway/rules.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,12 @@ export interface RuleSetting {
536536
*/
537537
egress?: RuleSetting.Egress | null;
538538

539+
/**
540+
* Configure whether a copy of the HTTP request will be sent to storage when the
541+
* rule matches.
542+
*/
543+
forensic_copy?: RuleSetting.ForensicCopy | null;
544+
539545
/**
540546
* Ignore category matches at CNAME domains in a response. When off, evaluate
541547
* categories in this rule against all CNAME domain categories in the response.
@@ -782,6 +788,17 @@ export namespace RuleSetting {
782788
ipv6?: string;
783789
}
784790

791+
/**
792+
* Configure whether a copy of the HTTP request will be sent to storage when the
793+
* rule matches.
794+
*/
795+
export interface ForensicCopy {
796+
/**
797+
* Enable sending the copy to storage.
798+
*/
799+
enabled?: boolean;
800+
}
801+
785802
/**
786803
* Send matching traffic to the supplied destination IP address and port. Settable
787804
* only for `l4` rules with the action set to `l4_override`.
@@ -993,6 +1010,12 @@ export interface RuleSettingParam {
9931010
*/
9941011
egress?: RuleSettingParam.Egress | null;
9951012

1013+
/**
1014+
* Configure whether a copy of the HTTP request will be sent to storage when the
1015+
* rule matches.
1016+
*/
1017+
forensic_copy?: RuleSettingParam.ForensicCopy | null;
1018+
9961019
/**
9971020
* Ignore category matches at CNAME domains in a response. When off, evaluate
9981021
* categories in this rule against all CNAME domain categories in the response.
@@ -1239,6 +1262,17 @@ export namespace RuleSettingParam {
12391262
ipv6?: string;
12401263
}
12411264

1265+
/**
1266+
* Configure whether a copy of the HTTP request will be sent to storage when the
1267+
* rule matches.
1268+
*/
1269+
export interface ForensicCopy {
1270+
/**
1271+
* Enable sending the copy to storage.
1272+
*/
1273+
enabled?: boolean;
1274+
}
1275+
12421276
/**
12431277
* Send matching traffic to the supplied destination IP address and port. Settable
12441278
* only for `l4` rules with the action set to `l4_override`.

tests/api-resources/radar/bots/web-crawlers.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const client = new Cloudflare({
1111

1212
describe('resource webCrawlers', () => {
1313
test('summary', async () => {
14-
const responsePromise = client.radar.bots.webCrawlers.summary('USER_AGENT');
14+
const responsePromise = client.radar.bots.webCrawlers.summary('CLIENT_TYPE');
1515
const rawResponse = await responsePromise.asResponse();
1616
expect(rawResponse).toBeInstanceOf(Response);
1717
const response = await responsePromise;
@@ -24,17 +24,18 @@ describe('resource webCrawlers', () => {
2424
test('summary: request options instead of params are passed correctly', async () => {
2525
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2626
await expect(
27-
client.radar.bots.webCrawlers.summary('USER_AGENT', { path: '/_stainless_unknown_path' }),
27+
client.radar.bots.webCrawlers.summary('CLIENT_TYPE', { path: '/_stainless_unknown_path' }),
2828
).rejects.toThrow(Cloudflare.NotFoundError);
2929
});
3030

3131
test('summary: request options and params are passed correctly', async () => {
3232
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
3333
await expect(
3434
client.radar.bots.webCrawlers.summary(
35-
'USER_AGENT',
35+
'CLIENT_TYPE',
3636
{
3737
botOperator: ['string'],
38+
clientType: ['HUMAN'],
3839
dateEnd: ['2019-12-27T18:11:19.117Z'],
3940
dateRange: ['7d'],
4041
dateStart: ['2019-12-27T18:11:19.117Z'],
@@ -50,7 +51,7 @@ describe('resource webCrawlers', () => {
5051
});
5152

5253
test('timeseriesGroups', async () => {
53-
const responsePromise = client.radar.bots.webCrawlers.timeseriesGroups('USER_AGENT');
54+
const responsePromise = client.radar.bots.webCrawlers.timeseriesGroups('CLIENT_TYPE');
5455
const rawResponse = await responsePromise.asResponse();
5556
expect(rawResponse).toBeInstanceOf(Response);
5657
const response = await responsePromise;
@@ -63,18 +64,19 @@ describe('resource webCrawlers', () => {
6364
test('timeseriesGroups: request options instead of params are passed correctly', async () => {
6465
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
6566
await expect(
66-
client.radar.bots.webCrawlers.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }),
67+
client.radar.bots.webCrawlers.timeseriesGroups('CLIENT_TYPE', { path: '/_stainless_unknown_path' }),
6768
).rejects.toThrow(Cloudflare.NotFoundError);
6869
});
6970

7071
test('timeseriesGroups: request options and params are passed correctly', async () => {
7172
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
7273
await expect(
7374
client.radar.bots.webCrawlers.timeseriesGroups(
74-
'USER_AGENT',
75+
'CLIENT_TYPE',
7576
{
7677
aggInterval: '1h',
7778
botOperator: ['string'],
79+
clientType: ['HUMAN'],
7880
dateEnd: ['2019-12-27T18:11:19.117Z'],
7981
dateRange: ['7d'],
8082
dateStart: ['2019-12-27T18:11:19.117Z'],

tests/api-resources/zero-trust/gateway/rules.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe('resource rules', () => {
7979
],
8080
},
8181
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
82+
forensic_copy: { enabled: true },
8283
ignore_cname_category_matches: true,
8384
insecure_disable_dnssec_validation: false,
8485
ip_categories: true,
@@ -183,6 +184,7 @@ describe('resource rules', () => {
183184
],
184185
},
185186
egress: { ipv4: '192.0.2.2', ipv4_fallback: '192.0.2.3', ipv6: '2001:DB8::/64' },
187+
forensic_copy: { enabled: true },
186188
ignore_cname_category_matches: true,
187189
insecure_disable_dnssec_validation: false,
188190
ip_categories: true,

0 commit comments

Comments
 (0)