Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/FunctionsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class FunctionsClient {

/**
* Updates the authorization header
* @params token - the new jwt token sent in the authorisation header
* @param token - the new jwt token sent in the authorisation header
*/
setAuth(token: string) {
this.headers.Authorization = `Bearer ${token}`
Expand All @@ -39,8 +39,6 @@ export class FunctionsClient {
/**
* Invokes a function
* @param functionName - the name of the function to invoke
* @param invokeOption.headers - object representing the headers to send with the request
* @param invokeOptions.body - the body of the request
*/
async invoke<T = any>(
functionName: string,
Expand Down
10 changes: 8 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export type Fetch = typeof fetch
* Response format
*
*/
interface FunctionsResponseSuccess<T> {
export interface FunctionsResponseSuccess<T> {
data: T
error: null
}
interface FunctionsResponseFailure {
export interface FunctionsResponseFailure {
data: null
error: any
}
Expand Down Expand Up @@ -42,7 +42,13 @@ export class FunctionsHttpError extends FunctionsError {
}

export type FunctionInvokeOptions = {
/**
* object representing the headers to send with the request
* */
headers?: { [key: string]: string }
/**
* the body of the request
*/
body?:
| File
| Blob
Expand Down