Class AbstractApi

This is a base class for communication with an arbitrary Nextspace API.

Hierarchy

Constructors

  • Parameters

    • params: {
          cacheId?: string;
          ssidHeader?: string;
      }
      • Optional cacheId?: string
      • Optional ssidHeader?: string

    Returns AbstractApi

Properties

Cache: CacheControl<any>
baseUrl: string = ""
ssid: string = ""
ssidHeader: string

Methods

  • Returns a cache item matching the provided key. If the reqParams specify that caching is disabled, null is returned.

    Parameters

    Returns {
        data: any;
        found: boolean;
    }

    • data: any
    • found: boolean
  • Sets the base URL for the API.

    Parameters

    • url: string

    Returns void

  • Sets a cache item matching the provided key. If the reqParams specify that caching is disabled, then no action is taken.

    Parameters

    • params: {
          duration?: number;
          key: string;
          req?: IReqParams;
          value: any;
      }
      • Optional duration?: number
      • key: string
      • Optional req?: IReqParams
      • value: any

    Returns void

  • Sets the session header.

    Parameters

    • value: string

    Returns void

  • Sets the session ID.

    Parameters

    • value: string

    Returns void

  • Performs a DELETE request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

  • Performs a GET request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

  • Performs a POST request. This will NOT prepend the base URL to the provided URL.

    Parameters

    • url: string
    • data: any
    • Optional params: IReqParams

    Returns Promise<any>

  • Performs a PUT request. This will NOT prepend the base URL to the provided URL.

    Parameters

    • url: string
    • data: any
    • Optional params: IReqParams

    Returns Promise<any>

  • Performs a file upload (POST) request. This will NOT prepend the base URL to the provided URL.

    Parameters

    Returns Promise<any>

Generated using TypeDoc