@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
@@ -1,5 +1,5 @@
1
- import { JsonMap } from '../../common/jsonTypes';
2
- import { Matcher, Path, Rules, SpecificationVersion, TemplateHeaders, TemplateQuery, V3MockServer, V3ProviderState, V3Request, V3Response } from '../../v3';
1
+ import type { JsonMap } from '../../common/jsonTypes';
2
+ import type { Matcher, Path, Rules, SpecificationVersion, StatusCodeMatcher, TemplateHeaders, TemplateQuery, V3MockServer, V3ProviderState, V3Request, V3Response } from '../../v3';
3
3
  export type V4ProviderState = V3ProviderState;
4
4
  export type V4MockServer = V3MockServer;
5
5
  export type V4Request = V3Request;
@@ -37,6 +37,10 @@ export interface PactV4Options {
37
37
  * The host to run the mock service, defaults to 127.0.0.1
38
38
  */
39
39
  host?: string;
40
+ /**
41
+ * If the mock server should handle CORS pre-flight requests. Defaults to true
42
+ */
43
+ cors?: boolean;
40
44
  }
41
45
  export type TemplateHeaderArrayValue = string[] | Matcher<string>[];
42
46
  export type Comment = string;
@@ -50,6 +54,7 @@ export interface V4UnconfiguredInteraction {
50
54
  pending(pending?: boolean): V4UnconfiguredInteraction;
51
55
  comment(comment: Comment | CustomComment): V4UnconfiguredInteraction;
52
56
  testName(name: string): V4UnconfiguredInteraction;
57
+ reference(group: string, name: string, value: string): V4UnconfiguredInteraction;
53
58
  withCompleteRequest(request: V4Request): V4InteractionWithCompleteRequest;
54
59
  withRequest(method: string, path: Path, builder?: V4RequestBuilderFunc): V4InteractionWithRequest;
55
60
  usingPlugin(config: PluginConfig): V4InteractionWithPlugin;
@@ -58,13 +63,14 @@ export interface V4InteractionWithCompleteRequest {
58
63
  withCompleteResponse(response: V4Response): V4InteractionWithResponse;
59
64
  }
60
65
  export interface V4InteractionWithRequest {
61
- willRespondWith(status: number, builder?: V4ResponseBuilderFunc): V4InteractionWithResponse;
66
+ willRespondWith(status: number | StatusCodeMatcher<number>, builder?: V4ResponseBuilderFunc): V4InteractionWithResponse;
62
67
  }
63
68
  export type V4RequestBuilderFunc = (builder: V4RequestBuilder) => void;
64
69
  export interface V4RequestBuilder {
65
70
  query(query: TemplateQuery): V4RequestBuilder;
66
71
  headers(headers: TemplateHeaders): V4RequestBuilder;
67
72
  jsonBody(body: unknown): V4RequestBuilder;
73
+ xmlBody(body: unknown): V4RequestBuilder;
68
74
  binaryFile(contentType: string, file: string): V4RequestBuilder;
69
75
  multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4RequestBuilder;
70
76
  matchingRules(rules: Rules): V4RequestBuilder;
@@ -73,6 +79,7 @@ export interface V4RequestBuilder {
73
79
  export interface V4ResponseBuilder {
74
80
  headers(headers: TemplateHeaders): V4ResponseBuilder;
75
81
  jsonBody(body: unknown): V4ResponseBuilder;
82
+ xmlBody(body: unknown): V4ResponseBuilder;
76
83
  binaryFile(contentType: string, file: string): V4ResponseBuilder;
77
84
  multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4ResponseBuilder;
78
85
  matchingRules(rules: Rules): V4ResponseBuilder;
@@ -93,12 +100,13 @@ export interface V4InteractionWithPlugin {
93
100
  withRequest(method: string, path: Path, builder?: V4PluginRequestBuilderFunc): V4InteractionWithPluginRequest;
94
101
  }
95
102
  export interface V4InteractionWithPluginRequest {
96
- willRespondWith(status: number, builder?: V4PluginResponseBuilderFunc): V4InteractionWithPluginResponse;
103
+ willRespondWith(status: number | StatusCodeMatcher<number>, builder?: V4PluginResponseBuilderFunc): V4InteractionWithPluginResponse;
97
104
  }
98
105
  export interface V4RequestWithPluginBuilder {
99
106
  query(query: TemplateQuery): V4RequestWithPluginBuilder;
100
107
  headers(headers: TemplateHeaders): V4RequestWithPluginBuilder;
101
108
  jsonBody(body: unknown): V4RequestWithPluginBuilder;
109
+ xmlBody(body: unknown): V4RequestWithPluginBuilder;
102
110
  binaryFile(contentType: string, file: string): V4RequestWithPluginBuilder;
103
111
  multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4RequestWithPluginBuilder;
104
112
  body(contentType: string, body: Buffer): V4RequestWithPluginBuilder;
@@ -108,6 +116,7 @@ export interface V4RequestWithPluginBuilder {
108
116
  export interface V4ResponseWithPluginBuilder {
109
117
  headers(headers: TemplateHeaders): V4ResponseBuilder;
110
118
  jsonBody(body: unknown): V4ResponseBuilder;
119
+ xmlBody(body: unknown): V4ResponseBuilder;
111
120
  binaryFile(contentType: string, file: string): V4ResponseBuilder;
112
121
  multipartBody(contentType: string, filename: string, mimePartName: string, boundary?: string): V4ResponseBuilder;
113
122
  matchingRules(rules: Rules): V4ResponseBuilder;
@@ -1,7 +1,7 @@
1
- import { ConsumerPact, ConsumerInteraction } from '@pact-foundation/pact-core';
2
- import { JsonMap } from '../../common/jsonTypes';
3
- import { Path } from '../../v3';
4
- import { V4UnconfiguredInteraction, PactV4Options, V4Request, V4InteractionWithCompleteRequest, V4RequestBuilderFunc, V4InteractionWithRequest, PluginConfig, V4InteractionWithPlugin, Comment, CustomComment } from './types';
1
+ import type { ConsumerInteraction, ConsumerPact } from '@pact-foundation/pact-core';
2
+ import type { JsonMap } from '../../common/jsonTypes';
3
+ import type { Path } from '../../v3';
4
+ import type { Comment, CustomComment, PactV4Options, PluginConfig, V4InteractionWithCompleteRequest, V4InteractionWithPlugin, V4InteractionWithRequest, V4Request, V4RequestBuilderFunc, V4UnconfiguredInteraction } from './types';
5
5
  export declare class UnconfiguredInteraction implements V4UnconfiguredInteraction {
6
6
  protected pact: ConsumerPact;
7
7
  protected interaction: ConsumerInteraction;
@@ -13,7 +13,8 @@ export declare class UnconfiguredInteraction implements V4UnconfiguredInteractio
13
13
  pending(pending?: boolean): V4UnconfiguredInteraction;
14
14
  comment(comment: Comment | CustomComment): V4UnconfiguredInteraction;
15
15
  testName(name: string): V4UnconfiguredInteraction;
16
- withCompleteRequest(request: V4Request): V4InteractionWithCompleteRequest;
16
+ reference(group: string, name: string, value: string): V4UnconfiguredInteraction;
17
+ withCompleteRequest(_request: V4Request): V4InteractionWithCompleteRequest;
17
18
  withRequest(method: string, path: Path, builder?: V4RequestBuilderFunc): V4InteractionWithRequest;
18
19
  usingPlugin(config: PluginConfig): V4InteractionWithPlugin;
19
20
  }
@@ -1,23 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UnconfiguredInteraction = void 0;
4
- var interactionWithPlugin_1 = require("./interactionWithPlugin");
5
- var requestBuilder_1 = require("./requestBuilder");
6
- var interactionWithRequest_1 = require("./interactionWithRequest");
7
- var matchers_1 = require("../../v3/matchers");
8
- var UnconfiguredInteraction = /** @class */ (function () {
4
+ const matchers_1 = require("../../v3/matchers");
5
+ const interactionWithPlugin_1 = require("./interactionWithPlugin");
6
+ const interactionWithRequest_1 = require("./interactionWithRequest");
7
+ const requestBuilder_1 = require("./requestBuilder");
8
+ class UnconfiguredInteraction {
9
+ pact;
10
+ interaction;
11
+ opts;
12
+ cleanupFn;
9
13
  // tslint:disable:no-empty-function
10
- function UnconfiguredInteraction(pact, interaction, opts, cleanupFn) {
14
+ constructor(pact, interaction, opts, cleanupFn) {
11
15
  this.pact = pact;
12
16
  this.interaction = interaction;
13
17
  this.opts = opts;
14
18
  this.cleanupFn = cleanupFn;
15
19
  }
16
- UnconfiguredInteraction.prototype.uponReceiving = function (description) {
20
+ uponReceiving(description) {
17
21
  this.interaction.uponReceiving(description);
18
22
  return this;
19
- };
20
- UnconfiguredInteraction.prototype.given = function (state, parameters) {
23
+ }
24
+ given(state, parameters) {
21
25
  if (parameters) {
22
26
  this.interaction.givenWithParams(state, JSON.stringify(parameters));
23
27
  }
@@ -25,40 +29,41 @@ var UnconfiguredInteraction = /** @class */ (function () {
25
29
  this.interaction.given(state);
26
30
  }
27
31
  return this;
28
- };
29
- UnconfiguredInteraction.prototype.pending = function (pending) {
30
- if (pending === void 0) { pending = true; }
32
+ }
33
+ pending(pending = true) {
31
34
  this.interaction.setPending(pending);
32
35
  return this;
33
- };
34
- UnconfiguredInteraction.prototype.comment = function (comment) {
36
+ }
37
+ comment(comment) {
35
38
  if (typeof comment === 'string') {
36
39
  this.interaction.addTextComment(comment);
37
40
  return this;
38
41
  }
39
42
  this.interaction.setComment(comment.key, comment.value);
40
43
  return this;
41
- };
42
- UnconfiguredInteraction.prototype.testName = function (name) {
44
+ }
45
+ testName(name) {
43
46
  this.interaction.setInteractionTestName(name);
44
47
  return this;
45
- };
46
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
- UnconfiguredInteraction.prototype.withCompleteRequest = function (request) {
48
+ }
49
+ reference(group, name, value) {
50
+ this.interaction.addInteractionReference(group, name, value);
51
+ return this;
52
+ }
53
+ withCompleteRequest(_request) {
48
54
  throw new Error('withCompleteRequest is not implemented');
49
- };
50
- UnconfiguredInteraction.prototype.withRequest = function (method, path, builder) {
55
+ }
56
+ withRequest(method, path, builder) {
51
57
  this.interaction.withRequest(method, (0, matchers_1.matcherValueOrString)(path));
52
58
  if (builder) {
53
59
  builder(new requestBuilder_1.RequestBuilder(this.interaction));
54
60
  }
55
61
  return new interactionWithRequest_1.InteractionWithRequest(this.pact, this.interaction, this.opts, this.cleanupFn);
56
- };
57
- UnconfiguredInteraction.prototype.usingPlugin = function (config) {
62
+ }
63
+ usingPlugin(config) {
58
64
  this.pact.addPlugin(config.plugin, config.version);
59
65
  return new interactionWithPlugin_1.InteractionWithPlugin(this.pact, this.interaction, this.opts, this.cleanupFn);
60
- };
61
- return UnconfiguredInteraction;
62
- }());
66
+ }
67
+ }
63
68
  exports.UnconfiguredInteraction = UnconfiguredInteraction;
64
69
  //# sourceMappingURL=unconfiguredInteraction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unconfiguredInteraction.js","sourceRoot":"","sources":["../../../../src/v4/http/unconfiguredInteraction.ts"],"names":[],"mappings":";;;AACA,iEAAgE;AAChE,mDAAkD;AAClD,mEAAkE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O,IAAI,CAAC;IACd,CAAC;IAED,6DAA6D;IAC7D,qDAAmB,GAAnB,UAAoB,OAAkB;QACpC,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,6CAAW,GAAX,UACE,MAAc,EACd,IAAU,EACV,OAA8B;QAE9B,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE,IAAA,+BAAoB,EAAC,IAAI,CAAC,CAAC,CAAC;QAEjE,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,+BAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,+CAAsB,CAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IAED,6CAAW,GAAX,UAAY,MAAoB;QAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,IAAI,6CAAqB,CAC9B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IACH,8BAAC;AAAD,CAAC,AAjFD,IAiFC;AAjFY,0DAAuB"}
1
+ {"version":3,"file":"unconfiguredInteraction.js","sourceRoot":"","sources":["../../../../src/v4/http/unconfiguredInteraction.ts"],"names":[],"mappings":";;;AAMA,gDAAyD;AACzD,mEAAgE;AAChE,qEAAkE;AAClE,qDAAkD;AAclD,MAAa,uBAAuB;IAGtB;IACA;IACA;IACA;IALZ,mCAAmC;IACnC,YACY,IAAkB,EAClB,WAAgC,EAChC,IAAmB,EACnB,SAAqB;QAHrB,SAAI,GAAJ,IAAI,CAAc;QAClB,gBAAW,GAAX,WAAW,CAAqB;QAChC,SAAI,GAAJ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,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,WAAW,CACT,MAAc,EACd,IAAU,EACV,OAA8B;QAE9B,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE,IAAA,+BAAoB,EAAC,IAAI,CAAC,CAAC,CAAC;QAEjE,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,+BAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,+CAAsB,CAC/B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,MAAoB;QAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAEnD,OAAO,IAAI,6CAAqB,CAC9B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;CACF;AA1FD,0DA0FC"}
package/src/v4/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { PactV4Options, V4UnconfiguredInteraction } from './http/types';
2
- import { V4ConsumerPact } from './types';
3
- import { V4UnconfiguredAsynchronousMessage, V4UnconfiguredSynchronousMessage } from './message/types';
4
- import { V4UnconfiguredGraphQLInteraction } from './graphql/types';
1
+ import type { V4UnconfiguredGraphQLInteraction } from './graphql/types';
2
+ import { PactV4Options, type V4UnconfiguredInteraction } from './http/types';
3
+ import type { V4UnconfiguredAsynchronousMessage, V4UnconfiguredSynchronousMessage } from './message/types';
4
+ import type { V4ConsumerPact } from './types';
5
5
  export declare class PactV4 implements V4ConsumerPact {
6
6
  private opts;
7
7
  private pact;
@@ -12,6 +12,7 @@ export declare class PactV4 implements V4ConsumerPact {
12
12
  addAsynchronousInteraction(): V4UnconfiguredAsynchronousMessage;
13
13
  addGraphQLInteraction(): V4UnconfiguredGraphQLInteraction;
14
14
  }
15
- export { PactV4 as Pact, PactV4Options as PactOptions };
15
+ export * from '../xml';
16
16
  export * from './graphql';
17
17
  export * from './message/index';
18
+ export { PactV4 as Pact, PactV4Options as PactOptions };
package/src/v4/index.js CHANGED
@@ -15,63 +15,60 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Pact = exports.PactV4 = void 0;
18
- var pact_core_1 = require("@pact-foundation/pact-core");
19
- var unconfiguredInteraction_1 = require("./http/unconfiguredInteraction");
20
- var package_json_1 = require("../../package.json");
21
- var message_1 = require("./message");
22
- var v3_1 = require("../v3");
23
- var graphql_1 = require("./graphql");
24
- var asynchronousMessage_1 = require("./message/asynchronousMessage");
25
- var PactV4 = /** @class */ (function () {
26
- function PactV4(opts) {
18
+ const pact_core_1 = require("@pact-foundation/pact-core");
19
+ const package_json_1 = require("../../package.json");
20
+ const v3_1 = require("../v3");
21
+ const graphql_1 = require("./graphql");
22
+ const unconfiguredInteraction_1 = require("./http/unconfiguredInteraction");
23
+ const message_1 = require("./message");
24
+ const asynchronousMessage_1 = require("./message/asynchronousMessage");
25
+ class PactV4 {
26
+ opts;
27
+ pact;
28
+ constructor(opts) {
27
29
  this.opts = opts;
28
30
  this.setup();
31
+ }
32
+ setup() {
33
+ this.pact = (0, pact_core_1.makeConsumerPact)(this.opts.consumer, this.opts.provider, this.opts.spec ?? v3_1.SpecificationVersion.SPECIFICATION_VERSION_V4, this.opts.logLevel ?? 'info');
29
34
  this.pact.addMetadata('pact-js', 'version', package_json_1.version);
30
35
  }
31
- PactV4.prototype.setup = function () {
32
- var _a, _b;
33
- this.pact = (0, pact_core_1.makeConsumerPact)(this.opts.consumer, this.opts.provider, (_a = this.opts.spec) !== null && _a !== void 0 ? _a : v3_1.SpecificationVersion.SPECIFICATION_VERSION_V4, (_b = this.opts.logLevel) !== null && _b !== void 0 ? _b : 'info');
34
- };
35
- PactV4.prototype.addInteraction = function () {
36
- var _this = this;
37
- return new unconfiguredInteraction_1.UnconfiguredInteraction(this.pact, this.pact.newInteraction(''), this.opts, function () {
36
+ addInteraction() {
37
+ return new unconfiguredInteraction_1.UnconfiguredInteraction(this.pact, this.pact.newInteraction(''), this.opts, () => {
38
38
  // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
39
39
  // Because of the type-state model used here, it's a bit awkward as we need to thread this through
40
40
  // to children, ultimately to be called on the "executeTest" stage.
41
- _this.setup();
41
+ this.setup();
42
42
  });
43
- };
44
- PactV4.prototype.addSynchronousInteraction = function (description) {
45
- var _this = this;
46
- return new message_1.UnconfiguredSynchronousMessage(this.pact, this.pact.newSynchronousMessage(description), this.opts, function () {
43
+ }
44
+ addSynchronousInteraction(description) {
45
+ return new message_1.UnconfiguredSynchronousMessage(this.pact, this.pact.newSynchronousMessage(description), this.opts, () => {
47
46
  // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
48
47
  // Because of the type-state model used here, it's a bit awkward as we need to thread this through
49
48
  // to children, ultimately to be called on the "executeTest" stage.
50
- _this.setup();
49
+ this.setup();
51
50
  });
52
- };
53
- PactV4.prototype.addAsynchronousInteraction = function () {
54
- var _this = this;
55
- return new asynchronousMessage_1.UnconfiguredAsynchronousMessage(this.pact, this.pact.newAsynchronousMessage(''), this.opts, function () {
51
+ }
52
+ addAsynchronousInteraction() {
53
+ return new asynchronousMessage_1.UnconfiguredAsynchronousMessage(this.pact, this.pact.newAsynchronousMessage(''), this.opts, () => {
56
54
  // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
57
55
  // Because of the type-state model used here, it's a bit awkward as we need to thread this through
58
56
  // to children, ultimately to be called on the "executeTest" stage.
59
- _this.setup();
57
+ this.setup();
60
58
  });
61
- };
62
- PactV4.prototype.addGraphQLInteraction = function () {
63
- var _this = this;
64
- return new graphql_1.UnconfiguredGraphQLInteraction(this.pact, this.pact.newInteraction(''), this.opts, function () {
59
+ }
60
+ addGraphQLInteraction() {
61
+ return new graphql_1.UnconfiguredGraphQLInteraction(this.pact, this.pact.newInteraction(''), this.opts, () => {
65
62
  // This function needs to be called if the PactV4 object is to be re-used (commonly expected by users)
66
63
  // Because of the type-state model used here, it's a bit awkward as we need to thread this through
67
64
  // to children, ultimately to be called on the "executeTest" stage.
68
- _this.setup();
65
+ this.setup();
69
66
  });
70
- };
71
- return PactV4;
72
- }());
67
+ }
68
+ }
73
69
  exports.PactV4 = PactV4;
74
70
  exports.Pact = PactV4;
71
+ __exportStar(require("../xml"), exports);
75
72
  __exportStar(require("./graphql"), exports);
76
73
  __exportStar(require("./message/index"), exports);
77
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v4/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wDAA4E;AAC5E,0EAAyE;AAGzE,mDAAmE;AAKnE,qCAA2D;AAC3D,4BAA6C;AAE7C,qCAA2D;AAC3D,qEAAgF;AAEhF;IAGE,gBAAoB,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;QACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,sBAAkB,CAAC,CAAC;IAClE,CAAC;IAED,sBAAK,GAAL;;QACE,IAAI,CAAC,IAAI,GAAG,IAAA,4BAAgB,EAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAClB,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,mCAAI,yBAAoB,CAAC,wBAAwB,EAC/D,MAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,MAAM,CAC7B,CAAC;IACJ,CAAC;IAED,+BAAc,GAAd;QAAA,iBAYC;QAXC,OAAO,IAAI,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+B,CACxC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE,CAAC,EACpC,IAAI,CAAC,IAAI,EACT,GAAG,EAAE;YACH,sGAAsG;YACtG,kGAAkG;YAClG,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CACF,CAAC;IACJ,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,wCAA8B,CACvC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,EAC5B,IAAI,CAAC,IAAI,EACT,GAAG,EAAE;YACH,sGAAsG;YACtG,kGAAkG;YAClG,mEAAmE;YACnE,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA1ED,wBA0EC;AAKkB,sBAAI;AAHvB,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC"}
@@ -1,9 +1,9 @@
1
- import { Metadata } from '../../dsl/message';
2
- import { AnyJson, JsonMap } from '../../common/jsonTypes';
3
- import { PluginConfig, AsynchronousMessage, TransportConfig, V4AsynchronousMessageWithPlugin, V4AsynchronousMessageWithPluginContents, V4AsynchronousMessageWithTransport, V4UnconfiguredAsynchronousMessage, V4AsynchronousMessageWithContent, V4AsynchronousMessageBuilderFunc, V4AsynchronousMessageBuilder, Comment, CustomComment } from './types';
4
- import { AsynchronousMessage as PactCoreAsynchronousMessage, ConsumerPact } from '@pact-foundation/pact-core';
5
- import { PactV4Options } from '../http/types';
6
- import { Rules } from '../../v3/types';
1
+ import type { ConsumerPact, AsynchronousMessage as PactCoreAsynchronousMessage } from '@pact-foundation/pact-core';
2
+ import type { AnyJson, JsonMap } from '../../common/jsonTypes';
3
+ import type { Metadata } from '../../dsl/message';
4
+ import type { Rules } from '../../v3/types';
5
+ import type { PactV4Options } from '../http/types';
6
+ import type { AsynchronousMessage, Comment, CustomComment, PluginConfig, TransportConfig, V4AsynchronousMessageBuilder, V4AsynchronousMessageBuilderFunc, V4AsynchronousMessageWithContent, V4AsynchronousMessageWithPlugin, V4AsynchronousMessageWithPluginContents, V4AsynchronousMessageWithTransport, V4UnconfiguredAsynchronousMessage } from './types';
7
7
  type Message = {
8
8
  requestIsBinary: boolean;
9
9
  interaction: PactCoreAsynchronousMessage;
@@ -20,6 +20,7 @@ export declare class UnconfiguredAsynchronousMessage implements V4UnconfiguredAs
20
20
  pending(pending?: boolean): V4UnconfiguredAsynchronousMessage;
21
21
  comment(comment: Comment | CustomComment): V4UnconfiguredAsynchronousMessage;
22
22
  testName(name: string): V4UnconfiguredAsynchronousMessage;
23
+ reference(group: string, name: string, value: string): V4UnconfiguredAsynchronousMessage;
23
24
  usingPlugin(config: PluginConfig): V4AsynchronousMessageWithPlugin;
24
25
  }
25
26
  export declare class AsynchronousMessageWithPlugin implements V4AsynchronousMessageWithPlugin {