@@ -5,6 +5,7 @@ import { APIPromise } from '../core/api-promise';
55import { type Uploadable } from '../core/uploads' ;
66import { RequestOptions } from '../internal/request-options' ;
77import { multipartFormRequestOptions } from '../internal/uploads' ;
8+ import { path } from '../internal/utils/path' ;
89
910export class Apps extends APIResource {
1011 /**
@@ -39,6 +40,20 @@ export class Apps extends APIResource {
3940 invoke ( body : AppInvokeParams , options ?: RequestOptions ) : APIPromise < AppInvokeResponse > {
4041 return this . _client . post ( '/apps/invoke' , { body, ...options } ) ;
4142 }
43+
44+ /**
45+ * Get an app invocation by id
46+ *
47+ * @example
48+ * ```ts
49+ * const response = await client.apps.retrieveInvocation(
50+ * 'ckqwer3o20000jb9s7abcdef',
51+ * );
52+ * ```
53+ */
54+ retrieveInvocation ( id : string , options ?: RequestOptions ) : APIPromise < AppRetrieveInvocationResponse > {
55+ return this . _client . get ( path `/apps/invocations/${ id } ` , options ) ;
56+ }
4257}
4358
4459export interface AppDeployResponse {
@@ -75,6 +90,22 @@ export interface AppInvokeResponse {
7590 output ?: string ;
7691}
7792
93+ export interface AppRetrieveInvocationResponse {
94+ id : string ;
95+
96+ appName : string ;
97+
98+ finishedAt : string | null ;
99+
100+ input : string ;
101+
102+ output : string ;
103+
104+ startedAt : string ;
105+
106+ status : string ;
107+ }
108+
78109export interface AppDeployParams {
79110 /**
80111 * Name of the application
@@ -123,6 +154,7 @@ export declare namespace Apps {
123154 export {
124155 type AppDeployResponse as AppDeployResponse ,
125156 type AppInvokeResponse as AppInvokeResponse ,
157+ type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse ,
126158 type AppDeployParams as AppDeployParams ,
127159 type AppInvokeParams as AppInvokeParams ,
128160 } ;
0 commit comments