Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FunctionsClient

Index

Constructors

Properties

Methods

Constructors

  • new FunctionsClient(url: string, __namedParameters?: { customFetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>; headers?: Record<string, string> }): FunctionsClient
  • Parameters

    • url: string
    • __namedParameters: { customFetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>; headers?: Record<string, string> } = {}
      • Optional customFetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>
          • (input: RequestInfo, init?: RequestInit): Promise<Response>
          • Parameters

            • input: RequestInfo
            • Optional init: RequestInit

            Returns Promise<Response>

      • Optional headers?: Record<string, string>

    Returns FunctionsClient

Properties

fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>

Type declaration

    • (input: RequestInfo, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

headers: Record<string, string>
url: string

Methods

  • invoke<T>(functionName: string, invokeOptions?: FunctionInvokeOptions): Promise<{ data: T; error: null } | { data: null; error: Error }>
  • Invokes a function

    Type parameters

    • T = any

    Parameters

    • functionName: string

      the name of the function to invoke

    • Optional invokeOptions: FunctionInvokeOptions

      object with the following properties headers: object representing the headers to send with the request body: the body of the request responseType: how the response should be parsed. The default is json

    Returns Promise<{ data: T; error: null } | { data: null; error: Error }>

  • setAuth(token: string): void
  • Updates the authorization header

    params

    token - the new jwt token sent in the authorisation header

    Parameters

    • token: string

    Returns void

Generated using TypeDoc