Skip to content

Commit c935985

Browse files
committed
chore: update React Native SDK to 0.32.0
1 parent 0ed3e5e commit c935985

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

src/services/functions.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class Functions extends Service {
9090
* @throws {AppwriteException}
9191
* @returns {Promise}
9292
*/
93-
createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }): Promise<Models.Execution>;
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>;
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,15 +105,17 @@ 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-
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)?]
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)?]
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);
114115

115116
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
116117
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);
117119
} else {
118120
params = {
119121
functionId: paramsOrFirst as string,
@@ -124,6 +126,7 @@ export class Functions extends Service {
124126
headers: rest[4] as object,
125127
scheduledAt: rest[5] as string
126128
};
129+
onProgress = rest[6] as ((progress: UploadProgress) => void);
127130
}
128131

129132
const functionId = params.functionId;
@@ -166,11 +169,6 @@ export class Functions extends Service {
166169
}
167170

168171
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': 'multipart/form-data',
173-
}, payload);
174172
}
175173

176174
/**

0 commit comments

Comments
 (0)