0.5.0 • Published 6 years ago

@plasma-platform/tm-centrifuge v0.5.0

Weekly downloads
-
License
CC-BY-4.0
Repository
gitlab
Last release
6 years ago

TM Micro Service API Prototype class

This class provide fetch wrapper, token and Service URL setter mainly. Just to avoid code duplication.

Requirements

Possibly you will need babel-polyfill to use it.

Documentation

ErrorBadRequest

Extends Error

Custom error message for Bad Request server response

Parameters

  • message (string | null) error details (optional, default null)

constructor

Constructor generates errorinstance

Parameters

  • message (string | null) error details (optional, default null)

Returns ErrorBadRequest current instance

ErrorCentrifuge

Extends Error

Custom error message for abstract server response

Parameters

  • statusCode number http status code
  • statusText string http status code text
  • message (string | null) error details (optional, default null)

constructor

Constructor generates error instance

Parameters

  • statusCode number http status code
  • statusText string http status code text
  • message (string | null) error details (optional, default null)

Returns ErrorCentrifuge current instance

ErrorServerResponse

Extends Error

Custom error message for abstract server response

Parameters

  • statusCode number http status code
  • statusText string http status code text
  • message (string | null) error details (optional, default null)

constructor

Constructor generates error instance

Parameters

  • statusCode number http status code
  • statusText string http status code text
  • message (string | null) error details (optional, default null)

Returns ErrorServerResponse current instance

TMCentrifuge

TM Interface to Centrifuge

Parameters

  • options
  • url string service url

constructor

Constructor saves service url

Parameters

  • options string centrifuge options
    • options.url string centrifuge url
    • options.timestamp string timestamp to sync instances in seconds, you set it up before get centrifuge token
    • options.token string centrifuge token from backend
    • options.user string may contain different values — user or card id, for example

Returns TMCentrifuge centrifuge instance

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago