@@ -90,7 +90,7 @@ export class Functions extends Service {
9090 * @throws {AppwriteException }
9191 * @returns {Promise }
9292 */
93- async createExecution ( params : { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string , onProgress ?: ( progress : UploadProgress ) => void } ) : Promise < Models . Execution > ;
93+ createExecution ( params : { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string } ) : Promise < Models . Execution > ;
9494 /**
9595 * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
9696 *
@@ -105,17 +105,15 @@ export class Functions extends Service {
105105 * @returns {Promise<Models.Execution> }
106106 * @deprecated Use the object parameter style method for a better developer experience.
107107 */
108- async createExecution ( functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string , onProgress ?: ( progress : UploadProgress ) => void ) : Promise < Models . Execution > ;
109- async createExecution (
110- paramsOrFirst : { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string , onProgress ?: ( progress : UploadProgress ) => void } | string ,
111- ...rest : [ ( string ) ?, ( boolean ) ?, ( string ) ?, ( ExecutionMethod ) ?, ( object ) ?, ( string ) ?, ( ( progress : UploadProgress ) => void ) ? ]
108+ createExecution ( functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string ) : Promise < Models . Execution > ;
109+ createExecution (
110+ paramsOrFirst : { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string } | string ,
111+ ...rest : [ ( string ) ?, ( boolean ) ?, ( string ) ?, ( ExecutionMethod ) ?, ( object ) ?, ( string ) ?]
112112 ) : Promise < Models . Execution > {
113113 let params : { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string } ;
114- let onProgress : ( ( progress : UploadProgress ) => void ) ;
115114
116115 if ( ( paramsOrFirst && typeof paramsOrFirst === 'object' && ! Array . isArray ( paramsOrFirst ) ) ) {
117116 params = ( paramsOrFirst || { } ) as { functionId : string , body ?: string , async ?: boolean , xpath ?: string , method ?: ExecutionMethod , headers ?: object , scheduledAt ?: string } ;
118- onProgress = paramsOrFirst ?. onProgress as ( ( progress : UploadProgress ) => void ) ;
119117 } else {
120118 params = {
121119 functionId : paramsOrFirst as string ,
@@ -126,7 +124,6 @@ export class Functions extends Service {
126124 headers : rest [ 4 ] as object ,
127125 scheduledAt : rest [ 5 ] as string
128126 } ;
129- onProgress = rest [ 6 ] as ( ( progress : UploadProgress ) => void ) ;
130127 }
131128
132129 const functionId = params . functionId ;
@@ -169,6 +166,11 @@ export class Functions extends Service {
169166 }
170167
171168 const uri = new URL ( this . client . config . endpoint + apiPath ) ;
169+ return this . client . call ( 'post' , uri , {
170+ 'X-Appwrite-Project' : this . client . config . project ,
171+ 'content-type' : 'application/json' ,
172+ 'accept' : 'application/json' ,
173+ } , payload ) ;
172174 }
173175
174176 /**
0 commit comments