@pact-foundation/pact 16.3.1 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/README.md +22 -12
  4. package/package.json +26 -47
  5. package/scripts/ci/build-and-test.sh +0 -3
  6. package/scripts/install-plugins.js +104 -0
  7. package/src/common/graphQL/configurationError.js +2 -22
  8. package/src/common/graphQL/configurationError.js.map +1 -1
  9. package/src/common/graphQL/graphQL.d.ts +2 -2
  10. package/src/common/graphQL/graphQL.js +11 -14
  11. package/src/common/graphQL/graphQL.js.map +1 -1
  12. package/src/common/graphQL/graphQLQueryError.js +2 -22
  13. package/src/common/graphQL/graphQLQueryError.js.map +1 -1
  14. package/src/common/logger.js +9 -9
  15. package/src/common/logger.js.map +1 -1
  16. package/src/common/matchingRules.d.ts +7 -1
  17. package/src/common/matchingRules.js +42 -22
  18. package/src/common/matchingRules.js.map +1 -1
  19. package/src/common/net.js +36 -42
  20. package/src/common/net.js.map +1 -1
  21. package/src/common/net.spec.js +39 -87
  22. package/src/common/net.spec.js.map +1 -1
  23. package/src/common/request.js +33 -82
  24. package/src/common/request.js.map +1 -1
  25. package/src/common/request.spec.js +29 -73
  26. package/src/common/request.spec.js.map +1 -1
  27. package/src/common/spec.js +3 -4
  28. package/src/common/spec.js.map +1 -1
  29. package/src/dsl/apolloGraphql.js +7 -25
  30. package/src/dsl/apolloGraphql.js.map +1 -1
  31. package/src/dsl/apolloGraphql.spec.js +21 -58
  32. package/src/dsl/apolloGraphql.spec.js.map +1 -1
  33. package/src/dsl/graphql.d.ts +2 -2
  34. package/src/dsl/graphql.js +29 -48
  35. package/src/dsl/graphql.js.map +1 -1
  36. package/src/dsl/graphql.spec.js +92 -117
  37. package/src/dsl/graphql.spec.js.map +1 -1
  38. package/src/dsl/interaction.d.ts +2 -2
  39. package/src/dsl/interaction.js +41 -48
  40. package/src/dsl/interaction.js.map +1 -1
  41. package/src/dsl/interaction.spec.js +109 -132
  42. package/src/dsl/interaction.spec.js.map +1 -1
  43. package/src/dsl/matchers.d.ts +2 -3
  44. package/src/dsl/matchers.js +19 -31
  45. package/src/dsl/matchers.js.map +1 -1
  46. package/src/dsl/matchers.spec.js +279 -289
  47. package/src/dsl/matchers.spec.js.map +1 -1
  48. package/src/dsl/message.d.ts +3 -3
  49. package/src/dsl/options.d.ts +3 -3
  50. package/src/dsl/verifier/proxy/hooks.d.ts +2 -2
  51. package/src/dsl/verifier/proxy/hooks.js +42 -112
  52. package/src/dsl/verifier/proxy/hooks.js.map +1 -1
  53. package/src/dsl/verifier/proxy/hooks.spec.js +86 -199
  54. package/src/dsl/verifier/proxy/hooks.spec.js.map +1 -1
  55. package/src/dsl/verifier/proxy/messages.d.ts +2 -2
  56. package/src/dsl/verifier/proxy/messages.js +88 -106
  57. package/src/dsl/verifier/proxy/messages.js.map +1 -1
  58. package/src/dsl/verifier/proxy/parseBody.d.ts +1 -1
  59. package/src/dsl/verifier/proxy/parseBody.js +3 -3
  60. package/src/dsl/verifier/proxy/parseBody.js.map +1 -1
  61. package/src/dsl/verifier/proxy/parseBody.spec.js +35 -113
  62. package/src/dsl/verifier/proxy/parseBody.spec.js.map +1 -1
  63. package/src/dsl/verifier/proxy/proxy.d.ts +2 -2
  64. package/src/dsl/verifier/proxy/proxy.js +22 -26
  65. package/src/dsl/verifier/proxy/proxy.js.map +1 -1
  66. package/src/dsl/verifier/proxy/proxy.spec.js +11 -53
  67. package/src/dsl/verifier/proxy/proxy.spec.js.map +1 -1
  68. package/src/dsl/verifier/proxy/proxyRequest.d.ts +3 -3
  69. package/src/dsl/verifier/proxy/proxyRequest.js +7 -7
  70. package/src/dsl/verifier/proxy/proxyRequest.js.map +1 -1
  71. package/src/dsl/verifier/proxy/proxyRequest.spec.js +54 -104
  72. package/src/dsl/verifier/proxy/proxyRequest.spec.js.map +1 -1
  73. package/src/dsl/verifier/proxy/stateHandler/setupStates.d.ts +3 -3
  74. package/src/dsl/verifier/proxy/stateHandler/setupStates.js +14 -18
  75. package/src/dsl/verifier/proxy/stateHandler/setupStates.js.map +1 -1
  76. package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js +76 -193
  77. package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js.map +1 -1
  78. package/src/dsl/verifier/proxy/stateHandler/stateHandler.d.ts +2 -2
  79. package/src/dsl/verifier/proxy/stateHandler/stateHandler.js +23 -72
  80. package/src/dsl/verifier/proxy/stateHandler/stateHandler.js.map +1 -1
  81. package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js +37 -122
  82. package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js.map +1 -1
  83. package/src/dsl/verifier/proxy/tracer.d.ts +1 -1
  84. package/src/dsl/verifier/proxy/tracer.js +42 -35
  85. package/src/dsl/verifier/proxy/tracer.js.map +1 -1
  86. package/src/dsl/verifier/proxy/types.d.ts +5 -5
  87. package/src/dsl/verifier/types.d.ts +3 -3
  88. package/src/dsl/verifier/verifier.d.ts +5 -1
  89. package/src/dsl/verifier/verifier.js +53 -60
  90. package/src/dsl/verifier/verifier.js.map +1 -1
  91. package/src/dsl/verifier/verifier.spec.js +84 -151
  92. package/src/dsl/verifier/verifier.spec.js.map +1 -1
  93. package/src/errors/configurationError.js +2 -22
  94. package/src/errors/configurationError.js.map +1 -1
  95. package/src/errors/graphQLQueryError.js +2 -22
  96. package/src/errors/graphQLQueryError.js.map +1 -1
  97. package/src/errors/matcherError.js +2 -22
  98. package/src/errors/matcherError.js.map +1 -1
  99. package/src/errors/verificationError.js +2 -22
  100. package/src/errors/verificationError.js.map +1 -1
  101. package/src/httpPact/ffi.d.ts +2 -2
  102. package/src/httpPact/ffi.js +28 -29
  103. package/src/httpPact/ffi.js.map +1 -1
  104. package/src/httpPact/ffi.spec.js +40 -83
  105. package/src/httpPact/ffi.spec.js.map +1 -1
  106. package/src/httpPact/index.d.ts +3 -3
  107. package/src/httpPact/index.js +92 -149
  108. package/src/httpPact/index.js.map +1 -1
  109. package/src/httpPact/index.spec.js +102 -195
  110. package/src/httpPact/index.spec.js.map +1 -1
  111. package/src/httpPact/tracing.js +20 -28
  112. package/src/httpPact/tracing.js.map +1 -1
  113. package/src/index.d.ts +25 -25
  114. package/src/index.js +29 -29
  115. package/src/index.js.map +1 -1
  116. package/src/messageConsumerPact.d.ts +5 -5
  117. package/src/messageConsumerPact.js +59 -53
  118. package/src/messageConsumerPact.js.map +1 -1
  119. package/src/messageConsumerPact.spec.js +55 -97
  120. package/src/messageConsumerPact.spec.js.map +1 -1
  121. package/src/messageProviderPact.d.ts +3 -3
  122. package/src/messageProviderPact.js +68 -85
  123. package/src/messageProviderPact.js.map +1 -1
  124. package/src/messageProviderPact.spec.js +96 -123
  125. package/src/messageProviderPact.spec.js.map +1 -1
  126. package/src/pact.integration.spec.js +242 -351
  127. package/src/pact.integration.spec.js.map +1 -1
  128. package/src/v3/display.d.ts +1 -1
  129. package/src/v3/display.js +44 -58
  130. package/src/v3/display.js.map +1 -1
  131. package/src/v3/ffi.js +20 -16
  132. package/src/v3/ffi.js.map +1 -1
  133. package/src/v3/ffi.spec.js +7 -42
  134. package/src/v3/ffi.spec.js.map +1 -1
  135. package/src/v3/graphql/graphQL.d.ts +4 -4
  136. package/src/v3/graphql/graphQL.js +50 -75
  137. package/src/v3/graphql/graphQL.js.map +1 -1
  138. package/src/v3/graphql/index.d.ts +1 -1
  139. package/src/v3/graphql/index.js +1 -1
  140. package/src/v3/graphql/index.js.map +1 -1
  141. package/src/v3/index.d.ts +4 -12
  142. package/src/v3/index.js +4 -12
  143. package/src/v3/index.js.map +1 -1
  144. package/src/v3/matchers.d.ts +15 -3
  145. package/src/v3/matchers.js +131 -148
  146. package/src/v3/matchers.js.map +1 -1
  147. package/src/v3/matchers.spec.js +281 -232
  148. package/src/v3/matchers.spec.js.map +1 -1
  149. package/src/v3/pact.d.ts +2 -2
  150. package/src/v3/pact.js +108 -151
  151. package/src/v3/pact.js.map +1 -1
  152. package/src/v3/pact.spec.js +94 -0
  153. package/src/v3/pact.spec.js.map +1 -0
  154. package/src/v3/types.d.ts +19 -3
  155. package/src/v3/types.js +22 -1
  156. package/src/v3/types.js.map +1 -1
  157. package/src/v4/graphql/graphQLInteractionWithRequest.d.ts +4 -4
  158. package/src/v4/graphql/graphQLInteractionWithRequest.js +21 -17
  159. package/src/v4/graphql/graphQLInteractionWithRequest.js.map +1 -1
  160. package/src/v4/graphql/graphQLRequestBuilder.d.ts +3 -3
  161. package/src/v4/graphql/graphQLRequestBuilder.js +18 -20
  162. package/src/v4/graphql/graphQLRequestBuilder.js.map +1 -1
  163. package/src/v4/graphql/index.d.ts +6 -6
  164. package/src/v4/graphql/index.js +21 -17
  165. package/src/v4/graphql/index.js.map +1 -1
  166. package/src/v4/graphql/types.d.ts +5 -5
  167. package/src/v4/http/index.d.ts +2 -2
  168. package/src/v4/http/index.js +53 -93
  169. package/src/v4/http/index.js.map +1 -1
  170. package/src/v4/http/index.spec.d.ts +1 -0
  171. package/src/v4/http/index.spec.js +73 -0
  172. package/src/v4/http/index.spec.js.map +1 -0
  173. package/src/v4/http/interactionWithCompleteRequest.d.ts +4 -7
  174. package/src/v4/http/interactionWithCompleteRequest.js +6 -10
  175. package/src/v4/http/interactionWithCompleteRequest.js.map +1 -1
  176. package/src/v4/http/interactionWithPlugin.d.ts +3 -3
  177. package/src/v4/http/interactionWithPlugin.js +14 -11
  178. package/src/v4/http/interactionWithPlugin.js.map +1 -1
  179. package/src/v4/http/interactionWithPluginRequest.d.ts +4 -3
  180. package/src/v4/http/interactionWithPluginRequest.js +17 -9
  181. package/src/v4/http/interactionWithPluginRequest.js.map +1 -1
  182. package/src/v4/http/interactionWithPluginResponse.d.ts +2 -2
  183. package/src/v4/http/interactionWithPluginResponse.js +10 -48
  184. package/src/v4/http/interactionWithPluginResponse.js.map +1 -1
  185. package/src/v4/http/interactionWithRequest.d.ts +4 -3
  186. package/src/v4/http/interactionWithRequest.js +17 -9
  187. package/src/v4/http/interactionWithRequest.js.map +1 -1
  188. package/src/v4/http/interactionWithRequest.spec.d.ts +1 -0
  189. package/src/v4/http/interactionWithRequest.spec.js +82 -0
  190. package/src/v4/http/interactionWithRequest.spec.js.map +1 -0
  191. package/src/v4/http/interactionWithResponse.d.ts +2 -2
  192. package/src/v4/http/interactionWithResponse.js +10 -48
  193. package/src/v4/http/interactionWithResponse.js.map +1 -1
  194. package/src/v4/http/requestBuilder.d.ts +4 -3
  195. package/src/v4/http/requestBuilder.js +36 -34
  196. package/src/v4/http/requestBuilder.js.map +1 -1
  197. package/src/v4/http/requestBuilder.spec.d.ts +1 -0
  198. package/src/v4/http/requestBuilder.spec.js +42 -0
  199. package/src/v4/http/requestBuilder.spec.js.map +1 -0
  200. package/src/v4/http/requestWithPluginBuilder.d.ts +3 -2
  201. package/src/v4/http/requestWithPluginBuilder.js +30 -46
  202. package/src/v4/http/requestWithPluginBuilder.js.map +1 -1
  203. package/src/v4/http/requestWithPluginBuilder.spec.d.ts +1 -0
  204. package/src/v4/http/requestWithPluginBuilder.spec.js +34 -0
  205. package/src/v4/http/requestWithPluginBuilder.spec.js.map +1 -0
  206. package/src/v4/http/responseBuilder.d.ts +4 -3
  207. package/src/v4/http/responseBuilder.js +28 -25
  208. package/src/v4/http/responseBuilder.js.map +1 -1
  209. package/src/v4/http/responseBuilder.spec.d.ts +1 -0
  210. package/src/v4/http/responseBuilder.spec.js +42 -0
  211. package/src/v4/http/responseBuilder.spec.js.map +1 -0
  212. package/src/v4/http/responseWithPluginBuilder.d.ts +1 -1
  213. package/src/v4/http/responseWithPluginBuilder.js +5 -25
  214. package/src/v4/http/responseWithPluginBuilder.js.map +1 -1
  215. package/src/v4/http/responseWithPluginBuilder.spec.d.ts +1 -0
  216. package/src/v4/http/responseWithPluginBuilder.spec.js +34 -0
  217. package/src/v4/http/responseWithPluginBuilder.spec.js.map +1 -0
  218. package/src/v4/http/types.d.ts +13 -4
  219. package/src/v4/http/unconfiguredInteraction.d.ts +6 -5
  220. package/src/v4/http/unconfiguredInteraction.js +31 -26
  221. package/src/v4/http/unconfiguredInteraction.js.map +1 -1
  222. package/src/v4/index.d.ts +6 -5
  223. package/src/v4/index.js +32 -35
  224. package/src/v4/index.js.map +1 -1
  225. package/src/v4/message/asynchronousMessage.d.ts +7 -6
  226. package/src/v4/message/asynchronousMessage.js +157 -190
  227. package/src/v4/message/asynchronousMessage.js.map +1 -1
  228. package/src/v4/message/index.d.ts +7 -6
  229. package/src/v4/message/index.js +188 -217
  230. package/src/v4/message/index.js.map +1 -1
  231. package/src/v4/message/types.d.ts +5 -3
  232. package/src/v4/types.d.ts +3 -3
  233. package/src/xml/index.d.ts +4 -0
  234. package/src/xml/index.js +21 -0
  235. package/src/xml/index.js.map +1 -0
  236. package/src/{v3/xml → xml}/xmlBuilder.d.ts +1 -3
  237. package/src/{v3/xml → xml}/xmlBuilder.js +7 -9
  238. package/src/xml/xmlBuilder.js.map +1 -0
  239. package/src/{v3/xml → xml}/xmlElement.d.ts +2 -2
  240. package/src/xml/xmlElement.js +73 -0
  241. package/src/xml/xmlElement.js.map +1 -0
  242. package/src/xml/xmlElement.spec.d.ts +1 -0
  243. package/src/xml/xmlElement.spec.js +107 -0
  244. package/src/xml/xmlElement.spec.js.map +1 -0
  245. package/src/xml/xmlNode.js +7 -0
  246. package/src/xml/xmlNode.js.map +1 -0
  247. package/src/{v3/xml → xml}/xmlText.d.ts +1 -1
  248. package/src/xml/xmlText.js +15 -0
  249. package/src/xml/xmlText.js.map +1 -0
  250. package/scripts/install-plugins +0 -106
  251. package/src/v3/xml/xmlBuilder.js.map +0 -1
  252. package/src/v3/xml/xmlElement.js +0 -90
  253. package/src/v3/xml/xmlElement.js.map +0 -1
  254. package/src/v3/xml/xmlElement.spec.js +0 -113
  255. package/src/v3/xml/xmlElement.spec.js.map +0 -1
  256. package/src/v3/xml/xmlNode.js +0 -10
  257. package/src/v3/xml/xmlNode.js.map +0 -1
  258. package/src/v3/xml/xmlText.js +0 -31
  259. package/src/v3/xml/xmlText.js.map +0 -1
  260. /package/src/v3/{xml/xmlElement.spec.d.ts → pact.spec.d.ts} +0 -0
  261. /package/src/{v3/xml → xml}/xmlNode.d.ts +0 -0
package/src/v3/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonMap } from '../common/jsonTypes';
1
+ import type { JsonMap } from '../common/jsonTypes';
2
2
  export declare enum SpecificationVersion {
3
3
  SPECIFICATION_VERSION_V2 = 3,
4
4
  SPECIFICATION_VERSION_V3 = 4,
@@ -37,9 +37,25 @@ export interface ArrayContainsMatcher extends Matcher<unknown[]> {
37
37
  export interface ProviderStateInjectedValue<T> extends Matcher<T> {
38
38
  expression: string;
39
39
  }
40
+ export interface StatusCodeMatcher<T> extends Matcher<T> {
41
+ status: HTTPResponseStatusClass | number[];
42
+ }
40
43
  export interface RulesMatcher<T> extends Matcher<T> {
41
44
  rules: Matcher<T>[];
42
45
  }
46
+ /**
47
+ * Enum for HTTP response status classes used with the status code matcher.
48
+ * These values correspond to the status code ranges defined in RFC 7231.
49
+ */
50
+ export declare enum HTTPResponseStatusClass {
51
+ Information = "information",
52
+ Success = "success",
53
+ Redirect = "redirect",
54
+ ClientError = "clientError",
55
+ ServerError = "serverError",
56
+ NonError = "nonError",
57
+ Error = "error"
58
+ }
43
59
  /**
44
60
  * Part of a request or response where matching rules can be applied
45
61
  */
@@ -76,7 +92,7 @@ export interface PactV3Options {
76
92
  */
77
93
  provider: string;
78
94
  /**
79
- * If the mock server should handle CORS pre-flight requests. Defaults to false
95
+ * If the mock server should handle CORS pre-flight requests. Defaults to true
80
96
  */
81
97
  cors?: boolean;
82
98
  /**
@@ -124,7 +140,7 @@ export interface V3Request {
124
140
  contentType?: string;
125
141
  }
126
142
  export interface V3Response {
127
- status: number;
143
+ status: number | StatusCodeMatcher<number>;
128
144
  headers?: TemplateHeaders;
129
145
  body?: unknown;
130
146
  contentType?: string;
package/src/v3/types.js CHANGED
@@ -1,10 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SpecificationVersion = void 0;
3
+ exports.HTTPResponseStatusClass = exports.SpecificationVersion = void 0;
4
4
  var SpecificationVersion;
5
5
  (function (SpecificationVersion) {
6
6
  SpecificationVersion[SpecificationVersion["SPECIFICATION_VERSION_V2"] = 3] = "SPECIFICATION_VERSION_V2";
7
7
  SpecificationVersion[SpecificationVersion["SPECIFICATION_VERSION_V3"] = 4] = "SPECIFICATION_VERSION_V3";
8
8
  SpecificationVersion[SpecificationVersion["SPECIFICATION_VERSION_V4"] = 5] = "SPECIFICATION_VERSION_V4";
9
9
  })(SpecificationVersion || (exports.SpecificationVersion = SpecificationVersion = {}));
10
+ /**
11
+ * Enum for HTTP response status classes used with the status code matcher.
12
+ * These values correspond to the status code ranges defined in RFC 7231.
13
+ */
14
+ var HTTPResponseStatusClass;
15
+ (function (HTTPResponseStatusClass) {
16
+ // Informational responses (100–199)
17
+ HTTPResponseStatusClass["Information"] = "information";
18
+ // Successful responses (200–299)
19
+ HTTPResponseStatusClass["Success"] = "success";
20
+ // Redirects (300–399)
21
+ HTTPResponseStatusClass["Redirect"] = "redirect";
22
+ // Client errors (400–499)
23
+ HTTPResponseStatusClass["ClientError"] = "clientError";
24
+ // Server errors (500–599)
25
+ HTTPResponseStatusClass["ServerError"] = "serverError";
26
+ // Non-error response (< 400)
27
+ HTTPResponseStatusClass["NonError"] = "nonError";
28
+ // Any error response (>= 400)
29
+ HTTPResponseStatusClass["Error"] = "error";
30
+ })(HTTPResponseStatusClass || (exports.HTTPResponseStatusClass = HTTPResponseStatusClass = {}));
10
31
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/v3/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,uGAA4B,CAAA;IAC5B,uGAA4B,CAAA;IAC5B,uGAA4B,CAAA;AAC9B,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/v3/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,uGAA4B,CAAA;IAC5B,uGAA4B,CAAA;IAC5B,uGAA4B,CAAA;AAC9B,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAkDD;;;GAGG;AACH,IAAY,uBAeX;AAfD,WAAY,uBAAuB;IACjC,oCAAoC;IACpC,sDAA2B,CAAA;IAC3B,iCAAiC;IACjC,8CAAmB,CAAA;IACnB,sBAAsB;IACtB,gDAAqB,CAAA;IACrB,0BAA0B;IAC1B,sDAA2B,CAAA;IAC3B,0BAA0B;IAC1B,sDAA2B,CAAA;IAC3B,6BAA6B;IAC7B,gDAAqB,CAAA;IACrB,8BAA8B;IAC9B,0CAAe,CAAA;AACjB,CAAC,EAfW,uBAAuB,uCAAvB,uBAAuB,QAelC"}
@@ -1,7 +1,7 @@
1
- import { ConsumerPact, ConsumerInteraction } from '@pact-foundation/pact-core';
2
- import { ASTNode } from 'graphql';
3
- import { PactV4Options, V4InteractionWithRequest } from '../http/types';
4
- import { V4GraphQLInteractionWithRequest, GraphqlRequest } from './types';
1
+ import type { ConsumerInteraction, ConsumerPact } from '@pact-foundation/pact-core';
2
+ import type { ASTNode } from 'graphql';
3
+ import type { PactV4Options, V4InteractionWithRequest } from '../http/types';
4
+ import { type GraphqlRequest, type V4GraphQLInteractionWithRequest } from './types';
5
5
  export declare class GraphQLInteractionWithRequest implements V4GraphQLInteractionWithRequest {
6
6
  protected pact: ConsumerPact;
7
7
  protected interaction: ConsumerInteraction;
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphQLInteractionWithRequest = void 0;
4
- var lodash_1 = require("lodash");
5
- var ramda_1 = require("ramda");
6
- var graphQL_1 = require("../../common/graphQL/graphQL");
7
- var interactionWithRequest_1 = require("../http/interactionWithRequest");
8
- var types_1 = require("./types");
9
- var matchers_1 = require("../../v3/matchers");
10
- var GraphQLInteractionWithRequest = /** @class */ (function () {
4
+ const lodash_1 = require("lodash");
5
+ const ramda_1 = require("ramda");
6
+ const graphQL_1 = require("../../common/graphQL/graphQL");
7
+ const matchers_1 = require("../../v3/matchers");
8
+ const interactionWithRequest_1 = require("../http/interactionWithRequest");
9
+ const types_1 = require("./types");
10
+ class GraphQLInteractionWithRequest {
11
+ pact;
12
+ interaction;
13
+ opts;
14
+ cleanupFn;
15
+ graphQLRequest;
11
16
  // tslint:disable:no-empty-function
12
- function GraphQLInteractionWithRequest(pact, interaction, opts, cleanupFn, graphQLRequest) {
17
+ constructor(pact, interaction, opts, cleanupFn, graphQLRequest) {
13
18
  this.pact = pact;
14
19
  this.interaction = interaction;
15
20
  this.opts = opts;
@@ -36,22 +41,21 @@ var GraphQLInteractionWithRequest = /** @class */ (function () {
36
41
  * @param query {string|ASTNode} parsed or unparsed query
37
42
  * @return this object
38
43
  */
39
- GraphQLInteractionWithRequest.prototype.withQuery = function (query) {
44
+ withQuery(query) {
40
45
  return this.setQueryDetails(query, types_1.OperationType.Query);
41
- };
42
- GraphQLInteractionWithRequest.prototype.withMutation = function (mutation) {
46
+ }
47
+ withMutation(mutation) {
43
48
  return this.setQueryDetails(mutation, types_1.OperationType.Mutation);
44
- };
45
- GraphQLInteractionWithRequest.prototype.setQueryDetails = function (query, type) {
46
- var validatedQuery = (0, graphQL_1.validateQuery)(query, type);
49
+ }
50
+ setQueryDetails(query, type) {
51
+ const validatedQuery = (0, graphQL_1.validateQuery)(query, type);
47
52
  this.interaction.withRequestBody(JSON.stringify((0, ramda_1.reject)(lodash_1.isUndefined, {
48
53
  operationName: this.graphQLRequest.operation,
49
54
  query: (0, matchers_1.regex)((0, graphQL_1.escapeGraphQlQuery)(validatedQuery), validatedQuery),
50
55
  variables: this.graphQLRequest.variables,
51
56
  })), 'application/json');
52
57
  return new interactionWithRequest_1.InteractionWithRequest(this.pact, this.interaction, this.opts, this.cleanupFn);
53
- };
54
- return GraphQLInteractionWithRequest;
55
- }());
58
+ }
59
+ }
56
60
  exports.GraphQLInteractionWithRequest = GraphQLInteractionWithRequest;
57
61
  //# sourceMappingURL=graphQLInteractionWithRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphQLInteractionWithRequest.js","sourceRoot":"","sources":["../../../../src/v4/graphql/graphQLInteractionWithRequest.ts"],"names":[],"mappings":";;;AAEA,iCAAqC;AACrC,+BAA+B;AAE/B,wDAGsC;AACtC,yEAAwE;AAExE,iCAIiB;AACjB,8CAA0C;AAE1C;IAGE,mCAAmC;IACnC,uCACY,IAAkB,EAClB,WAAgC,EAChC,IAAmB,EACnB,SAAqB,EACrB,cAA8B;QAJ9B,SAAI,GAAJ,IAAI,CAAc;QAClB,gBAAW,GAAX,WAAW,CAAqB;QAChC,SAAI,GAAJ,IAAI,CAAe;QACnB,cAAS,GAAT,SAAS,CAAY;QACrB,mBAAc,GAAd,cAAc,CAAgB;IACvC,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;OAmBG;IACH,iDAAS,GAAT,UAAU,KAAuB;QAC/B,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,qBAAa,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,oDAAY,GAAZ,UAAa,QAA0B;QACrC,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,qBAAa,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAEO,uDAAe,GAAvB,UACE,KAAuB,EACvB,IAAmB;QAEnB,IAAM,cAAc,GAAG,IAAA,uBAAa,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B,IAAI,CAAC,SAAS,CACZ,IAAA,cAAM,EAAC,oBAAW,EAAE;YAClB,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS;YAC5C,KAAK,EAAE,IAAA,gBAAK,EAAC,IAAA,4BAAkB,EAAC,cAAc,CAAC,EAAE,cAAc,CAAC;YAChE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS;SACzC,CAAC,CACH,EACD,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,+CAAsB,CAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IACH,oCAAC;AAAD,CAAC,AAhED,IAgEC;AAhEY,sEAA6B"}
1
+ {"version":3,"file":"graphQLInteractionWithRequest.js","sourceRoot":"","sources":["../../../../src/v4/graphql/graphQLInteractionWithRequest.ts"],"names":[],"mappings":";;;AAKA,mCAAqC;AACrC,iCAA+B;AAE/B,0DAGsC;AACtC,gDAA0C;AAC1C,2EAAwE;AAExE,mCAIiB;AAEjB,MAAa,6BAA6B;IAK5B;IACA;IACA;IACA;IACA;IANZ,mCAAmC;IACnC,YACY,IAAkB,EAClB,WAAgC,EAChC,IAAmB,EACnB,SAAqB,EACrB,cAA8B;QAJ9B,SAAI,GAAJ,IAAI,CAAc;QAClB,gBAAW,GAAX,WAAW,CAAqB;QAChC,SAAI,GAAJ,IAAI,CAAe;QACnB,cAAS,GAAT,SAAS,CAAY;QACrB,mBAAc,GAAd,cAAc,CAAgB;IACvC,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,KAAuB;QAC/B,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,qBAAa,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,YAAY,CAAC,QAA0B;QACrC,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,qBAAa,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;IAEO,eAAe,CACrB,KAAuB,EACvB,IAAmB;QAEnB,MAAM,cAAc,GAAG,IAAA,uBAAa,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,WAAW,CAAC,eAAe,CAC9B,IAAI,CAAC,SAAS,CACZ,IAAA,cAAM,EAAC,oBAAW,EAAE;YAClB,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS;YAC5C,KAAK,EAAE,IAAA,gBAAK,EAAC,IAAA,4BAAkB,EAAC,cAAc,CAAC,EAAE,cAAc,CAAC;YAChE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS;SACzC,CAAC,CACH,EACD,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,+CAAsB,CAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;CACF;AAhED,sEAgEC"}
@@ -1,6 +1,6 @@
1
- import { ConsumerInteraction } from '@pact-foundation/pact-core';
2
- import { TemplateQuery, TemplateHeaders } from '../../v3';
3
- import { V4GraphQLRequestBuilder } from './types';
1
+ import type { ConsumerInteraction } from '@pact-foundation/pact-core';
2
+ import type { TemplateHeaders, TemplateQuery } from '../../v3';
3
+ import type { V4GraphQLRequestBuilder } from './types';
4
4
  export declare class GraphQLRequestBuilder implements V4GraphQLRequestBuilder {
5
5
  protected interaction: ConsumerInteraction;
6
6
  constructor(interaction: ConsumerInteraction);
@@ -1,42 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphQLRequestBuilder = void 0;
4
- var ramda_1 = require("ramda");
5
- var matchers_1 = require("../../v3/matchers");
6
- var GraphQLRequestBuilder = /** @class */ (function () {
4
+ const ramda_1 = require("ramda");
5
+ const matchers_1 = require("../../v3/matchers");
6
+ class GraphQLRequestBuilder {
7
+ interaction;
7
8
  // tslint:disable:no-empty-function
8
- function GraphQLRequestBuilder(interaction) {
9
+ constructor(interaction) {
9
10
  this.interaction = interaction;
10
11
  }
11
- GraphQLRequestBuilder.prototype.query = function (query) {
12
- var _this = this;
13
- (0, ramda_1.forEachObjIndexed)(function (v, k) {
12
+ query(query) {
13
+ (0, ramda_1.forEachObjIndexed)((v, k) => {
14
14
  if (Array.isArray(v)) {
15
- v.forEach(function (vv, i) {
16
- _this.interaction.withQuery(k, i, (0, matchers_1.matcherValueOrString)(vv));
15
+ v.forEach((vv, i) => {
16
+ this.interaction.withQuery(k, i, (0, matchers_1.matcherValueOrString)(vv));
17
17
  });
18
18
  }
19
19
  else {
20
- _this.interaction.withQuery(k, 0, (0, matchers_1.matcherValueOrString)(v));
20
+ this.interaction.withQuery(k, 0, (0, matchers_1.matcherValueOrString)(v));
21
21
  }
22
22
  }, query);
23
23
  return this;
24
- };
25
- GraphQLRequestBuilder.prototype.headers = function (headers) {
26
- var _this = this;
27
- (0, ramda_1.forEachObjIndexed)(function (v, k) {
24
+ }
25
+ headers(headers) {
26
+ (0, ramda_1.forEachObjIndexed)((v, k) => {
28
27
  if (Array.isArray(v)) {
29
- v.forEach(function (header, index) {
30
- _this.interaction.withRequestHeader("".concat(k), index, (0, matchers_1.matcherValueOrString)(header));
28
+ v.forEach((header, index) => {
29
+ this.interaction.withRequestHeader(`${k}`, index, (0, matchers_1.matcherValueOrString)(header));
31
30
  });
32
31
  }
33
32
  else {
34
- _this.interaction.withRequestHeader("".concat(k), 0, (0, matchers_1.matcherValueOrString)(v));
33
+ this.interaction.withRequestHeader(`${k}`, 0, (0, matchers_1.matcherValueOrString)(v));
35
34
  }
36
35
  }, headers);
37
36
  return this;
38
- };
39
- return GraphQLRequestBuilder;
40
- }());
37
+ }
38
+ }
41
39
  exports.GraphQLRequestBuilder = GraphQLRequestBuilder;
42
40
  //# sourceMappingURL=graphQLRequestBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphQLRequestBuilder.js","sourceRoot":"","sources":["../../../../src/v4/graphql/graphQLRequestBuilder.ts"],"names":[],"mappings":";;;AACA,+BAA0C;A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AAC,CAC7B,CAAC;gBACJ,CAAC,CACF,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,IAAA,+BAAoB,EAAC,CAAC,CAAC,CAAC,CAAC;YACzE,CAAC;QACH,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArCD,sDAqCC"}
@@ -1,9 +1,9 @@
1
- import { ConsumerInteraction, ConsumerPact } from '@pact-foundation/pact-core';
2
- import { V4GraphQLInteractionWithRequest, V4GraphQLRequestBuilderFunc, V4UnconfiguredGraphQLInteraction } from './types';
3
- import { PactV4Options } from '../http/types';
4
- import { JsonMap } from '../../common/jsonTypes';
5
- import { Path } from '../../v3';
6
- import { GraphQLVariables } from '../../common/graphQL/graphQL';
1
+ import type { ConsumerInteraction, ConsumerPact } from '@pact-foundation/pact-core';
2
+ import type { GraphQLVariables } from '../../common/graphQL/graphQL';
3
+ import type { JsonMap } from '../../common/jsonTypes';
4
+ import type { Path } from '../../v3';
5
+ import type { PactV4Options } from '../http/types';
6
+ import type { V4GraphQLInteractionWithRequest, V4GraphQLRequestBuilderFunc, V4UnconfiguredGraphQLInteraction } from './types';
7
7
  export declare class UnconfiguredGraphQLInteraction implements V4UnconfiguredGraphQLInteraction {
8
8
  protected pact: ConsumerPact;
9
9
  protected interaction: ConsumerInteraction;
@@ -1,31 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UnconfiguredGraphQLInteraction = void 0;
4
- var matchers_1 = require("../../v3/matchers");
5
- var graphQLRequestBuilder_1 = require("./graphQLRequestBuilder");
6
- var graphQLInteractionWithRequest_1 = require("./graphQLInteractionWithRequest");
7
- var UnconfiguredGraphQLInteraction = /** @class */ (function () {
4
+ const matchers_1 = require("../../v3/matchers");
5
+ const graphQLInteractionWithRequest_1 = require("./graphQLInteractionWithRequest");
6
+ const graphQLRequestBuilder_1 = require("./graphQLRequestBuilder");
7
+ class UnconfiguredGraphQLInteraction {
8
+ pact;
9
+ interaction;
10
+ opts;
11
+ cleanupFn;
12
+ graphQLRequest;
8
13
  // tslint:disable:no-empty-function
9
- function UnconfiguredGraphQLInteraction(pact, interaction, opts, cleanupFn) {
14
+ constructor(pact, interaction, opts, cleanupFn) {
10
15
  this.pact = pact;
11
16
  this.interaction = interaction;
12
17
  this.opts = opts;
13
18
  this.cleanupFn = cleanupFn;
14
19
  this.graphQLRequest = {};
15
20
  }
16
- UnconfiguredGraphQLInteraction.prototype.withOperation = function (operation) {
21
+ withOperation(operation) {
17
22
  this.graphQLRequest.operation = operation;
18
23
  return this;
19
- };
20
- UnconfiguredGraphQLInteraction.prototype.withVariables = function (variables) {
24
+ }
25
+ withVariables(variables) {
21
26
  this.graphQLRequest.variables = variables;
22
27
  return this;
23
- };
24
- UnconfiguredGraphQLInteraction.prototype.uponReceiving = function (description) {
28
+ }
29
+ uponReceiving(description) {
25
30
  this.interaction.uponReceiving(description);
26
31
  return this;
27
- };
28
- UnconfiguredGraphQLInteraction.prototype.given = function (state, parameters) {
32
+ }
33
+ given(state, parameters) {
29
34
  if (parameters) {
30
35
  this.interaction.givenWithParams(state, JSON.stringify(parameters));
31
36
  }
@@ -33,15 +38,14 @@ var UnconfiguredGraphQLInteraction = /** @class */ (function () {
33
38
  this.interaction.given(state);
34
39
  }
35
40
  return this;
36
- };
37
- UnconfiguredGraphQLInteraction.prototype.withRequest = function (method, path, builder) {
41
+ }
42
+ withRequest(method, path, builder) {
38
43
  this.interaction.withRequest(method, (0, matchers_1.matcherValueOrString)(path));
39
44
  if (builder) {
40
45
  builder(new graphQLRequestBuilder_1.GraphQLRequestBuilder(this.interaction));
41
46
  }
42
47
  return new graphQLInteractionWithRequest_1.GraphQLInteractionWithRequest(this.pact, this.interaction, this.opts, this.cleanupFn, this.graphQLRequest);
43
- };
44
- return UnconfiguredGraphQLInteraction;
45
- }());
48
+ }
49
+ }
46
50
  exports.UnconfiguredGraphQLInteraction = UnconfiguredGraphQLInteraction;
47
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/graphql/index.ts"],"names":[],"mappings":";;;AAWA,8CAAyD;AAEzD,iEAAgE;AAChE,iFAAgF;AAEhF;IAKE,mCAAmC;IACnC,wCACY,IAAkB,EAClB,WAAgC,EAChC,IAAmB,EACnB,SAAqB;QAHrB,SAAI,GAAJ,IAAI,CAAc;QAClB,gBAAW,GAAX,WAAW,CAAqB;QAChC,SAAI,GAAJ,IAAI,CAAe;QACnB,cAAS,GAAT,SAAS,CAAY;QAE/B,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,sDAAa,GAAb,UAAc,SAAiB;QAC7B,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sDAAa,GAAb,UAAc,SAA2B;QACvC,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC;QAE1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,sDAAa,GAAb,UAAc,WAAmB;QAC/B,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8CAAK,GAAL,UAAM,KAAa,EAAE,UAAoB;QACvC,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oDAAW,GAAX,UACE,MAAc,EACd,IAAU,EACV,OAAqC;QAErC,I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K,CAAC,KAAa,EAAE,UAAoB;QACvC,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CACT,MAAc,EACd,IAAU,EACV,OAAqC;QAErC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE,IAAA,+BAAoB,EAAC,IAAI,CAAC,CAAC,CAAC;QAEjE,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,6CAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,IAAI,6DAA6B,CACtC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;CACF;AA7DD,wEA6DC"}
@@ -1,8 +1,8 @@
1
- import { ASTNode } from 'graphql';
2
- import { JsonMap } from '../../common/jsonTypes';
3
- import { Path, TemplateHeaders, TemplateQuery } from '../../v3';
4
- import { V4InteractionWithRequest } from '../http/types';
5
- import { GraphQLVariables } from '../../common/graphQL/graphQL';
1
+ import type { ASTNode } from 'graphql';
2
+ import type { GraphQLVariables } from '../../common/graphQL/graphQL';
3
+ import type { JsonMap } from '../../common/jsonTypes';
4
+ import type { Path, TemplateHeaders, TemplateQuery } from '../../v3';
5
+ import type { V4InteractionWithRequest } from '../http/types';
6
6
  export declare enum OperationType {
7
7
  Mutation = "Mutation",
8
8
  Query = "Query"
@@ -1,4 +1,4 @@
1
- import { ConsumerPact } from '@pact-foundation/pact-core';
2
- import { PactV4Options, TestFunction } from './types';
1
+ import type { ConsumerPact } from '@pact-foundation/pact-core';
2
+ import type { PactV4Options, TestFunction } from './types';
3
3
  export declare const readBinaryData: (file: string) => Buffer;
4
4
  export declare const executeTest: <T>(pact: ConsumerPact, opts: PactV4Options, testFn: TestFunction<T>, cleanupFn: () => void) => Promise<T | undefined>;
@@ -1,59 +1,24 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
4
  };
41
5
  Object.defineProperty(exports, "__esModule", { value: true });
42
6
  exports.executeTest = exports.readBinaryData = void 0;
43
- var fs = require("fs");
44
- var display_1 = require("../../v3/display");
45
- var logger_1 = __importDefault(require("../../common/logger"));
46
- var readBinaryData = function (file) {
7
+ const fs = require("node:fs");
8
+ const logger_1 = __importDefault(require("../../common/logger"));
9
+ const display_1 = require("../../v3/display");
10
+ const readBinaryData = (file) => {
47
11
  try {
48
- var body = fs.readFileSync(file);
12
+ const body = fs.readFileSync(file);
49
13
  return body;
50
14
  }
51
15
  catch (e) {
52
- throw new Error("unable to read file for binary payload : ".concat(e.message));
16
+ const error = e instanceof Error ? e : new Error(String(e));
17
+ throw new Error(`unable to read file for binary payload : ${error.message}`);
53
18
  }
54
19
  };
55
20
  exports.readBinaryData = readBinaryData;
56
- var cleanup = function (success, pact, opts, server, cleanupFn) {
21
+ const cleanup = (success, pact, opts, server, cleanupFn) => {
57
22
  if (success) {
58
23
  pact.writePactFile(opts.dir || './pacts');
59
24
  }
@@ -61,56 +26,51 @@ var cleanup = function (success, pact, opts, server, cleanupFn) {
61
26
  pact.cleanupPlugins();
62
27
  cleanupFn();
63
28
  };
64
- var executeTest = function (pact, opts, testFn, cleanupFn) { return __awaiter(void 0, void 0, void 0, function () {
65
- var scheme, host, port, server, val, error, e_1, matchingResults, errors, success, errorMessage;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0:
69
- scheme = opts.tls ? 'https' : 'http';
70
- host = opts.host || '127.0.0.1';
71
- port = pact.createMockServer(host, opts.port || 0, false);
72
- server = { port: port, url: "".concat(scheme, "://").concat(host, ":").concat(port), id: 'unknown' };
73
- _a.label = 1;
74
- case 1:
75
- _a.trys.push([1, 3, , 4]);
76
- return [4 /*yield*/, testFn(server)];
77
- case 2:
78
- val = _a.sent();
79
- return [3 /*break*/, 4];
80
- case 3:
81
- e_1 = _a.sent();
82
- error = e_1;
83
- return [3 /*break*/, 4];
84
- case 4:
85
- matchingResults = pact.mockServerMismatches(port);
86
- errors = (0, display_1.filterMissingFeatureFlag)(matchingResults);
87
- success = pact.mockServerMatchedSuccessfully(port);
88
- // Scenario: Pact validation failed
89
- if (!success && errors.length > 0) {
90
- errorMessage = 'Test failed for the following reasons:';
91
- errorMessage += "\n\n ".concat((0, display_1.generateMockServerError)(matchingResults, '\t'));
92
- cleanup(false, pact, opts, server, cleanupFn);
93
- // If the tests throws an error, we need to rethrow the error, but print out
94
- // any additional mock server errors to help the user understand what happened
95
- // (The proximate cause here is often the HTTP 500 from the mock server,
96
- // where the HTTP client then throws)
97
- if (error) {
98
- logger_1.default.error(errorMessage);
99
- throw error;
100
- }
101
- // Test didn't throw, so we need to ensure the test fails
102
- return [2 /*return*/, Promise.reject(new Error(errorMessage))];
103
- }
104
- // Scenario: test threw an error, but Pact validation was OK (error in client or test)
105
- if (error) {
106
- cleanup(false, pact, opts, server, cleanupFn);
107
- throw error;
108
- }
109
- // Scenario: Pact validation passed, test didn't throw - return the callback value
110
- cleanup(true, pact, opts, server, cleanupFn);
111
- return [2 /*return*/, val];
29
+ const executeTest = async (pact, opts, testFn, cleanupFn) => {
30
+ const scheme = opts.tls ? 'https' : 'http';
31
+ const host = opts.host || '127.0.0.1';
32
+ const cors = opts.cors ?? true;
33
+ const config = JSON.stringify({ corsPreflight: cors });
34
+ const port = pact.pactffiCreateMockServerForTransport(host, scheme, config, opts.port);
35
+ if (port <= 0) {
36
+ throw new Error(`Failed to start mock server: received error code ${port}`);
37
+ }
38
+ const server = { port, url: `${scheme}://${host}:${port}`, id: 'unknown' };
39
+ let val;
40
+ let error;
41
+ try {
42
+ val = await testFn(server);
43
+ }
44
+ catch (e) {
45
+ error = e instanceof Error ? e : new Error(String(e));
46
+ }
47
+ const matchingResults = pact.mockServerMismatches(port);
48
+ const errors = (0, display_1.filterMissingFeatureFlag)(matchingResults);
49
+ const success = pact.mockServerMatchedSuccessfully(port);
50
+ // Scenario: Pact validation failed
51
+ if (!success && errors.length > 0) {
52
+ let errorMessage = 'Test failed for the following reasons:';
53
+ errorMessage += `\n\n ${(0, display_1.generateMockServerError)(matchingResults, '\t')}`;
54
+ cleanup(false, pact, opts, server, cleanupFn);
55
+ // If the tests throws an error, we need to rethrow the error, but print out
56
+ // any additional mock server errors to help the user understand what happened
57
+ // (The proximate cause here is often the HTTP 500 from the mock server,
58
+ // where the HTTP client then throws)
59
+ if (error) {
60
+ logger_1.default.error(errorMessage);
61
+ throw error;
112
62
  }
113
- });
114
- }); };
63
+ // Test didn't throw, so we need to ensure the test fails
64
+ return Promise.reject(new Error(errorMessage));
65
+ }
66
+ // Scenario: test threw an error, but Pact validation was OK (error in client or test)
67
+ if (error) {
68
+ cleanup(false, pact, opts, server, cleanupFn);
69
+ throw error;
70
+ }
71
+ // Scenario: Pact validation passed, test didn't throw - return the callback value
72
+ cleanup(true, pact, opts, server, cleanupFn);
73
+ return val;
74
+ };
115
75
  exports.executeTest = executeTest;
116
76
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAA0B;AAK1B,4CAG0B;AAC1B,+DAAyC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