utils

Members

(static) actionTypes

The different types of actions available at TMDb.
Source:

(static) baseUrl

The TMDb API base URL.
Source:

(static) dataTypes

The different types of data available at TMDb.
Source:

(static) externalSources

The different external sources supported in TMDb.
Source:

(static) httpMethod

All different types of HTTP request methods.
Source:

(static) jsonContentType

JSON Content-Type value.
Source:

(static) mediaTypes

The different media types available at TMDb.
Source:

(static) sections

The different types of sections available at TMDb.
Source:

(static) sortingTypes

The different types of sorting available at TMDb.
Source:

(static) timeWindows

The different time window types available at TMDb.
Source:

Methods

(static) buildUrl(urlPath, parameters)

Builds the URL with the passed path and parameters.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be retrieved (excluding the TMDb API base URL.).
parameters Object The parameters of the URL.

(static) createGuestSessionAsync(apiKey) → {Promise.<string>}

Creates a guest session at TMDb and returns the session ID.
Source:
Parameters:
Name Type Description
apiKey string The TMDb API key.
Returns:
Type:
Promise.<string>
A Promise of a guest session ID.

(static) createLoginSessionAsync(apiKey, username, password) → {Promise.<string>}

Creates a session with login at TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
username string The username to use to create a session.
password string The password to use to create a session.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(static) createSessionAsync(apiKey, permissionApp) → {Promise.<string>}

Creates a session at TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
permissionApp string The name of the web browser app to use when the end-user has to approve the request token.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(static) deleteAsync(urlPath, urlParameters) → {Promise.<boolean>}

Deletes at the passed url.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will deleted (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the deletion is successful.

(static) deleteSessionAsync(apiKey, sessionId) → {Promise.<boolean>}

Deletes (log outs of) a session.
Source:
Parameters:
Name Type Description
apiKey string The TMDb API key.
sessionId string The ID of the session to delete.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the deletion is successful.

(static) getDataAsync(urlPath, urlParameters) → {Promise.<*>}

Gets data as a JSON object.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be retrieved (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
Returns:
Type:
Promise.<*>
A Promise of JSON data.

(static) getRequestTokenAsync(apiKey) → {Promise.<string>}

Gets a request token from TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
Returns:
Type:
Promise.<string>
A Promise of a request token string.

(static) httpRequest(url, method, contentType, requestBody)

Makes an HTTP request to the passed url, based on the passed method and request body.
Source:
Parameters:
Name Type Description
url string The URL to make a request to.
method string The request method.
contentType string The contentType
requestBody string The body of the request.

(static) parseHttpRequest(url, method, parseFun, contentType, requestBody) → {Promise.<*>}

Makes an HTTP request on the given URL and parses the result.
Source:
Parameters:
Name Type Description
url string The URL.
method string The request method.
parseFun function The function used to parse the request result.
contentType string The content type of the request
requestBody string The body of the request
Returns:
Type:
Promise.<*>
A Promise of a parsed response.

(static) postAsync(urlPath, urlParameters, requestBody) → {Promise.<boolean>}

Posts to TMDb.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be posted (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
requestBody Object The request body object.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the rating is successful.

(inner) getSessionIdAsync(apiKey, requestToken) → {Promise.<string>}

Gets a session ID based on the approved request token and API key.
Source:
Parameters:
Name Type Description
apiKey The TMDb API key.
requestToken The approved request token.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

Members

(static) actionTypes

The different types of actions available at TMDb.
Source:

(static) baseUrl

The TMDb API base URL.
Source:

(static) dataTypes

The different types of data available at TMDb.
Source:

(static) externalSources

The different external sources supported in TMDb.
Source:

(static) httpMethod

All different types of HTTP request methods.
Source:

(static) jsonContentType

JSON Content-Type value.
Source:

(static) mediaTypes

The different media types available at TMDb.
Source:

(static) sections

The different types of sections available at TMDb.
Source:

(static) sortingTypes

The different types of sorting available at TMDb.
Source:

(static) timeWindows

The different time window types available at TMDb.
Source:

Methods

(static) buildUrl(urlPath, parameters)

Builds the URL with the passed path and parameters.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be retrieved (excluding the TMDb API base URL.).
parameters Object The parameters of the URL.

(static) createGuestSessionAsync(apiKey) → {Promise.<string>}

Creates a guest session at TMDb and returns the session ID.
Source:
Parameters:
Name Type Description
apiKey string The TMDb API key.
Returns:
Type:
Promise.<string>
A Promise of a guest session ID.

(static) createLoginSessionAsync(apiKey, username, password) → {Promise.<string>}

Creates a session with login at TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
username string The username to use to create a session.
password string The password to use to create a session.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(static) createSessionAsync(apiKey, permissionApp) → {Promise.<string>}

Creates a session at TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
permissionApp string The name of the web browser app to use when the end-user has to approve the request token.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).

(static) deleteAsync(urlPath, urlParameters) → {Promise.<boolean>}

Deletes at the passed url.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will deleted (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the deletion is successful.

(static) deleteSessionAsync(apiKey, sessionId) → {Promise.<boolean>}

Deletes (log outs of) a session.
Source:
Parameters:
Name Type Description
apiKey string The TMDb API key.
sessionId string The ID of the session to delete.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the deletion is successful.

(static) getDataAsync(urlPath, urlParameters) → {Promise.<*>}

Gets data as a JSON object.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be retrieved (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
Returns:
Type:
Promise.<*>
A Promise of JSON data.

(static) getRequestTokenAsync(apiKey) → {Promise.<string>}

Gets a request token from TMDb.
Source:
Parameters:
Name Type Description
apiKey string The API key to TMDb.
Returns:
Type:
Promise.<string>
A Promise of a request token string.

(static) httpRequest(url, method, contentType, requestBody)

Makes an HTTP request to the passed url, based on the passed method and request body.
Source:
Parameters:
Name Type Description
url string The URL to make a request to.
method string The request method.
contentType string The contentType
requestBody string The body of the request.

(static) parseHttpRequest(url, method, parseFun, contentType, requestBody) → {Promise.<*>}

Makes an HTTP request on the given URL and parses the result.
Source:
Parameters:
Name Type Description
url string The URL.
method string The request method.
parseFun function The function used to parse the request result.
contentType string The content type of the request
requestBody string The body of the request
Returns:
Type:
Promise.<*>
A Promise of a parsed response.

(static) postAsync(urlPath, urlParameters, requestBody) → {Promise.<boolean>}

Posts to TMDb.
Source:
Parameters:
Name Type Description
urlPath string The URL path from where data will be posted (excluding the TMDb API base URL.).
urlParameters Object The parameters of the URL.
requestBody Object The request body object.
Returns:
Type:
Promise.<boolean>
A Promise of a boolean value, which will be true if the rating is successful.

(inner) getSessionIdAsync(apiKey, requestToken) → {Promise.<string>}

Gets a session ID based on the approved request token and API key.
Source:
Parameters:
Name Type Description
apiKey The TMDb API key.
requestToken The approved request token.
Returns:
Type:
Promise.<string>
A Promise of a session ID string (undefined if the operation is not successful).