scenario-mock-server
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -40,2 +40,3 @@ import * as server_with_kill from 'server-with-kill'; | ||
params: Record<string, string>; | ||
headers: Record<string, string>; | ||
}, HttpResponse>; | ||
@@ -51,2 +52,3 @@ type GraphQlResponse = { | ||
variables: Record<string, unknown>; | ||
headers: Record<string, string>; | ||
}, GraphQlResponse>; | ||
@@ -53,0 +55,0 @@ type GraphQlMock = { |
@@ -547,3 +547,3 @@ "use strict"; | ||
}); | ||
return handler({ variables }); | ||
return handler({ variables, headers: req.headers }); | ||
} | ||
@@ -550,0 +550,0 @@ |
{ | ||
"name": "scenario-mock-server", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Mock server powered by scenarios", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -202,3 +202,3 @@ # Scenario Mock Server | ||
> `function({ query, body, params, context, updateContext }): response | Promise<response>` | ||
> `function({ query, body, params, headers, context, updateContext }): response | Promise<response>` | ||
@@ -212,2 +212,3 @@ <!-- https://www.tablesgenerator.com/markdown_tables --> | ||
| params | `object` | `{}` | params object as defined by `express`. | | ||
| `headers` | `object` | `{}` | Request headers, lowercase keys, string values only. | | ||
| context | `object` | `{}` | Data stored across API calls. | | ||
@@ -254,3 +255,3 @@ | updateContext | `Function` | `partialContext => updatedContext` | Used to update context. `partialContext` can either be an `object` or a function (`context` => `partialContext`). | | ||
> `function({ variables, context, updateContext }): response | Promise<response>` | ||
> `function({ variables, headers, context, updateContext }): response | Promise<response>` | ||
@@ -262,4 +263,5 @@ <!-- https://www.tablesgenerator.com/markdown_tables --> | ||
| variables | `object` | `{}` | variables sent by client. | | ||
| `headers` | `object` | `{}` | Request headers, lowercase keys, string values only. | | ||
| context | `object` | `{}` | Data stored across API calls. | | ||
| updateContext | `Function` | `partialContext => updatedContext` | Used to update context. `partialContext` can either be an `object` or a function (`context` => `partialContext`). | | ||
| response | `undefined` / `GraphQlResponse` | _required_ | [GraphQlResponse](#graphqlresponse). | |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77417
2038
264