mountebank aims to evolve without requiring users to have to worry about versioning,
so breaking changes to the API are A Big Deal. This module exists to support transforming
older versions of the API to a newer format, so that most of the code can assume the
new format, but users who still use the old format don't need to migrate.
- Source:
Methods
(inner) downcastInjectionConfig(config)
While the new injection interface takes a single config object, the old
interface took several parameters, starting with the request object.
To make the new interface backwards compatible, we have to add all the
request fields to the config object
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | the injection parameter |
- Source:
(inner) upcast(request)
Upcast the request to the current version
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | the request to upcast |
- Source:
(inner) upcastBehaviorsToArray(request)
The original _behaviors took an object with undefined ordering
The new syntax expects an array, creating a behaviors pipeline
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | the request to upcast |
- Source:
(inner) upcastShellTransformToArray(request)
The original shellTransform only accepted one command
The new syntax expects an array, creating a shell pipeline
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | the request to upcast |
- Source:
(inner) upcastTcpProxyDestinationToUrl(request)
The original tcp proxy.to was an object with a host and port field
The new syntax uses a tcp:// url for symmetry with http/s
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | the request to upcast |
- Source: