- Fix
GatewayConfiguration
typings
- Add
enableHTTP408OnTimeouts
toHTTPGatewayConfiguration
typings
- Use latest request in response mock #191
- Add support for (Typescript) boolean as parameters #185
- Update typings for HTTPGateway configurations #182
- Accept a function as
MethodDescriptor.path
#186
- Bugfix: Only use param matchers on the attributes assigned to them #181
- New option on the HTTP gateway (
useSocketConnectionTimeout
) to include DNS and Socket connection on the timeout #179
- Bugfix: Preserve
timeElapsed
forresponse.enhance
#178
- Ignore
null
orundefined
values for dynamic segments #175
- Bugfix: Fetch gateway not using the right configs #161
- Bugfix: Regexp injection vulnerability #171
- Lazy-match body to not trigger body-matching callback unnecessarily #163
- Allow not sending a config in the Retry middleware #164
- Fix
mockRequest.url
type #166 - Fix MockClient types #170
- Add support for optional path parameters #171
- Replace multiple instances of same path parameter #174
- Remove type GlobalFetch from FetchGateway #155
- Add
ignoreGlobalMiddleware
to typescript type definitions #148 - Update
EncodeJson
middleware to not override pre-existing content-type #149 - Accept host as a resource method param #151
- Bugfix: Encode dynamic section params #141
- Add
clear
andm
TypeScript definitions
- Add
mockRequest
TypeScript definitions
- Ability to define middleware on resource level #134
- Add TypeScript definitions #136
- Add socket and response callbacks to the HTTP Gateway to allow for timing request stages #127
- Allow use of
mockRequest
andmockClient
with params/body that are independent of order #121
- Bugfix: Fix "ReferenceError: regeneratorRuntime is not defined" when importing "mappersmith/test" #131
- Bugfix:
mockRequest
would attempt to run the old request phase without considering async definitions #130
- Add
prepareRequest
phase to middleware #129
- Bugfix: Extra query string when path already contains query string #128
- Add async middleware requests support to mocked clients #122
- Allow setting of some resource configs at manifest level #114
- Bugfix: Reject the promise when using the retry middleware and another middleware on the stack throws an error #118
- Returns HTTP 408 (instead of 400) when request times out #88
- Bugfix: Plain object response data is not stringified on subsequent mock requests #107
- Add response callback support to
mockClient
#91 - Add status callback support to
mockClient
#105
- Add a way to rename queryparams (
queryParamAlias
) #102
- Cache some RegExp to improve overall performance
- Bugfix: Abort requests on timeout (http gateway)
- Improve "network error" handling #99
- Send error instance to
gateway#dispatchClientError
#99
- Throw errors when the middleware request phase fails
- If the request phase throws an error (e.g.:
[Mappersmith] middleware "MyMiddleware" failed in the request phase: <Original error message>
) - If the request phase returns something different than a mappersmith Request object (e.g.:
[Mappersmith] middleware "MyMiddleware" should return "Request" but returned "boolean"
)
- If the request phase throws an error (e.g.:
- Allow retries on successful calls
- Add the ability to re-run the middleware stack from the response phase (renew)
- Add Request#header to get a single header value by name
- Add support for HEAD HTTP method #90
- Bugfix: Calculate
Ended-At
after evaluatingnext
in the duration middleware
- Add support to binary payloads when using fetch gateway #89
- Add support to async middleware request phase #86
- Ensures all middleware expose name #83
- Bugfix: Use uppercase HTTP methods with XHR. CORS preflight requests will fail if the method name doesn't match #80
- Add Retry middleware v2 which doesn't use a global retry configuration #79
- Retry middleware: by default don't retry requests with statuses < 500 #78
- Add option to ignore global middleware
- Bugfix: Ignore Node.js files when bundling the client
- Bugfix: fix issue when mocking clients with middleware that use context #77
- Bugfix: fix IE binary request by configuring responseType after open #76
- Enable Windows integration tests via Appveyor #75
- Add current version to main module
- Add
clientId
to help identify different clients #73 - Add global context to help with request life cycle #73
- Add a retry validation callback to the Retry Middleware #72
- Renames middlewares folder to middleware, but keep importable files
- Add globally defined middleware
- Bugfix: fix CSRF middleware cookie parser #69
- Add
uuid4
matcher to the test library
This version was removed from NPM because the test library wasn't included to the final bundle
This version was removed from NPM because the test library wasn't included to the final bundle
- Adds CSRF middleware #68
- bugfix: Fix param matchers for mockClient
- bugfix: Auth mask was mutating the auth config #65
- Add support to binary payloads #64
- Switch tests to chrome-headless #63
- Mask auth password in the Response object #60
- Scope
gatewayConfigs
to allow different instances of mappersmith clients to use different configurations
- bugfix: HTTP Gateway was calculating
content-length
wrongly #59
- Remove
performance.now
polyfill to allow the use with web workers #55
- Change the HTTP gateway to use the built-in request#setTimeout
- Accept a matcher function as an URL in
mockRequest
- Add a
configure
callback to thehttp
gateway
- Adds Duration middleware #50
- bugfix: eval('process') causes some problems in strict mode on PhantomJS #51
- Allow
mockClient
andmockRequest
to use match functions to check body #49 - Add match functions to the test module #49
- bugfix: body, auth and timeout were always being replaced by
request#enhance
- Add support to basic auth for all gateways #46
- Add
BasicAuthMiddleware
to configure a default basic auth #46 - Add support to timeout for all gateways #47
- Add
TimeoutMiddleware
to configure a default timeout #47
- Add a retry middleware with exponential retry time #38
- Add a new gateway backed by
fetch
#42 - Add
Response#header
to get a single header value by name
- bugfix: Send
resourceName
andresourceMethod
when running the test lib - Add flag (
mockRequest
) when executing the middlewares from the test lib
- Expose
resourceName
andresourceMethod
to middlewares - Features from 2.0.0-rc1 to 2.0.0-rc7
- bugfix: EncodeJSON middleware was only returning requests if the original request had a body or caused an error
- Prevent method clear from the test lib to expose the internal store
- Normalize
responseData
to be alwaysnull
when not defined - Make
mockClient
independent of theresponse
call
- bugfix:
MockClient
should use the same middlewares configured in the client #37
- bugfix:
ClientBuilder
isn't using the new configured gateway whenconfig.gateway
changes #36
- Fix regression introduced in rc3, disable gateway http when transpiling for browser
- Publish only
lib
to NPM
- Add
content-length
only for gateway http #35 - Eval
process
to avoid webpack polyfills
- New API
- New test library
- Middlewares
- Add yarn.lock
- bugfix: duplicated
content-type
on vanilla gateway #32
- Included beforeSend callback, this should be configured through Global configurations and URL matching. It will follow the same behavior as the processor callback
- bugfix: some body parsers are super strict and will fail if charset has a “;” termination. PR #26 introduced this bug trying to solve issue #27
- bugfix: prioritizes user-defined content-type header even for post/put/patch/delete methods.
application/x-www-form-urlencoded
is not forced if Content-Type header is defined.
- bugfix: wrong
content-type
on vanilla gateway, a semicolon was missing oncharset=UTF-8
- Included status code for success calls
withCredentials
option forVanillaGateway
andJQueryGateway
- Method to configure a global success handler per client
- bugfix: rules matcher now uses full URL instead of descriptor path
- Optional callback parameter when passing options to gateway. Check the section "Specifics of each gateway" for more info
- Included request and response headers into stats object
- Included a way to assign headers directly from method calls
- Method to configure a global error handler per client
- Included status code in the error request object
- Bult-in fixture support
- Holding error stack for better debugging
- Allows Promise implementation to be configured, defaults to global Promise
- Headers option for all gateways
- bugfix: support for https in
NodeVanillaGateway
- Support for Promises
- bugfix: made headers from options higher priority than built-in headers
- Fail callback now receives the requested resource (url, host, path and params). This change breaks the API for fail callback, the original error objects will be available from the second argument and beyond
- Included host and path into stats object
- Improved package size
- Included url and params into stats object
- Support for alternative hosts for each resource method
- Ability to disable host resolution
- Measure of the time elapsed between the request and the callback invocation
- Stats object for success callbacks
- bugfix: VanillaGateway doesn't parse JSON responses
- Support for Node vanilla gateway
- Ability to configure default parameters for resources
- bugfix: fixed typo
- Support for emulateHTTP
- Support for global configurations and per url match configurations
- Support for POST, PUT, PATCH and DELETE methods
- Exposed body value to gateway
- Option to change the bodyAttr name
- Processor functions for resources
- Exposed request params to the gateway to allow o POST, PUT, etc
- Compact syntax (syntatic sugar for GET methods)
- bugfix: fixed reference of Mapper and VanillaGateway in index.js
- Basic structure with Jquery and Vanilla gateways
- Support for GET method