From e0fa732a5a894b030ae8de7cd438328a61e9fa4f Mon Sep 17 00:00:00 2001 From: Inian Date: Mon, 15 Aug 2022 23:24:39 +0800 Subject: [PATCH 1/2] fix typedocs --- src/FunctionsClient.ts | 4 ++-- src/types.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/FunctionsClient.ts b/src/FunctionsClient.ts index e34e7b6..9f1dd3e 100644 --- a/src/FunctionsClient.ts +++ b/src/FunctionsClient.ts @@ -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}` @@ -39,7 +39,7 @@ 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.headers - object representing the headers to send with the request * @param invokeOptions.body - the body of the request */ async invoke( diff --git a/src/types.ts b/src/types.ts index 3ef7c2b..9bb8c84 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,11 +4,11 @@ export type Fetch = typeof fetch * Response format * */ -interface FunctionsResponseSuccess { +export interface FunctionsResponseSuccess { data: T error: null } -interface FunctionsResponseFailure { +export interface FunctionsResponseFailure { data: null error: any } @@ -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 From 45f79ad3347ca633db01c6b51dc9a5f2e95bae8d Mon Sep 17 00:00:00 2001 From: Inian Date: Mon, 15 Aug 2022 23:29:54 +0800 Subject: [PATCH 2/2] remove unnecessary doc --- src/FunctionsClient.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/FunctionsClient.ts b/src/FunctionsClient.ts index 9f1dd3e..6dbf93e 100644 --- a/src/FunctionsClient.ts +++ b/src/FunctionsClient.ts @@ -39,8 +39,6 @@ export class FunctionsClient { /** * Invokes a function * @param functionName - the name of the function to invoke - * @param invokeOptions.headers - object representing the headers to send with the request - * @param invokeOptions.body - the body of the request */ async invoke( functionName: string,