Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/api-resources/abuse-reports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const client = new Cloudflare({
describe('resource abuseReports', () => {
// TODO: investigate unauthorized HTTP response
test.skip('create: only required params', async () => {
const responsePromise = client.abuseReports.create('abuse_dmca', {
const responsePromise = client.abuseReports.create('abuse_general', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
address1: 'x',
agent_name: 'x',
Expand All @@ -36,7 +36,7 @@ describe('resource abuseReports', () => {

// TODO: investigate unauthorized HTTP response
test.skip('create: required and optional params', async () => {
const response = await client.abuseReports.create('abuse_dmca', {
const response = await client.abuseReports.create('abuse_general', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
address1: 'x',
agent_name: 'x',
Expand All @@ -48,7 +48,7 @@ describe('resource abuseReports', () => {
owner_notification: 'send',
signature: 'signature',
state: 'x',
act: 'abuse_dmca',
act: 'abuse_general',
comments: 'x',
company: 'x',
destination_ips: 'destination_ips',
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/accounts/accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('resource accounts', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
client.accounts.list(
{ direction: 'asc', name: 'example.com', page: 1, per_page: 5 },
{ direction: 'desc', name: 'example.com', page: 1, per_page: 5 },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Cloudflare.NotFoundError);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/accounts/logs/audit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('resource audit', () => {
actor_ip_address: '17.168.228.63',
actor_token_id: '144cdb2e39c55e203cf225d8d8208647',
actor_token_name: 'Test Token',
actor_type: 'cloudflare_admin',
actor_type: 'account',
audit_log_id: 'f174be97-19b1-40d6-954d-70cd5fbd52db',
cursor: 'Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==',
direction: 'desc',
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/accounts/members.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ describe('resource members', () => {
test('list: required and optional params', async () => {
const response = await client.accounts.members.list({
account_id: 'eb78d65290b24279ba6f44721b3ea3c4',
direction: 'asc',
order: 'user.first_name',
direction: 'desc',
order: 'status',
page: 1,
per_page: 5,
status: 'accepted',
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/accounts/subscriptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('resource subscriptions', () => {
test('create: required and optional params', async () => {
const response = await client.accounts.subscriptions.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
frequency: 'weekly',
frequency: 'monthly',
rate_plan: {
id: 'free',
currency: 'USD',
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('resource subscriptions', () => {
test('update: required and optional params', async () => {
const response = await client.accounts.subscriptions.update('506e3185e9c882d175a2d0cb0093d9f2', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
frequency: 'weekly',
frequency: 'monthly',
rate_plan: {
id: 'free',
currency: 'USD',
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/accounts/tokens/tokens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('resource tokens', () => {
test.skip('list: required and optional params', async () => {
const response = await client.accounts.tokens.list({
account_id: 'eb78d65290b24279ba6f44721b3ea3c4',
direction: 'asc',
direction: 'desc',
page: 1,
per_page: 5,
});
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/alerting/policies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('resource policies', () => {
test.skip('create: only required params', async () => {
const responsePromise = client.alerting.policies.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
alert_type: 'access_custom_certificate_expiration_type',
alert_type: 'universal_ssl_event_type',
enabled: true,
mechanisms: {},
name: 'SSL Notification Event Policy',
Expand All @@ -32,7 +32,7 @@ describe('resource policies', () => {
test.skip('create: required and optional params', async () => {
const response = await client.alerting.policies.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
alert_type: 'access_custom_certificate_expiration_type',
alert_type: 'universal_ssl_event_type',
enabled: true,
mechanisms: {
email: [{ id: 'test@example.com' }],
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('resource policies', () => {
const response = await client.alerting.policies.update('0da2b59e-f118-439d-8097-bdfb215203c9', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
alert_interval: '30m',
alert_type: 'access_custom_certificate_expiration_type',
alert_type: 'universal_ssl_event_type',
description: 'Something describing the policy.',
enabled: true,
filters: {
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/api-gateway/discovery/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ describe('resource operations', () => {
const response = await client.apiGateway.discovery.operations.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
diff: true,
direction: 'asc',
direction: 'desc',
endpoint: '/api/v1',
host: ['api.cloudflare.com'],
method: ['GET'],
order: 'host',
order: 'method',
origin: 'ML',
page: 1,
per_page: 5,
Expand All @@ -57,7 +57,7 @@ describe('resource operations', () => {
const response = await client.apiGateway.discovery.operations.bulkEdit({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: {
'3818d821-5901-4147-a474-f5f5aec1d54e': { state: 'review' },
'3818d821-5901-4147-a474-f5f5aec1d54e': { state: 'ignored' },
'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': { state: 'review' },
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('resource operations', () => {
test('list: required and optional params', async () => {
const response = await client.apiGateway.operations.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
direction: 'asc',
direction: 'desc',
endpoint: '/api/v1',
feature: ['thresholds'],
host: ['api.cloudflare.com'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('resource schemaValidation', () => {
test('update: required and optional params', async () => {
const response = await client.apiGateway.operations.schemaValidation.update(
'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
{ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', mitigation_action: 'log' },
{ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', mitigation_action: 'block' },
);
});

Expand All @@ -53,7 +53,7 @@ describe('resource schemaValidation', () => {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
settings_multiple_request: {
'3818d821-5901-4147-a474-f5f5aec1d54e': { mitigation_action: 'log' },
'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': { mitigation_action: 'log' },
'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': { mitigation_action: 'block' },
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource schemaValidation', () => {
test('update: only required params', async () => {
const responsePromise = client.apiGateway.settings.schemaValidation.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
validation_default_mitigation_action: 'none',
validation_default_mitigation_action: 'block',
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -27,7 +27,7 @@ describe('resource schemaValidation', () => {
test('update: required and optional params', async () => {
const response = await client.apiGateway.settings.schemaValidation.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
validation_default_mitigation_action: 'none',
validation_default_mitigation_action: 'block',
validation_override_mitigation_action: 'none',
});
});
Expand All @@ -48,7 +48,7 @@ describe('resource schemaValidation', () => {
test('edit: required and optional params', async () => {
const response = await client.apiGateway.settings.schemaValidation.edit({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
validation_default_mitigation_action: 'none',
validation_default_mitigation_action: 'block',
validation_override_mitigation_action: 'none',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('resource customCertificates', () => {
bundle_method: 'ubiquitous',
geo_restrictions: { label: 'us' },
policy: '(country: US) or (region: EU)',
type: 'legacy_custom',
type: 'sni_custom',
});
});

Expand Down
10 changes: 5 additions & 5 deletions tests/api-resources/custom-hostnames/custom-hostnames.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('resource customHostnames', () => {
hostname: 'app.example.com',
ssl: {
bundle_method: 'ubiquitous',
certificate_authority: 'digicert',
certificate_authority: 'google',
cloudflare_branding: false,
custom_cert_bundle: [
{
Expand All @@ -50,7 +50,7 @@ describe('resource customHostnames', () => {
ciphers: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-SHA'],
early_hints: 'on',
http2: 'on',
min_tls_version: '1.0',
min_tls_version: '1.2',
tls_1_3: 'on',
},
type: 'dv',
Expand All @@ -75,7 +75,7 @@ describe('resource customHostnames', () => {
const response = await client.customHostnames.list({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
id: '0d89c70d-ad9f-4843-b99f-6cc0252067e9',
direction: 'asc',
direction: 'desc',
hostname: 'app.example.com',
order: 'ssl',
page: 1,
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('resource customHostnames', () => {
custom_origin_sni: 'sni.example.com',
ssl: {
bundle_method: 'ubiquitous',
certificate_authority: 'digicert',
certificate_authority: 'google',
cloudflare_branding: false,
custom_cert_bundle: [
{
Expand All @@ -143,7 +143,7 @@ describe('resource customHostnames', () => {
ciphers: ['ECDHE-RSA-AES128-GCM-SHA256', 'AES128-SHA'],
early_hints: 'on',
http2: 'on',
min_tls_version: '1.0',
min_tls_version: '1.2',
tls_1_3: 'on',
},
type: 'dv',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('resource bytimes', () => {
metrics: 'queryCount,uncachedCount',
since: '2023-11-11T12:00:00Z',
sort: '+responseCode,-queryName',
time_delta: 'all',
time_delta: 'hour',
until: '2023-11-11T13:00:00Z',
},
);
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/dns/analytics/reports/bytimes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('resource bytimes', () => {
metrics: 'queryCount,uncachedCount',
since: '2023-11-11T12:00:00Z',
sort: '+responseCode,-queryName',
time_delta: 'all',
time_delta: 'hour',
until: '2023-11-11T13:00:00Z',
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/dns/settings/account/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('resource account', () => {
rname: 'admin.example.com',
ttl: 3600,
},
zone_mode: 'standard',
zone_mode: 'dns_only',
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/dns/settings/zone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('resource zone', () => {
rname: 'admin.example.com',
ttl: 3600,
},
zone_mode: 'standard',
zone_mode: 'dns_only',
});
});

Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/email-routing/rules/catch-alls.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource catchAlls', () => {
test('update: only required params', async () => {
const responsePromise = client.emailRouting.rules.catchAlls.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop' }],
actions: [{ type: 'forward' }],
matchers: [{ type: 'all' }],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -28,7 +28,7 @@ describe('resource catchAlls', () => {
test('update: required and optional params', async () => {
const response = await client.emailRouting.rules.catchAlls.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop', value: ['destinationaddress@example.net'] }],
actions: [{ type: 'forward', value: ['destinationaddress@example.net'] }],
matchers: [{ type: 'all' }],
enabled: true,
name: 'Send to user@example.net rule.',
Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/email-routing/rules/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource rules', () => {
test('create: only required params', async () => {
const responsePromise = client.emailRouting.rules.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop', value: ['destinationaddress@example.net'] }],
actions: [{ type: 'forward', value: ['destinationaddress@example.net'] }],
matchers: [{ field: 'to', type: 'literal', value: 'test@example.com' }],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -28,7 +28,7 @@ describe('resource rules', () => {
test('create: required and optional params', async () => {
const response = await client.emailRouting.rules.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop', value: ['destinationaddress@example.net'] }],
actions: [{ type: 'forward', value: ['destinationaddress@example.net'] }],
matchers: [{ field: 'to', type: 'literal', value: 'test@example.com' }],
enabled: true,
name: 'Send to user@example.net rule.',
Expand All @@ -39,7 +39,7 @@ describe('resource rules', () => {
test('update: only required params', async () => {
const responsePromise = client.emailRouting.rules.update('a7e6fb77503c41d8a7f3113c6918f10c', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop', value: ['destinationaddress@example.net'] }],
actions: [{ type: 'forward', value: ['destinationaddress@example.net'] }],
matchers: [{ field: 'to', type: 'literal', value: 'test@example.com' }],
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -54,7 +54,7 @@ describe('resource rules', () => {
test('update: required and optional params', async () => {
const response = await client.emailRouting.rules.update('a7e6fb77503c41d8a7f3113c6918f10c', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
actions: [{ type: 'drop', value: ['destinationaddress@example.net'] }],
actions: [{ type: 'forward', value: ['destinationaddress@example.net'] }],
matchers: [{ field: 'to', type: 'literal', value: 'test@example.com' }],
enabled: true,
name: 'Send to user@example.net rule.',
Expand Down
8 changes: 4 additions & 4 deletions tests/api-resources/firewall/access-rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('resource accessRules', () => {
test.skip('create: only required params', async () => {
const responsePromise = client.firewall.accessRules.create({
configuration: {},
mode: 'block',
mode: 'challenge',
account_id: 'account_id',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -30,7 +30,7 @@ describe('resource accessRules', () => {
test.skip('create: required and optional params', async () => {
const response = await client.firewall.accessRules.create({
configuration: { target: 'ip', value: '198.51.100.4' },
mode: 'block',
mode: 'challenge',
account_id: 'account_id',
notes: 'This rule is enabled because of an event that occurred on date X.',
});
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('resource accessRules', () => {
test.skip('edit: only required params', async () => {
const responsePromise = client.firewall.accessRules.edit('023e105f4ecef8ad9ca31a8372d0c353', {
configuration: {},
mode: 'block',
mode: 'challenge',
account_id: 'account_id',
});
const rawResponse = await responsePromise.asResponse();
Expand All @@ -82,7 +82,7 @@ describe('resource accessRules', () => {
test.skip('edit: required and optional params', async () => {
const response = await client.firewall.accessRules.edit('023e105f4ecef8ad9ca31a8372d0c353', {
configuration: { target: 'ip', value: '198.51.100.4' },
mode: 'block',
mode: 'challenge',
account_id: 'account_id',
notes: 'This rule is enabled because of an event that occurred on date X.',
});
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/firewall/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('resource rules', () => {
const response = await client.firewall.rules.create({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
action: {
mode: 'simulate',
mode: 'challenge',
response: { body: '<error>This request has been rate-limited.</error>', content_type: 'text/xml' },
timeout: 86400,
},
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('resource rules', () => {
const response = await client.firewall.rules.update('372e67954025e0ba6aaa6d586b9e0b60', {
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
action: {
mode: 'simulate',
mode: 'challenge',
response: { body: '<error>This request has been rate-limited.</error>', content_type: 'text/xml' },
timeout: 86400,
},
Expand Down
Loading