@@ -38,6 +38,21 @@ export class Deployments extends APIResource {
3838 return this . _client . get ( path `/deployments/${ id } ` , options ) ;
3939 }
4040
41+ /**
42+ * List deployments. Optionally filter by application name.
43+ *
44+ * @example
45+ * ```ts
46+ * const deployments = await client.deployments.list();
47+ * ```
48+ */
49+ list (
50+ query : DeploymentListParams | null | undefined = { } ,
51+ options ?: RequestOptions ,
52+ ) : APIPromise < DeploymentListResponse > {
53+ return this . _client . get ( '/deployments' , { query, ...options } ) ;
54+ }
55+
4156 /**
4257 * Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
4358 * status updates for a deployment. The stream terminates automatically once the
@@ -219,6 +234,55 @@ export interface DeploymentRetrieveResponse {
219234 updated_at ?: string | null ;
220235}
221236
237+ export type DeploymentListResponse = Array < DeploymentListResponse . DeploymentListResponseItem > ;
238+
239+ export namespace DeploymentListResponse {
240+ /**
241+ * Deployment record information.
242+ */
243+ export interface DeploymentListResponseItem {
244+ /**
245+ * Unique identifier for the deployment
246+ */
247+ id : string ;
248+
249+ /**
250+ * Timestamp when the deployment was created
251+ */
252+ created_at : string ;
253+
254+ /**
255+ * Deployment region code
256+ */
257+ region : 'aws.us-east-1a' ;
258+
259+ /**
260+ * Current status of the deployment
261+ */
262+ status : 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped' ;
263+
264+ /**
265+ * Relative path to the application entrypoint
266+ */
267+ entrypoint_rel_path ?: string ;
268+
269+ /**
270+ * Environment variables configured for this deployment
271+ */
272+ env_vars ?: { [ key : string ] : string } ;
273+
274+ /**
275+ * Status reason
276+ */
277+ status_reason ?: string ;
278+
279+ /**
280+ * Timestamp when the deployment was last updated
281+ */
282+ updated_at ?: string | null ;
283+ }
284+ }
285+
222286/**
223287 * Union type representing any deployment event.
224288 */
@@ -242,7 +306,7 @@ export namespace DeploymentFollowResponse {
242306 /**
243307 * List of actions available on the app
244308 */
245- actions : Array < AppVersionSummaryEvent . Action > ;
309+ actions : Array < Shared . AppAction > ;
246310
247311 /**
248312 * Name of the application
@@ -274,18 +338,6 @@ export namespace DeploymentFollowResponse {
274338 */
275339 env_vars ?: { [ key : string ] : string } ;
276340 }
277-
278- export namespace AppVersionSummaryEvent {
279- /**
280- * An action available on the app
281- */
282- export interface Action {
283- /**
284- * Name of the action
285- */
286- name : string ;
287- }
288- }
289341}
290342
291343export interface DeploymentCreateParams {
@@ -321,6 +373,13 @@ export interface DeploymentCreateParams {
321373 version ?: string ;
322374}
323375
376+ export interface DeploymentListParams {
377+ /**
378+ * Filter results by application name.
379+ */
380+ app_name ?: string ;
381+ }
382+
324383export interface DeploymentFollowParams {
325384 /**
326385 * Show logs since the given time (RFC timestamps or durations like 5m).
@@ -333,8 +392,10 @@ export declare namespace Deployments {
333392 type DeploymentStateEvent as DeploymentStateEvent ,
334393 type DeploymentCreateResponse as DeploymentCreateResponse ,
335394 type DeploymentRetrieveResponse as DeploymentRetrieveResponse ,
395+ type DeploymentListResponse as DeploymentListResponse ,
336396 type DeploymentFollowResponse as DeploymentFollowResponse ,
337397 type DeploymentCreateParams as DeploymentCreateParams ,
398+ type DeploymentListParams as DeploymentListParams ,
338399 type DeploymentFollowParams as DeploymentFollowParams ,
339400 } ;
340401}
0 commit comments