Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent 2747929 commit 090e4dd
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1266
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ea285caeae39e684b320c55cf658a1ce9360e7737d2a13bbf9782459709ec55c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1117455d139246587bb583bb4cb4c402c3757e6ab4ad31d325b6657ac6fa6a0b.yml
10 changes: 5 additions & 5 deletions tests/api-resources/hyperdrive/configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('resource configs', () => {
origin: {
database: 'postgres',
host: 'database.example.com',
port: 0,
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
Expand All @@ -40,7 +40,7 @@ describe('resource configs', () => {
origin: {
database: 'postgres',
host: 'database.example.com',
port: 0,
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
Expand All @@ -56,7 +56,7 @@ describe('resource configs', () => {
origin: {
database: 'postgres',
host: 'database.example.com',
port: 0,
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
Expand All @@ -78,7 +78,7 @@ describe('resource configs', () => {
origin: {
database: 'postgres',
host: 'database.example.com',
port: 0,
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('resource configs', () => {
origin: {
database: 'postgres',
host: 'database.example.com',
port: 0,
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/magic-transit/sites/sites.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('resource sites', () => {
connector_id: 'ac60d3d0435248289d446cedd870bcf4',
description: 'string',
ha_mode: true,
location: { lat: 'string', lon: 'string' },
location: { lat: '37.6192', lon: '122.3816' },
secondary_connector_id: '8d67040d3835dbcf46ce29da440dc482',
});
});
Expand All @@ -58,7 +58,7 @@ describe('resource sites', () => {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
connector_id: 'ac60d3d0435248289d446cedd870bcf4',
description: 'string',
location: { lat: 'string', lon: 'string' },
location: { lat: '37.6192', lon: '122.3816' },
name: 'site_1',
secondary_connector_id: '8d67040d3835dbcf46ce29da440dc482',
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/page-shield/connections.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('resource connections', () => {
export: 'csv',
hosts: 'blog.cloudflare.com,www.example*,*cloudflare.com',
order_by: 'first_seen_at',
page: 'string',
page: '2',
page_url: 'example.com/page,*/checkout,example.com/*,*checkout*',
per_page: 100,
prioritize_malicious: true,
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/page-shield/scripts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('resource scripts', () => {
export: 'csv',
hosts: 'blog.cloudflare.com,www.example*,*cloudflare.com',
order_by: 'first_seen_at',
page: 'string',
page: '2',
page_url: 'example.com/page,*/checkout,example.com/*,*checkout*',
per_page: 100,
prioritize_malicious: true,
Expand Down
46 changes: 44 additions & 2 deletions tests/api-resources/pagerules/pagerules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('resource pagerules', () => {
test.skip('create: only required params', async () => {
const responsePromise = cloudflare.pagerules.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{}],
actions: [{}, {}, {}],
targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -38,6 +38,20 @@ describe('resource pagerules', () => {
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
],
targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }],
priority: 0,
Expand All @@ -49,7 +63,7 @@ describe('resource pagerules', () => {
test.skip('update: only required params', async () => {
const responsePromise = cloudflare.pagerules.update('023e105f4ecef8ad9ca31a8372d0c353', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{}],
actions: [{}, {}, {}],
targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -73,6 +87,20 @@ describe('resource pagerules', () => {
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
],
targets: [{ constraint: { operator: 'matches', value: '*example.com/images/*' }, target: 'url' }],
priority: 0,
Expand Down Expand Up @@ -150,6 +178,20 @@ describe('resource pagerules', () => {
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
{
name: 'forward_url',
value: {
type: 'temporary',
url: 'http://www.example.com/somewhere/$1/astring/$2/anotherstring/$3',
},
},
],
priority: 0,
status: 'active',
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/radar/annotations/outages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('resource outages', () => {
await expect(
cloudflare.radar.annotations.outages.get(
{
asn: 0,
asn: 174,
dateEnd: '2023-09-01T11:41:33.782Z',
dateRange: '7d',
dateStart: '2023-09-01T11:41:33.782Z',
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/radar/bgp/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('resource routes', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
cloudflare.radar.bgp.routes.stats(
{ asn: 0, format: 'JSON', location: 'US' },
{ asn: 174, format: 'JSON', location: 'US' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Cloudflare.NotFoundError);
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('resource routes', () => {
await expect(
cloudflare.radar.bgp.routes.timeseries(
{
asn: 0,
asn: 174,
dateEnd: '2023-09-01T11:41:33.782Z',
dateRange: '7d',
dateStart: '2023-09-01T11:41:33.782Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('resource trafficAnomalies', () => {
await expect(
cloudflare.radar.trafficAnomalies.get(
{
asn: 0,
asn: 174,
dateEnd: '2023-09-01T11:41:33.782Z',
dateRange: '7d',
dateStart: '2023-09-01T11:41:33.782Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('resource httpTests', () => {
const responsePromise = cloudflare.zeroTrust.dex.httpTests.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', {
account_id: '01a7362d577a6c3019a474fd6f485823',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -32,8 +32,8 @@ describe('resource httpTests', () => {
const response = await cloudflare.zeroTrust.dex.httpTests.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', {
account_id: '01a7362d577a6c3019a474fd6f485823',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
colo: 'string',
deviceId: ['string', 'string', 'string'],
});
Expand Down
16 changes: 8 additions & 8 deletions tests/api-resources/zero-trust/dex/traceroute-tests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('resource tracerouteTests', () => {
{
account_id: '01a7362d577a6c3019a474fd6f485823',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
},
);
const rawResponse = await responsePromise.asResponse();
Expand All @@ -37,8 +37,8 @@ describe('resource tracerouteTests', () => {
{
account_id: '01a7362d577a6c3019a474fd6f485823',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
colo: 'string',
deviceId: ['string', 'string', 'string'],
},
Expand All @@ -53,8 +53,8 @@ describe('resource tracerouteTests', () => {
account_id: '01a7362d577a6c3019a474fd6f485823',
deviceId: 'string',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
},
);
const rawResponse = await responsePromise.asResponse();
Expand All @@ -74,8 +74,8 @@ describe('resource tracerouteTests', () => {
account_id: '01a7362d577a6c3019a474fd6f485823',
deviceId: 'string',
interval: 'minute',
timeEnd: 'string',
timeStart: 'string',
timeEnd: '1689606812000',
timeStart: '1689520412000',
},
);
});
Expand Down

0 comments on commit 090e4dd

Please sign in to comment.