Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EndpointManager

Provides the methods to execute your app backend services by making http request to your app endpoints.

If your endpoints require an API key, you can set it in two ways either as the apiKey input parameter of ClientOptions to the createClient function or as an input header with the name Authorization (e.g., Authorization: <your api key>) in specific methods.

Additionally, if your endpoints require a Session token, you can also set it in two ways either calling the AuthManager.setSession method with a valid session object or as an input header with the name Session (e.g., Session: <your session token>) in specific methods.

export

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

fetcher: Fetcher

The http client to make RESTful API calls to the application's execution engine

Methods

  • delete(path: string, body?: object | FormData, queryParams?: KeyValuePair, headers?: KeyValuePair, resolveType?: "text" | "arraybuffer" | "blob" | "json"): Promise<{ data: any; errors: null | APIError }>
  • Makes a DELETE request to the endpoint path. Optionally, you can provide body, query string parameters or headers in this request.

    Depending on the configuration of the endpoint, an active user session might be required (e.g., user needs to be logged in) to call this method.

    Parameters

    • path: string

      The path of the endpoint. The endpoint path needs to start with a slash '/' character e.g., /users/profile

    • Optional body: object | FormData
    • Optional queryParams: KeyValuePair
    • Optional headers: KeyValuePair
    • Optional resolveType: "text" | "arraybuffer" | "blob" | "json"

      Type of data to return as a response of the request. By default response data is parsed to JSON. Possible values are json, text, blob and arraybuffer.

    Returns Promise<{ data: any; errors: null | APIError }>

    Returns a promise. The returned response includes two components data and errors. If errors occured during the execution of the request then errors object is returned and tha data is marked as null. If no errors occured then depending on the type of the request the data object holds a single JSON object, an array of json objects, plain text, Blob or ArrayBuffer and the errors object is marked as null. If the response returns no data back then both erros and data marked as null.

  • get(path: string, queryParams?: KeyValuePair, headers?: KeyValuePair, resolveType?: "text" | "arraybuffer" | "blob" | "json"): Promise<{ data: any; errors: null | APIError }>
  • Makes a GET request to the endpoint path. Optionally, you can provide query string parameters or headers in this request.

    Depending on the configuration of the endpoint, an active user session might be required (e.g., user needs to be logged in) to call this method.

    Parameters

    • path: string

      The path of the endpoint. The endpoint path needs to start with a slash '/' character e.g., /users/profile

    • Optional queryParams: KeyValuePair
    • Optional headers: KeyValuePair
    • Optional resolveType: "text" | "arraybuffer" | "blob" | "json"

      Type of data to return as a response of the request. By default response data is parsed to JSON. Possible values are json, text, blob and arraybuffer.

    Returns Promise<{ data: any; errors: null | APIError }>

    Returns a promise. The returned response includes two components data and errors. If errors occured during the execution of the request then errors object is returned and tha data is marked as null. If no errors occured then depending on the type of the request the data object holds a single JSON object, an array of json objects, plain text, Blob or ArrayBuffer and the errors object is marked as null. If the response returns no data back then both erros and data marked as null.

  • post(path: string, body?: object | FormData, queryParams?: KeyValuePair, headers?: KeyValuePair, resolveType?: "text" | "arraybuffer" | "blob" | "json"): Promise<{ data: any; errors: null | APIError }>
  • Makes a POST request to the endpoint path. Optionally, you can provide body, query string parameters or headers in this request.

    Depending on the configuration of the endpoint, an active user session might be required (e.g., user needs to be logged in) to call this method.

    Parameters

    • path: string

      The path of the endpoint. The endpoint path needs to start with a slash '/' character e.g., /users/profile

    • Optional body: object | FormData
    • Optional queryParams: KeyValuePair
    • Optional headers: KeyValuePair
    • Optional resolveType: "text" | "arraybuffer" | "blob" | "json"

      Type of data to return as a response of the request. By default response data is parsed to JSON. Possible values are json, text, blob and arraybuffer.

    Returns Promise<{ data: any; errors: null | APIError }>

    Returns a promise. The returned response includes two components data and errors. If errors occured during the execution of the request then errors object is returned and tha data is marked as null. If no errors occured then depending on the type of the request the data object holds a single JSON object, an array of json objects, plain text, Blob or ArrayBuffer and the errors object is marked as null. If the response returns no data back then both erros and data marked as null.

  • put(path: string, body?: object | FormData, queryParams?: KeyValuePair, headers?: KeyValuePair, resolveType?: "text" | "arraybuffer" | "blob" | "json"): Promise<{ data: any; errors: null | APIError }>
  • Makes a PUT request to the endpoint path. Optionally, you can provide body, query string parameters or headers in this request.

    Depending on the configuration of the endpoint, an active user session might be required (e.g., user needs to be logged in) to call this method.

    Parameters

    • path: string

      The path of the endpoint. The endpoint path needs to start with a slash '/' character e.g., /users/profile

    • Optional body: object | FormData
    • Optional queryParams: KeyValuePair
    • Optional headers: KeyValuePair
    • Optional resolveType: "text" | "arraybuffer" | "blob" | "json"

      Type of data to return as a response of the request. By default response data is parsed to JSON. Possible values are json, text, blob and arraybuffer.

    Returns Promise<{ data: any; errors: null | APIError }>

    Returns a promise. The returned response includes two components data and errors. If errors occured during the execution of the request then errors object is returned and tha data is marked as null. If no errors occured then depending on the type of the request the data object holds a single JSON object, an array of json objects, plain text, Blob or ArrayBuffer and the errors object is marked as null. If the response returns no data back then both erros and data marked as null.

Generated using TypeDoc