Class: MigrateCapabilities

MigrateCapabilities()

Migrate capabilities related responses to the latest version.

Constructor

new MigrateCapabilities()

Source:

Methods

(static) convertBillingToLatestSpec(billing, version) → {object}

Converts the billing part of the `GET /` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Description
billing object The response to convert
version string Version number of the API, which the response conforms to
Source:
Returns:
Type
object

(static) convertCapabilitiesToLatestSpec(response, version, updateVersionNumbers, updateEndpointPaths, id, title, title) → {object}

Converts a `GET /` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Description
response object The response to convert
version string | null Version number of the API, which the response conforms to. If `null`, tries to guess the version with `guessApiVersion()`.
updateVersionNumbers boolean Should version numbers in the response be updated?
updateEndpointPaths boolean Should the endpoint paths be updated to their recent equivalents?
id string If no id is set in the response, sets it to the value specified here. Defaults to `unknown`.
title string If no title is set in the response, sets it to the value specified here. Defaults to `Unknown`.
title string If no backend_version is set in the response, sets it to the value specified here. Defaults to `0.0.0`.
Source:
Returns:
Type
object

(static) convertEndpointsToLatestSpec(endpoints, version, updatePaths) → {array}

Converts the endpoints part of the `GET /` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Default Description
endpoints array The response to convert
version string Version number of the API, which the response conforms to
updatePaths boolean false Should the endpoint paths be updated to their recent equivalents?
Source:
Returns:
Type
array

(static) convertFileFormatsToLatestSpec(formats, version) → {object}

Alias for `convertFileFormatsToLatestSpec()`.
Parameters:
Name Type Description
formats object The response to convert
version string Version number of the API, which the response conforms to
Deprecated:
  • Yes
Source:
Returns:
Type
object

(static) convertFileFormatsToLatestSpec(formats, version) → {object}

Converts a `GET /file_formats` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Description
formats object The response to convert
version string Version number of the API, which the response conforms to
Source:
Returns:
Type
object

(static) convertServiceTypesToLatestSpec(types, version) → {object}

Converts a `GET /service_types` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Description
types object The response to convert
version string Version number of the API, which the response conforms to
Source:
Returns:
Type
object

(static) convertUdfRuntimesToLatestSpec(runtimes, version) → {object}

Converts a `GET /udf_runtimes` response to the latest version. Always returns a deep copy of the input object.
Parameters:
Name Type Description
runtimes object The response to convert
version string Version number of the API, which the response conforms to
Source:
Returns:
Type
object

(static) guessApiVersion(capabilities) → {string}

Tries to determine the API version from the capabilities object. Returns the version number, e.g. "0.4.2", "1.0.0" or "0.0.0" (if unknown).
Parameters:
Name Type Description
capabilities object
Source:
Returns:
Type
string