Skip to content

Commit 3395404

Browse files
committed
chore(ssl): update codegen output
1 parent d47ed95 commit 3395404

7 files changed

Lines changed: 188 additions & 99 deletions

File tree

src/resources/ssl/api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ Methods:
4444

4545
## Recommendations
4646

47+
## AutoOriginTLSKex
48+
4749
Types:
4850

49-
- <code><a href="./src/resources/ssl/recommendations.ts">RecommendationGetResponse</a></code>
51+
- <code><a href="./src/resources/ssl/auto-origin-tls-kex.ts">AutoOriginTLSKexEditResponse</a></code>
52+
- <code><a href="./src/resources/ssl/auto-origin-tls-kex.ts">AutoOriginTLSKexGetResponse</a></code>
5053

5154
Methods:
5255

53-
- <code title="get /zones/{zone_id}/ssl/recommendation">client.ssl.recommendations.<a href="./src/resources/ssl/recommendations.ts">get</a>({ ...params }) -> RecommendationGetResponse</code>
54-
55-
## AutoOriginTLSKex
56+
- <code title="patch /zones/{zone_id}/settings/auto_origin_tls_kex">client.ssl.autoOriginTLSKex.<a href="./src/resources/ssl/auto-origin-tls-kex.ts">edit</a>({ ...params }) -> AutoOriginTLSKexEditResponse</code>
57+
- <code title="get /zones/{zone_id}/settings/auto_origin_tls_kex">client.ssl.autoOriginTLSKex.<a href="./src/resources/ssl/auto-origin-tls-kex.ts">get</a>({ ...params }) -> AutoOriginTLSKexGetResponse</code>
5658

5759
## Universal
5860

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,114 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4+
import * as Core from '../../core';
45

5-
export class AutoOriginTLSKex extends APIResource {}
6+
export class AutoOriginTLSKex extends APIResource {
7+
/**
8+
* Enable or disable Auto-Origin TLS KEX selection for the zone by sending
9+
* `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a
10+
* periodic scan of the zone's origins to determine the preferred key-exchange
11+
* algorithm and writes that preference to the edge so it is sent first in the TLS
12+
* ClientHello to the origin.
13+
*
14+
* @example
15+
* ```ts
16+
* const response = await client.ssl.autoOriginTLSKex.edit({
17+
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
18+
* enabled: true,
19+
* });
20+
* ```
21+
*/
22+
edit(
23+
params: AutoOriginTLSKexEditParams,
24+
options?: Core.RequestOptions,
25+
): Core.APIPromise<AutoOriginTLSKexEditResponse> {
26+
const { zone_id, ...body } = params;
27+
return (
28+
this._client.patch(`/zones/${zone_id}/settings/auto_origin_tls_kex`, {
29+
body,
30+
...options,
31+
}) as Core.APIPromise<{ result: AutoOriginTLSKexEditResponse }>
32+
)._thenUnwrap((obj) => obj.result);
33+
}
34+
35+
/**
36+
* When enabled, Cloudflare automatically selects the preferred TLS key-exchange
37+
* algorithm to use when establishing the TLS connection to the zone's origin,
38+
* picking from the algorithms permitted by the zone's
39+
* `origin_tls_compliance_modes` setting. When disabled, the default key-exchange
40+
* ordering is used.
41+
*
42+
* @example
43+
* ```ts
44+
* const autoOriginTLSKex =
45+
* await client.ssl.autoOriginTLSKex.get({
46+
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
47+
* });
48+
* ```
49+
*/
50+
get(
51+
params: AutoOriginTLSKexGetParams,
52+
options?: Core.RequestOptions,
53+
): Core.APIPromise<AutoOriginTLSKexGetResponse> {
54+
const { zone_id } = params;
55+
return (
56+
this._client.get(`/zones/${zone_id}/settings/auto_origin_tls_kex`, options) as Core.APIPromise<{
57+
result: AutoOriginTLSKexGetResponse;
58+
}>
59+
)._thenUnwrap((obj) => obj.result);
60+
}
61+
}
62+
63+
export interface AutoOriginTLSKexEditResponse {
64+
id: string;
65+
66+
/**
67+
* Whether Auto-Origin TLS KEX selection is enabled for the zone.
68+
*/
69+
enabled: boolean;
70+
71+
/**
72+
* Last time this setting was modified.
73+
*/
74+
modified_on: string;
75+
}
76+
77+
export interface AutoOriginTLSKexGetResponse {
78+
id: string;
79+
80+
/**
81+
* Whether Auto-Origin TLS KEX selection is enabled for the zone.
82+
*/
83+
enabled: boolean;
84+
85+
/**
86+
* Last time this setting was modified.
87+
*/
88+
modified_on: string;
89+
}
90+
91+
export interface AutoOriginTLSKexEditParams {
92+
/**
93+
* Path param
94+
*/
95+
zone_id: string;
96+
97+
/**
98+
* Body param: Controls enablement of Auto-Origin TLS KEX selection for the zone.
99+
*/
100+
enabled: boolean;
101+
}
102+
103+
export interface AutoOriginTLSKexGetParams {
104+
zone_id: string;
105+
}
106+
107+
export declare namespace AutoOriginTLSKex {
108+
export {
109+
type AutoOriginTLSKexEditResponse as AutoOriginTLSKexEditResponse,
110+
type AutoOriginTLSKexGetResponse as AutoOriginTLSKexGetResponse,
111+
type AutoOriginTLSKexEditParams as AutoOriginTLSKexEditParams,
112+
type AutoOriginTLSKexGetParams as AutoOriginTLSKexGetParams,
113+
};
114+
}

src/resources/ssl/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
export { Analyze, type AnalyzeCreateResponse, type AnalyzeCreateParams } from './analyze';
4-
export { AutoOriginTLSKex } from './auto-origin-tls-kex';
4+
export {
5+
AutoOriginTLSKex,
6+
type AutoOriginTLSKexEditResponse,
7+
type AutoOriginTLSKexGetResponse,
8+
type AutoOriginTLSKexEditParams,
9+
type AutoOriginTLSKexGetParams,
10+
} from './auto-origin-tls-kex';
511
export {
612
CertificatePackListResponsesV4PagePaginationArray,
713
CertificatePacks,
@@ -20,11 +26,7 @@ export {
2026
type CertificatePackEditParams,
2127
type CertificatePackGetParams,
2228
} from './certificate-packs/index';
23-
export {
24-
Recommendations,
25-
type RecommendationGetResponse,
26-
type RecommendationGetParams,
27-
} from './recommendations';
29+
export { Recommendations } from './recommendations';
2830
export { SSL } from './ssl';
2931
export { Universal } from './universal/index';
3032
export {
Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,5 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4-
import * as Core from '../../core';
54

6-
export class Recommendations extends APIResource {
7-
/**
8-
* Retrieve the SSL/TLS Recommender's recommendation for a zone.
9-
*
10-
* @deprecated SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS
11-
*/
12-
get(
13-
params: RecommendationGetParams,
14-
options?: Core.RequestOptions,
15-
): Core.APIPromise<RecommendationGetResponse> {
16-
const { zone_id } = params;
17-
return (
18-
this._client.get(`/zones/${zone_id}/ssl/recommendation`, options) as Core.APIPromise<{
19-
result: RecommendationGetResponse;
20-
}>
21-
)._thenUnwrap((obj) => obj.result);
22-
}
23-
}
24-
25-
export interface RecommendationGetResponse {
26-
id: string;
27-
28-
/**
29-
* Whether this setting can be updated or not.
30-
*/
31-
editable: boolean;
32-
33-
/**
34-
* Last time this setting was modified.
35-
*/
36-
modified_on: string;
37-
38-
/**
39-
* Current setting of the automatic SSL/TLS.
40-
*/
41-
value: 'auto' | 'custom';
42-
43-
/**
44-
* Next time this zone will be scanned by the Automatic SSL/TLS.
45-
*/
46-
next_scheduled_scan?: string | null;
47-
}
48-
49-
export interface RecommendationGetParams {
50-
zone_id: string;
51-
}
52-
53-
export declare namespace Recommendations {
54-
export {
55-
type RecommendationGetResponse as RecommendationGetResponse,
56-
type RecommendationGetParams as RecommendationGetParams,
57-
};
58-
}
5+
export class Recommendations extends APIResource {}

src/resources/ssl/ssl.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ import { APIResource } from '../../resource';
44
import * as AnalyzeAPI from './analyze';
55
import { Analyze, AnalyzeCreateParams, AnalyzeCreateResponse } from './analyze';
66
import * as AutoOriginTLSKexAPI from './auto-origin-tls-kex';
7-
import { AutoOriginTLSKex } from './auto-origin-tls-kex';
7+
import {
8+
AutoOriginTLSKex,
9+
AutoOriginTLSKexEditParams,
10+
AutoOriginTLSKexEditResponse,
11+
AutoOriginTLSKexGetParams,
12+
AutoOriginTLSKexGetResponse,
13+
} from './auto-origin-tls-kex';
814
import * as RecommendationsAPI from './recommendations';
9-
import { RecommendationGetParams, RecommendationGetResponse, Recommendations } from './recommendations';
15+
import { Recommendations } from './recommendations';
1016
import * as VerificationAPI from './verification';
1117
import {
1218
Verification,
@@ -85,14 +91,16 @@ export declare namespace SSL {
8591
type CertificatePackGetParams as CertificatePackGetParams,
8692
};
8793

94+
export { Recommendations as Recommendations };
95+
8896
export {
89-
Recommendations as Recommendations,
90-
type RecommendationGetResponse as RecommendationGetResponse,
91-
type RecommendationGetParams as RecommendationGetParams,
97+
AutoOriginTLSKex as AutoOriginTLSKex,
98+
type AutoOriginTLSKexEditResponse as AutoOriginTLSKexEditResponse,
99+
type AutoOriginTLSKexGetResponse as AutoOriginTLSKexGetResponse,
100+
type AutoOriginTLSKexEditParams as AutoOriginTLSKexEditParams,
101+
type AutoOriginTLSKexGetParams as AutoOriginTLSKexGetParams,
92102
};
93103

94-
export { AutoOriginTLSKex as AutoOriginTLSKex };
95-
96104
export { Universal as Universal };
97105

98106
export {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import Cloudflare from 'cloudflare';
4+
import { Response } from 'node-fetch';
5+
6+
const client = new Cloudflare({
7+
apiKey: '144c9defac04969c7bfad8efaa8ea194',
8+
apiEmail: 'user@example.com',
9+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
10+
});
11+
12+
describe('resource autoOriginTLSKex', () => {
13+
test('edit: only required params', async () => {
14+
const responsePromise = client.ssl.autoOriginTLSKex.edit({
15+
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
16+
enabled: true,
17+
});
18+
const rawResponse = await responsePromise.asResponse();
19+
expect(rawResponse).toBeInstanceOf(Response);
20+
const response = await responsePromise;
21+
expect(response).not.toBeInstanceOf(Response);
22+
const dataAndResponse = await responsePromise.withResponse();
23+
expect(dataAndResponse.data).toBe(response);
24+
expect(dataAndResponse.response).toBe(rawResponse);
25+
});
26+
27+
test('edit: required and optional params', async () => {
28+
const response = await client.ssl.autoOriginTLSKex.edit({
29+
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
30+
enabled: true,
31+
});
32+
});
33+
34+
test('get: only required params', async () => {
35+
const responsePromise = client.ssl.autoOriginTLSKex.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
36+
const rawResponse = await responsePromise.asResponse();
37+
expect(rawResponse).toBeInstanceOf(Response);
38+
const response = await responsePromise;
39+
expect(response).not.toBeInstanceOf(Response);
40+
const dataAndResponse = await responsePromise.withResponse();
41+
expect(dataAndResponse.data).toBe(response);
42+
expect(dataAndResponse.response).toBe(rawResponse);
43+
});
44+
45+
test('get: required and optional params', async () => {
46+
const response = await client.ssl.autoOriginTLSKex.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' });
47+
});
48+
});

tests/api-resources/ssl/recommendations.test.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)