Skip to content

Commit bfa1ffd

Browse files
feat(api): OpenAPI spec update via Stainless API (#191)
1 parent aa2f058 commit bfa1ffd

File tree

4 files changed

+46
-8
lines changed

4 files changed

+46
-8
lines changed

src/resources/pages/projects/deployments/deployments.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export class Deployments extends APIResource {
3636
params: DeploymentListParams,
3737
options?: Core.RequestOptions,
3838
): Core.APIPromise<DeploymentListResponse> {
39-
const { account_id } = params;
39+
const { account_id, ...query } = params;
4040
return (
41-
this._client.get(
42-
`/accounts/${account_id}/pages/projects/${projectName}/deployments`,
43-
options,
44-
) as Core.APIPromise<{ result: DeploymentListResponse }>
41+
this._client.get(`/accounts/${account_id}/pages/projects/${projectName}/deployments`, {
42+
query,
43+
...options,
44+
}) as Core.APIPromise<{ result: DeploymentListResponse }>
4545
)._thenUnwrap((obj) => obj.result);
4646
}
4747

@@ -136,9 +136,14 @@ export interface DeploymentCreateParams {
136136

137137
export interface DeploymentListParams {
138138
/**
139-
* Identifier
139+
* Path param: Identifier
140140
*/
141141
account_id: string;
142+
143+
/**
144+
* Query param: What type of deployments to fetch.
145+
*/
146+
env?: 'production' | 'preview';
142147
}
143148

144149
export interface DeploymentDeleteParams {

src/resources/pages/projects/projects.ts

+20
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,11 @@ export namespace PagesProjects {
670670
* Service binding.
671671
*/
672672
export interface ServiceBinding {
673+
/**
674+
* The entrypoint to bind to.
675+
*/
676+
entrypoint?: string | null;
677+
673678
/**
674679
* The Service environment.
675680
*/
@@ -1039,6 +1044,11 @@ export namespace PagesProjects {
10391044
* Service binding.
10401045
*/
10411046
export interface ServiceBinding {
1047+
/**
1048+
* The entrypoint to bind to.
1049+
*/
1050+
entrypoint?: string | null;
1051+
10421052
/**
10431053
* The Service environment.
10441054
*/
@@ -1510,6 +1520,11 @@ export namespace ProjectCreateParams {
15101520
* Service binding.
15111521
*/
15121522
export interface ServiceBinding {
1523+
/**
1524+
* The entrypoint to bind to.
1525+
*/
1526+
entrypoint?: string | null;
1527+
15131528
/**
15141529
* The Service environment.
15151530
*/
@@ -1879,6 +1894,11 @@ export namespace ProjectCreateParams {
18791894
* Service binding.
18801895
*/
18811896
export interface ServiceBinding {
1897+
/**
1898+
* The entrypoint to bind to.
1899+
*/
1900+
entrypoint?: string | null;
1901+
18821902
/**
18831903
* The Service environment.
18841904
*/

tests/api-resources/pages/projects/deployments/deployments.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ describe('resource deployments', () => {
5050
test.skip('list: required and optional params', async () => {
5151
const response = await cloudflare.pages.projects.deployments.list('this-is-my-project-01', {
5252
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
53+
env: 'preview',
5354
});
5455
});
5556

tests/api-resources/pages/projects/projects.test.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ describe('resource projects', () => {
5353
placement: { mode: 'smart' },
5454
queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } },
5555
r2_buckets: { R2_BINDING: { name: 'some-bucket' } },
56-
services: { SERVICE_BINDING: { environment: 'production', service: 'example-worker' } },
56+
services: {
57+
SERVICE_BINDING: {
58+
entrypoint: 'MyHandler',
59+
environment: 'production',
60+
service: 'example-worker',
61+
},
62+
},
5763
vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } },
5864
},
5965
production: {
@@ -71,7 +77,13 @@ describe('resource projects', () => {
7177
placement: { mode: 'smart' },
7278
queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } },
7379
r2_buckets: { R2_BINDING: { name: 'some-bucket' } },
74-
services: { SERVICE_BINDING: { environment: 'production', service: 'example-worker' } },
80+
services: {
81+
SERVICE_BINDING: {
82+
entrypoint: 'MyHandler',
83+
environment: 'production',
84+
service: 'example-worker',
85+
},
86+
},
7587
vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } },
7688
},
7789
},

0 commit comments

Comments
 (0)