@@ -15,16 +15,79 @@ import {
1515 InvocationRetrieveResponse ,
1616 Invocations ,
1717} from './invocations' ;
18+ import { APIPromise } from '../../core/api-promise' ;
19+ import { RequestOptions } from '../../internal/request-options' ;
1820
1921export class Apps extends APIResource {
2022 deployments : DeploymentsAPI . Deployments = new DeploymentsAPI . Deployments ( this . _client ) ;
2123 invocations : InvocationsAPI . Invocations = new InvocationsAPI . Invocations ( this . _client ) ;
24+
25+ /**
26+ * List application versions for the authenticated user. Optionally filter by app
27+ * name and/or version label.
28+ *
29+ * @example
30+ * ```ts
31+ * const apps = await client.apps.list();
32+ * ```
33+ */
34+ list ( query : AppListParams | null | undefined = { } , options ?: RequestOptions ) : APIPromise < AppListResponse > {
35+ return this . _client . get ( '/apps' , { query, ...options } ) ;
36+ }
37+ }
38+
39+ export type AppListResponse = Array < AppListResponse . AppListResponseItem > ;
40+
41+ export namespace AppListResponse {
42+ /**
43+ * Summary of an application version.
44+ */
45+ export interface AppListResponseItem {
46+ /**
47+ * Unique identifier for the app version
48+ */
49+ id : string ;
50+
51+ /**
52+ * Name of the application
53+ */
54+ app_name : string ;
55+
56+ /**
57+ * Deployment region code
58+ */
59+ region : string ;
60+
61+ /**
62+ * Version label for the application
63+ */
64+ version : string ;
65+
66+ /**
67+ * Environment variables configured for this app version
68+ */
69+ env_vars ?: Record < string , string > ;
70+ }
71+ }
72+
73+ export interface AppListParams {
74+ /**
75+ * Filter results by application name.
76+ */
77+ app_name ?: string ;
78+
79+ /**
80+ * Filter results by version label.
81+ */
82+ version ?: string ;
2283}
2384
2485Apps . Deployments = Deployments ;
2586Apps . Invocations = Invocations ;
2687
2788export declare namespace Apps {
89+ export { type AppListResponse as AppListResponse , type AppListParams as AppListParams } ;
90+
2891 export {
2992 Deployments as Deployments ,
3093 type DeploymentCreateResponse as DeploymentCreateResponse ,
0 commit comments