Constructs an instance of this driver.
The Strava provider's subscription parameters.
The driver's codeFieldName. This field indicates the name of the code field in this driver. Its value should always be 'code'.
The driver's dataFieldName. This field indicates the name of the data field in this driver. Its value should always be 'state'.
The driver's HTTP service. It's a handler for HTTP requests and contains
methods for executing remote API calls, e.g. calling a GET
HTTP API
endpoint.
The driver's value to determine whether seconds are used to express
UTC timestamps (if set to false, milliseconds are used). This field
indicates the type of timestamp returned with this driver.
This Strava OAuth implementation uses seconds since epoch when it
expresses/returns UTC timestamps that represent an access token's
expiration time.
Getter of this driver's code field name.
This driver's code field name.
Getter of this driver's data field name.
This driver's data field name.
Getter of this driver's provider name.
This driver's provider name.
Getter that determines whether this driver uses seconds (rather than milliseconds) to express a timestamp in UTC format.
Whether this driver uses seconds to express UTC timestamps.
Method to return the authorize query to this driver's provider.
This is the query parameters that will be included after the
authorized url.
Note that in addition to the query parameters included in the
super class BasicOAuthDriver, this method also adds two
new parameters response_type=code
and approval_prompt=auto
.
The data
value to include in this query.
The full query parameters.
Method to execute a request calling the driver's provider API.
The access token attached as a Bearer token to the request.
The endpoint URI of the driver's provider API.
(Optional) The HTTP method used for the request, e.g. "GET". Defaults to "GET".
(Optional) The body of the request, as used with "POST" or "PUT" requests. Defaults to an empty object.
(Optional) An options object that is directly passed to axios before request execution. Defaults to an empty object.
A promise containing the response and status in ResponseStatusDTO.
Helper method that extracts access- and refresh tokens, and
expiration time of the access token from a HTTP response.
This method overload permits to extract additional data
from the response object as it may be included by Strava.
Note that this overload calls the BasicOAuthDriver.extractFromResponse method
to extract mandatory token information from the response.
The HTTP response data (parsed JSON object).
A resulting AccessTokenDTO object.
Method to return the remote access token. The result is an access/refresh
token pair. This method requires the use of an authorization code that
is provided by the provider.
These access tokens are always signed with the dApp's auth secret and expire
after 1 hour (one hour).
The required code
field value.
The required data
field value.
A promise containing the result AccessTokenDTO.
Method to return the authorize url of this driver's provider.
The data
field value to include in this query.
The full authorize url to send request to.
Method to transform an entity as described by the data provider
API. Typically, this method is used to handle the transformation
of remote objects (from data provider API) to internal objects in
the backend runtime's database.
e.g. This method is used to transform activity data as defined
by the Strava API, into ActivityData as defined internally.
This implementation is currently compatible with remote activity
data as defined in the Strava API. It uses the Activity
class to transform the activity data.
The API Response object that will be transformed.
The type of entity as described in OAuthEntityType.
A parsed entity object.
Helper method that executes the actual access token request using a set
of params
parameters. The parameters set must contain the following
fields:
client_id
: Your Strava App's client identifier.client_secret
: Your Strava App's client secret.grant_type
: One of authorization_code
or refresh_token
.
authorization_code
and code
are obligatory as well.
When executing a refresh request for the access token, it is the field
refresh_token
that is obligatory (no code).The parameters for the access token request.
A promise containing the resulting AccessTokenDTO object.
Method to return an updated access token from the driver's provider
using a refresh token. The result is an access/refresh token pair.
These access tokens are always signed with the dApp's auth secret and expire
after 1 hour (one hour).
The user's refresh token.
A promise containing the result AccessTokenDTO.
Generated using TypeDoc
The dApp's
Strava
OAuth driver. This class is used to determine communication, transport and process to connect and integrate to theStrava
provider.v0.3.0