@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.
- package/CHANGELOG.md +23 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +22 -12
- package/package.json +26 -47
- package/scripts/ci/build-and-test.sh +0 -3
- package/scripts/install-plugins.js +104 -0
- package/src/common/graphQL/configurationError.js +2 -22
- package/src/common/graphQL/configurationError.js.map +1 -1
- package/src/common/graphQL/graphQL.d.ts +2 -2
- package/src/common/graphQL/graphQL.js +11 -14
- package/src/common/graphQL/graphQL.js.map +1 -1
- package/src/common/graphQL/graphQLQueryError.js +2 -22
- package/src/common/graphQL/graphQLQueryError.js.map +1 -1
- package/src/common/logger.js +9 -9
- package/src/common/logger.js.map +1 -1
- package/src/common/matchingRules.d.ts +7 -1
- package/src/common/matchingRules.js +42 -22
- package/src/common/matchingRules.js.map +1 -1
- package/src/common/net.js +36 -42
- package/src/common/net.js.map +1 -1
- package/src/common/net.spec.js +39 -87
- package/src/common/net.spec.js.map +1 -1
- package/src/common/request.js +33 -82
- package/src/common/request.js.map +1 -1
- package/src/common/request.spec.js +29 -73
- package/src/common/request.spec.js.map +1 -1
- package/src/common/spec.js +3 -4
- package/src/common/spec.js.map +1 -1
- package/src/dsl/apolloGraphql.js +7 -25
- package/src/dsl/apolloGraphql.js.map +1 -1
- package/src/dsl/apolloGraphql.spec.js +21 -58
- package/src/dsl/apolloGraphql.spec.js.map +1 -1
- package/src/dsl/graphql.d.ts +2 -2
- package/src/dsl/graphql.js +29 -48
- package/src/dsl/graphql.js.map +1 -1
- package/src/dsl/graphql.spec.js +92 -117
- package/src/dsl/graphql.spec.js.map +1 -1
- package/src/dsl/interaction.d.ts +2 -2
- package/src/dsl/interaction.js +41 -48
- package/src/dsl/interaction.js.map +1 -1
- package/src/dsl/interaction.spec.js +109 -132
- package/src/dsl/interaction.spec.js.map +1 -1
- package/src/dsl/matchers.d.ts +2 -3
- package/src/dsl/matchers.js +19 -31
- package/src/dsl/matchers.js.map +1 -1
- package/src/dsl/matchers.spec.js +279 -289
- package/src/dsl/matchers.spec.js.map +1 -1
- package/src/dsl/message.d.ts +3 -3
- package/src/dsl/options.d.ts +3 -3
- package/src/dsl/verifier/proxy/hooks.d.ts +2 -2
- package/src/dsl/verifier/proxy/hooks.js +42 -112
- package/src/dsl/verifier/proxy/hooks.js.map +1 -1
- package/src/dsl/verifier/proxy/hooks.spec.js +86 -199
- package/src/dsl/verifier/proxy/hooks.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/messages.d.ts +2 -2
- package/src/dsl/verifier/proxy/messages.js +88 -106
- package/src/dsl/verifier/proxy/messages.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.d.ts +1 -1
- package/src/dsl/verifier/proxy/parseBody.js +3 -3
- package/src/dsl/verifier/proxy/parseBody.js.map +1 -1
- package/src/dsl/verifier/proxy/parseBody.spec.js +35 -113
- package/src/dsl/verifier/proxy/parseBody.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.d.ts +2 -2
- package/src/dsl/verifier/proxy/proxy.js +22 -26
- package/src/dsl/verifier/proxy/proxy.js.map +1 -1
- package/src/dsl/verifier/proxy/proxy.spec.js +11 -53
- package/src/dsl/verifier/proxy/proxy.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.d.ts +3 -3
- package/src/dsl/verifier/proxy/proxyRequest.js +7 -7
- package/src/dsl/verifier/proxy/proxyRequest.js.map +1 -1
- package/src/dsl/verifier/proxy/proxyRequest.spec.js +54 -104
- package/src/dsl/verifier/proxy/proxyRequest.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.d.ts +3 -3
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js +14 -18
- package/src/dsl/verifier/proxy/stateHandler/setupStates.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js +76 -193
- package/src/dsl/verifier/proxy/stateHandler/setupStates.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.d.ts +2 -2
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js +23 -72
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.js.map +1 -1
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js +37 -122
- package/src/dsl/verifier/proxy/stateHandler/stateHandler.spec.js.map +1 -1
- package/src/dsl/verifier/proxy/tracer.d.ts +1 -1
- package/src/dsl/verifier/proxy/tracer.js +42 -35
- package/src/dsl/verifier/proxy/tracer.js.map +1 -1
- package/src/dsl/verifier/proxy/types.d.ts +5 -5
- package/src/dsl/verifier/types.d.ts +3 -3
- package/src/dsl/verifier/verifier.d.ts +5 -1
- package/src/dsl/verifier/verifier.js +53 -60
- package/src/dsl/verifier/verifier.js.map +1 -1
- package/src/dsl/verifier/verifier.spec.js +84 -151
- package/src/dsl/verifier/verifier.spec.js.map +1 -1
- package/src/errors/configurationError.js +2 -22
- package/src/errors/configurationError.js.map +1 -1
- package/src/errors/graphQLQueryError.js +2 -22
- package/src/errors/graphQLQueryError.js.map +1 -1
- package/src/errors/matcherError.js +2 -22
- package/src/errors/matcherError.js.map +1 -1
- package/src/errors/verificationError.js +2 -22
- package/src/errors/verificationError.js.map +1 -1
- package/src/httpPact/ffi.d.ts +2 -2
- package/src/httpPact/ffi.js +28 -29
- package/src/httpPact/ffi.js.map +1 -1
- package/src/httpPact/ffi.spec.js +40 -83
- package/src/httpPact/ffi.spec.js.map +1 -1
- package/src/httpPact/index.d.ts +3 -3
- package/src/httpPact/index.js +92 -149
- package/src/httpPact/index.js.map +1 -1
- package/src/httpPact/index.spec.js +102 -195
- package/src/httpPact/index.spec.js.map +1 -1
- package/src/httpPact/tracing.js +20 -28
- package/src/httpPact/tracing.js.map +1 -1
- package/src/index.d.ts +25 -25
- package/src/index.js +29 -29
- package/src/index.js.map +1 -1
- package/src/messageConsumerPact.d.ts +5 -5
- package/src/messageConsumerPact.js +59 -53
- package/src/messageConsumerPact.js.map +1 -1
- package/src/messageConsumerPact.spec.js +55 -97
- package/src/messageConsumerPact.spec.js.map +1 -1
- package/src/messageProviderPact.d.ts +3 -3
- package/src/messageProviderPact.js +68 -85
- package/src/messageProviderPact.js.map +1 -1
- package/src/messageProviderPact.spec.js +96 -123
- package/src/messageProviderPact.spec.js.map +1 -1
- package/src/pact.integration.spec.js +242 -351
- package/src/pact.integration.spec.js.map +1 -1
- package/src/v3/display.d.ts +1 -1
- package/src/v3/display.js +44 -58
- package/src/v3/display.js.map +1 -1
- package/src/v3/ffi.js +20 -16
- package/src/v3/ffi.js.map +1 -1
- package/src/v3/ffi.spec.js +7 -42
- package/src/v3/ffi.spec.js.map +1 -1
- package/src/v3/graphql/graphQL.d.ts +4 -4
- package/src/v3/graphql/graphQL.js +50 -75
- package/src/v3/graphql/graphQL.js.map +1 -1
- package/src/v3/graphql/index.d.ts +1 -1
- package/src/v3/graphql/index.js +1 -1
- package/src/v3/graphql/index.js.map +1 -1
- package/src/v3/index.d.ts +4 -12
- package/src/v3/index.js +4 -12
- package/src/v3/index.js.map +1 -1
- package/src/v3/matchers.d.ts +15 -3
- package/src/v3/matchers.js +131 -148
- package/src/v3/matchers.js.map +1 -1
- package/src/v3/matchers.spec.js +281 -232
- package/src/v3/matchers.spec.js.map +1 -1
- package/src/v3/pact.d.ts +2 -2
- package/src/v3/pact.js +108 -151
- package/src/v3/pact.js.map +1 -1
- package/src/v3/pact.spec.js +94 -0
- package/src/v3/pact.spec.js.map +1 -0
- package/src/v3/types.d.ts +19 -3
- package/src/v3/types.js +22 -1
- package/src/v3/types.js.map +1 -1
- package/src/v4/graphql/graphQLInteractionWithRequest.d.ts +4 -4
- package/src/v4/graphql/graphQLInteractionWithRequest.js +21 -17
- package/src/v4/graphql/graphQLInteractionWithRequest.js.map +1 -1
- package/src/v4/graphql/graphQLRequestBuilder.d.ts +3 -3
- package/src/v4/graphql/graphQLRequestBuilder.js +18 -20
- package/src/v4/graphql/graphQLRequestBuilder.js.map +1 -1
- package/src/v4/graphql/index.d.ts +6 -6
- package/src/v4/graphql/index.js +21 -17
- package/src/v4/graphql/index.js.map +1 -1
- package/src/v4/graphql/types.d.ts +5 -5
- package/src/v4/http/index.d.ts +2 -2
- package/src/v4/http/index.js +53 -93
- package/src/v4/http/index.js.map +1 -1
- package/src/v4/http/index.spec.d.ts +1 -0
- package/src/v4/http/index.spec.js +73 -0
- package/src/v4/http/index.spec.js.map +1 -0
- package/src/v4/http/interactionWithCompleteRequest.d.ts +4 -7
- package/src/v4/http/interactionWithCompleteRequest.js +6 -10
- package/src/v4/http/interactionWithCompleteRequest.js.map +1 -1
- package/src/v4/http/interactionWithPlugin.d.ts +3 -3
- package/src/v4/http/interactionWithPlugin.js +14 -11
- package/src/v4/http/interactionWithPlugin.js.map +1 -1
- package/src/v4/http/interactionWithPluginRequest.d.ts +4 -3
- package/src/v4/http/interactionWithPluginRequest.js +17 -9
- package/src/v4/http/interactionWithPluginRequest.js.map +1 -1
- package/src/v4/http/interactionWithPluginResponse.d.ts +2 -2
- package/src/v4/http/interactionWithPluginResponse.js +10 -48
- package/src/v4/http/interactionWithPluginResponse.js.map +1 -1
- package/src/v4/http/interactionWithRequest.d.ts +4 -3
- package/src/v4/http/interactionWithRequest.js +17 -9
- package/src/v4/http/interactionWithRequest.js.map +1 -1
- package/src/v4/http/interactionWithRequest.spec.d.ts +1 -0
- package/src/v4/http/interactionWithRequest.spec.js +82 -0
- package/src/v4/http/interactionWithRequest.spec.js.map +1 -0
- package/src/v4/http/interactionWithResponse.d.ts +2 -2
- package/src/v4/http/interactionWithResponse.js +10 -48
- package/src/v4/http/interactionWithResponse.js.map +1 -1
- package/src/v4/http/requestBuilder.d.ts +4 -3
- package/src/v4/http/requestBuilder.js +36 -34
- package/src/v4/http/requestBuilder.js.map +1 -1
- package/src/v4/http/requestBuilder.spec.d.ts +1 -0
- package/src/v4/http/requestBuilder.spec.js +42 -0
- package/src/v4/http/requestBuilder.spec.js.map +1 -0
- package/src/v4/http/requestWithPluginBuilder.d.ts +3 -2
- package/src/v4/http/requestWithPluginBuilder.js +30 -46
- package/src/v4/http/requestWithPluginBuilder.js.map +1 -1
- package/src/v4/http/requestWithPluginBuilder.spec.d.ts +1 -0
- package/src/v4/http/requestWithPluginBuilder.spec.js +34 -0
- package/src/v4/http/requestWithPluginBuilder.spec.js.map +1 -0
- package/src/v4/http/responseBuilder.d.ts +4 -3
- package/src/v4/http/responseBuilder.js +28 -25
- package/src/v4/http/responseBuilder.js.map +1 -1
- package/src/v4/http/responseBuilder.spec.d.ts +1 -0
- package/src/v4/http/responseBuilder.spec.js +42 -0
- package/src/v4/http/responseBuilder.spec.js.map +1 -0
- package/src/v4/http/responseWithPluginBuilder.d.ts +1 -1
- package/src/v4/http/responseWithPluginBuilder.js +5 -25
- package/src/v4/http/responseWithPluginBuilder.js.map +1 -1
- package/src/v4/http/responseWithPluginBuilder.spec.d.ts +1 -0
- package/src/v4/http/responseWithPluginBuilder.spec.js +34 -0
- package/src/v4/http/responseWithPluginBuilder.spec.js.map +1 -0
- package/src/v4/http/types.d.ts +13 -4
- package/src/v4/http/unconfiguredInteraction.d.ts +6 -5
- package/src/v4/http/unconfiguredInteraction.js +31 -26
- package/src/v4/http/unconfiguredInteraction.js.map +1 -1
- package/src/v4/index.d.ts +6 -5
- package/src/v4/index.js +32 -35
- package/src/v4/index.js.map +1 -1
- package/src/v4/message/asynchronousMessage.d.ts +7 -6
- package/src/v4/message/asynchronousMessage.js +157 -190
- package/src/v4/message/asynchronousMessage.js.map +1 -1
- package/src/v4/message/index.d.ts +7 -6
- package/src/v4/message/index.js +188 -217
- package/src/v4/message/index.js.map +1 -1
- package/src/v4/message/types.d.ts +5 -3
- package/src/v4/types.d.ts +3 -3
- package/src/xml/index.d.ts +4 -0
- package/src/xml/index.js +21 -0
- package/src/xml/index.js.map +1 -0
- package/src/{v3/xml → xml}/xmlBuilder.d.ts +1 -3
- package/src/{v3/xml → xml}/xmlBuilder.js +7 -9
- package/src/xml/xmlBuilder.js.map +1 -0
- package/src/{v3/xml → xml}/xmlElement.d.ts +2 -2
- package/src/xml/xmlElement.js +73 -0
- package/src/xml/xmlElement.js.map +1 -0
- package/src/xml/xmlElement.spec.d.ts +1 -0
- package/src/xml/xmlElement.spec.js +107 -0
- package/src/xml/xmlElement.spec.js.map +1 -0
- package/src/xml/xmlNode.js +7 -0
- package/src/xml/xmlNode.js.map +1 -0
- package/src/{v3/xml → xml}/xmlText.d.ts +1 -1
- package/src/xml/xmlText.js +15 -0
- package/src/xml/xmlText.js.map +1 -0
- package/scripts/install-plugins +0 -106
- package/src/v3/xml/xmlBuilder.js.map +0 -1
- package/src/v3/xml/xmlElement.js +0 -90
- package/src/v3/xml/xmlElement.js.map +0 -1
- package/src/v3/xml/xmlElement.spec.js +0 -113
- package/src/v3/xml/xmlElement.spec.js.map +0 -1
- package/src/v3/xml/xmlNode.js +0 -10
- package/src/v3/xml/xmlNode.js.map +0 -1
- package/src/v3/xml/xmlText.js +0 -31
- package/src/v3/xml/xmlText.js.map +0 -1
- /package/src/v3/{xml/xmlElement.spec.d.ts → pact.spec.d.ts} +0 -0
- /package/src/{v3/xml → xml}/xmlNode.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [16.5.0](https://github.com/pact-foundation/pact-js/compare/v16.4.0...v16.5.0) (2026-05-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Add HTTP response status code matching support ([#1790](https://github.com/pact-foundation/pact-js/issues/1790)) ([38a4b9b](https://github.com/pact-foundation/pact-js/commit/38a4b9b46630dc428cbff4d4bd418b498484103f))
|
|
11
|
+
* add xml support to pactv4 ([ae151b7](https://github.com/pact-foundation/pact-js/commit/ae151b7350601d3111ac8a5a2665456556d0b6b3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Fixes and Improvements
|
|
15
|
+
|
|
16
|
+
* **deps:** update dependency https-proxy-agent to v9 ([#1731](https://github.com/pact-foundation/pact-js/issues/1731)) ([e0be974](https://github.com/pact-foundation/pact-js/commit/e0be9742bf8dcd93973022948959b238d49ed882))
|
|
17
|
+
* **regression:** fix Apollo/node-fetch v3 compatibility and graphql peer dep conflict ([#1805](https://github.com/pact-foundation/pact-js/issues/1805)) ([ef8c9f9](https://github.com/pact-foundation/pact-js/commit/ef8c9f9a3f7292febe7dd6dc5c6b0e4dee7d9bff))
|
|
18
|
+
* **types:** allow narrow body type in {synchronous,asynchronous}BodyHandler ([#1798](https://github.com/pact-foundation/pact-js/issues/1798)) ([507ce81](https://github.com/pact-foundation/pact-js/commit/507ce8121acf383b6bfe0278605e0305b12aba0b))
|
|
19
|
+
* **v3:** pass cors option to mock server transport, defaulting to true ([#1767](https://github.com/pact-foundation/pact-js/issues/1767)) ([c31ebb2](https://github.com/pact-foundation/pact-js/commit/c31ebb211005eccb1d1de163ec1b8dd3b3ef495f))
|
|
20
|
+
|
|
21
|
+
## [16.4.0](https://github.com/pact-foundation/pact-js/compare/v16.3.1...v16.4.0) (2026-05-04)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add the addInteractionReference function to V4 DSL classes to support external references ([#1762](https://github.com/pact-foundation/pact-js/issues/1762)) ([a65fe91](https://github.com/pact-foundation/pact-js/commit/a65fe918ec7224adbfe5b336e8864774a42cefe6))
|
|
27
|
+
|
|
5
28
|
## [16.3.1](https://github.com/pact-foundation/pact-js/compare/v16.3.0...v16.3.1) (2026-04-29)
|
|
6
29
|
|
|
7
30
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -73,9 +73,9 @@ modified or new examples, refactorings, new tests, etc. We usually use one of `c
|
|
|
73
73
|
|
|
74
74
|
## Code style and formatting
|
|
75
75
|
|
|
76
|
-
We use [
|
|
76
|
+
We use [Biome](https://biomejs.dev/) for both formatting and linting.
|
|
77
77
|
|
|
78
|
-
The recommended approach is to configure
|
|
78
|
+
The recommended approach is to install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) and configure it to format on save 👌. If not, don't worry, our lint step will catch it.
|
|
79
79
|
|
|
80
80
|
## Pull requests
|
|
81
81
|
|
package/README.md
CHANGED
|
@@ -251,7 +251,7 @@ It's best to run Pact verification tests as part of your unit testing suite, so
|
|
|
251
251
|
<summary>Specification Compatibility</summary>
|
|
252
252
|
|
|
253
253
|
| Version | Stable | [Spec] Compatibility | Install |
|
|
254
|
-
|
|
|
254
|
+
| -------- | ------ | -------------------- | ------------------ |
|
|
255
255
|
| 11.x.x + | Yes | 2, 3, 4 | See [installation] |
|
|
256
256
|
| 10.x.x | Yes | 2, 3, 4 | See [installation] |
|
|
257
257
|
| 9.x.x | Yes | 2, 3\* | [9xx] |
|
|
@@ -264,20 +264,30 @@ _\*_ v3 support is limited to the subset of functionality required to enable lan
|
|
|
264
264
|
|
|
265
265
|
<summary>Supported Platforms</summary>
|
|
266
266
|
|
|
267
|
-
| OS
|
|
268
|
-
|
|
|
269
|
-
| MacOS
|
|
270
|
-
| MacOS
|
|
271
|
-
| Linux (libc)
|
|
272
|
-
| Linux (libc)
|
|
273
|
-
| Linux (musl)
|
|
274
|
-
| Linux (musl)
|
|
275
|
-
| Windows
|
|
276
|
-
| Windows
|
|
277
|
-
| Windows
|
|
267
|
+
| OS | Architecture | Supported | Pact-JS Version |
|
|
268
|
+
| ------------ | ------------ | --------- | --------------- |
|
|
269
|
+
| MacOS | x86_64 | ✅ | All |
|
|
270
|
+
| MacOS | arm64 | ✅ | 9.x + |
|
|
271
|
+
| Linux (libc) | x86_64 | ✅ | All |
|
|
272
|
+
| Linux (libc) | arm64 | ✅ | 10.x + |
|
|
273
|
+
| Linux (musl) | x86_64 | ✅ | 13.x + |
|
|
274
|
+
| Linux (musl) | arm64 | ✅ | 13.x + |
|
|
275
|
+
| Windows | x86_64 | ✅ | All |
|
|
276
|
+
| Windows | x86 | ❌ | 9.x - |
|
|
277
|
+
| Windows | arm64 | ❌ | - |
|
|
278
278
|
|
|
279
279
|
</details>
|
|
280
280
|
|
|
281
|
+
## Community Tools
|
|
282
|
+
|
|
283
|
+
| Tool | Description | Type | Link |
|
|
284
|
+
|------|-------------|------|------|
|
|
285
|
+
| **pact-js-cli** | Wrapper for Pact CLI tools (broker client, stub server, verifier). Makes Pact binaries available to Node scripts and npm commands. | Official | [pact-foundation/pact-js-cli](https://github.com/pact-foundation/pact-js-cli) |
|
|
286
|
+
| **jest-pact** | Jest adapter for writing Pact tests. Automatically instantiates PactOptions, sets up mock service hooks, and provides sensible defaults. | Official | [pact-foundation/jest-pact](https://github.com/pact-foundation/jest-pact) |
|
|
287
|
+
| **mocha-pact** | Mocha adapter for writing Pact tests. Automatically instantiates PactOptions, sets up mock service hooks, and provides sensible defaults. | Official | [pact-foundation/mocha-pact](https://github.com/pact-foundation/mocha-pact) |
|
|
288
|
+
| **nestjs-pact** | Injectable Pact Consumer/Provider for NestJS. Provides modules for both consumer and provider roles with support for PactV2, V3, and V4. | Official | [pact-foundation/nestjs-pact](https://github.com/pact-foundation/nestjs-pact) |
|
|
289
|
+
| **pactjs-utils** | Utilities to eliminate boilerplate and enforce best practices. Includes helpers for provider states, verifier options, auth filters, and message/Kafka provider verification. | Community | [seontechnologies/pactjs-utils](https://github.com/seontechnologies/pactjs-utils) |
|
|
290
|
+
|
|
281
291
|
## Roadmap
|
|
282
292
|
|
|
283
293
|
The [roadmap](https://docs.pact.io/roadmap/) for Pact and Pact JS is outlined on our main website.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pact-foundation/pact",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.5.0",
|
|
4
4
|
"description": "Pact for all things Javascript",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
"clean": "rimraf dist coverage .nyc_output logs pacts",
|
|
10
10
|
"predist": "npm run clean",
|
|
11
11
|
"dist": "tsc && copyfiles package.json ./dist",
|
|
12
|
-
"install-plugins": "./scripts/install-plugins",
|
|
13
|
-
"
|
|
14
|
-
"lint": "
|
|
15
|
-
"lint
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"format
|
|
12
|
+
"install-plugins": "node ./scripts/install-plugins.js",
|
|
13
|
+
"lint:biome": "biome lint",
|
|
14
|
+
"lint:tsc": "tsc --noEmit",
|
|
15
|
+
"lint": "npm run lint:biome && npm run lint:tsc",
|
|
16
|
+
"lint:fix:biome": "biome lint --write",
|
|
17
|
+
"lint:fix": "npm run lint:fix:biome",
|
|
18
|
+
"format": "biome format",
|
|
19
|
+
"format:fix": "biome format --write",
|
|
20
|
+
"check": "npm run format && npm run lint",
|
|
21
|
+
"check:fix": "npm run format:fix && npm run lint:fix",
|
|
19
22
|
"release": "commit-and-tag-version",
|
|
20
|
-
"
|
|
21
|
-
"test": "
|
|
22
|
-
"
|
|
23
|
-
"pretest": "npm run install-plugins",
|
|
23
|
+
"pretest": "node ./scripts/install-plugins.js",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:regression": "npm --prefix regression run test",
|
|
24
26
|
"docker:alpine:build": "docker build --build-arg NODE_VERSION=${NODE_VERSION:-current} -f Dockerfile.alpine -t pact-js:alpine .",
|
|
25
|
-
"docker:debian:build": "docker build --build-arg NODE_VERSION=${NODE_VERSION:-current} -f Dockerfile.debian -t pact-js:debian .",
|
|
26
|
-
"docker:alpine:run": "docker run -e LOG_LEVEL=${LOG_LEVEL:-info} -e GIT_REF=${GIT_REF:-test} -e GITHUB_ACTIONS=${GITHUB_ACTIONS:-false} -e SKIP_EXAMPLES=${SKIP_EXAMPLES:-''} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -w /home -v $(pwd):/home --rm pact-js:alpine",
|
|
27
27
|
"docker:debian:run": "docker run -e LOG_LEVEL=${LOG_LEVEL:-info} -e GIT_REF=${GIT_REF:-test} -e GITHUB_ACTIONS=${GITHUB_ACTIONS:-false} -e SKIP_EXAMPLES=${SKIP_EXAMPLES:-''} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -w /home -v $(pwd):/home --rm pact-js:debian",
|
|
28
28
|
"docker:alpine:attach": "docker run -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -w /home -v $(pwd):/home --entrypoint /bin/bash --rm -it pact-js:alpine",
|
|
29
29
|
"docker:debian:attach": "docker run -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN -w /home -v $(pwd):/home --entrypoint /bin/bash --rm -it pact-js:debian"
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@pact-foundation/pact-core": "^19.
|
|
106
|
+
"@pact-foundation/pact-core": "^19.2.0",
|
|
107
107
|
"axios": "^1.12.2",
|
|
108
108
|
"body-parser": "^2.2.0",
|
|
109
109
|
"chalk": "4.1.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"graphql": "^16.11.0",
|
|
112
112
|
"graphql-tag": "^2.12.6",
|
|
113
113
|
"http-proxy": "^1.18.1",
|
|
114
|
-
"https-proxy-agent": "^
|
|
114
|
+
"https-proxy-agent": "^9.0.0",
|
|
115
115
|
"js-base64": "^3.7.8",
|
|
116
116
|
"lodash": "^4.17.21",
|
|
117
117
|
"ramda": "^0.32.0",
|
|
@@ -122,45 +122,24 @@
|
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@babel/cli": "7.28.6",
|
|
124
124
|
"@babel/core": "7.29.0",
|
|
125
|
-
"@babel/preset-env": "7.29.
|
|
126
|
-
"@
|
|
127
|
-
"@
|
|
128
|
-
"@types/chai-as-promised": "8.0.2",
|
|
125
|
+
"@babel/preset-env": "7.29.5",
|
|
126
|
+
"@biomejs/biome": "2.4.15",
|
|
127
|
+
"@tsconfig/node20": "20.1.9",
|
|
129
128
|
"@types/express": "4.17.25",
|
|
130
129
|
"@types/http-proxy": "1.17.17",
|
|
131
130
|
"@types/lodash": "4.17.24",
|
|
132
|
-
"@types/mocha": "10.0.10",
|
|
133
131
|
"@types/nock": "11.1.0",
|
|
134
|
-
"@types/node": "24.12.
|
|
132
|
+
"@types/node": "24.12.4",
|
|
135
133
|
"@types/ramda": "0.31.1",
|
|
136
|
-
"@types/sinon": "21.0.1",
|
|
137
|
-
"@types/sinon-chai": "4.0.0",
|
|
138
134
|
"@types/stack-utils": "2.0.3",
|
|
139
|
-
"@
|
|
140
|
-
"
|
|
141
|
-
"chai": "6.2.2",
|
|
142
|
-
"chai-as-promised": "8.0.2",
|
|
143
|
-
"commit-and-tag-version": "12.7.1",
|
|
135
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
136
|
+
"commit-and-tag-version": "12.7.3",
|
|
144
137
|
"copyfiles": "2.4.1",
|
|
145
|
-
"
|
|
146
|
-
"eslint-config-airbnb-base": "15.0.0",
|
|
147
|
-
"eslint-config-airbnb-typescript": "17.1.0",
|
|
148
|
-
"eslint-config-prettier": "10.1.8",
|
|
149
|
-
"eslint-import-resolver-typescript": "4.4.2",
|
|
150
|
-
"eslint-plugin-chai-friendly": "1.2.0",
|
|
151
|
-
"eslint-plugin-import": "2.32.0",
|
|
152
|
-
"eslint-plugin-mocha": "10.5.0",
|
|
153
|
-
"mocha": "11.7.5",
|
|
154
|
-
"nock": "14.0.13",
|
|
155
|
-
"nyc": "18.0.0",
|
|
156
|
-
"prettier": "3.6.2",
|
|
157
|
-
"proxyquire": "2.1.3",
|
|
138
|
+
"nock": "14.0.15",
|
|
158
139
|
"rimraf": "6.1.3",
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"tsx": "4.21.0",
|
|
163
|
-
"typescript": "5.9.3"
|
|
140
|
+
"typedoc": "0.28.19",
|
|
141
|
+
"typescript": "6.0.3",
|
|
142
|
+
"vitest": "3.2.4"
|
|
164
143
|
},
|
|
165
144
|
"pnpm": {
|
|
166
145
|
"onlyBuiltDependencies": [
|
|
@@ -15,9 +15,6 @@ export GIT_BRANCH=${GITHUB_HEAD_REF:-${GIT_REF#refs/heads/}}
|
|
|
15
15
|
|
|
16
16
|
"${SCRIPT_DIR}"/lib/prepare-release.sh
|
|
17
17
|
|
|
18
|
-
echo "--> Running coverage checks"
|
|
19
|
-
npm run coverage
|
|
20
|
-
|
|
21
18
|
cp package-lock.json dist
|
|
22
19
|
cp -r scripts dist
|
|
23
20
|
echo "This will be version '$(npx --yes absolute-version)'"
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require('node:child_process');
|
|
4
|
+
const {
|
|
5
|
+
existsSync,
|
|
6
|
+
mkdirSync,
|
|
7
|
+
createWriteStream,
|
|
8
|
+
chmodSync,
|
|
9
|
+
} = require('node:fs');
|
|
10
|
+
const { get } = require('node:https');
|
|
11
|
+
const { homedir } = require('node:os');
|
|
12
|
+
const { join } = require('node:path');
|
|
13
|
+
const { createGunzip } = require('node:zlib');
|
|
14
|
+
|
|
15
|
+
const PLUGIN_CLI_VERSION = '0.1.2';
|
|
16
|
+
const MATT_PLUGIN_VERSION = '0.1.1';
|
|
17
|
+
|
|
18
|
+
function detectOsArch() {
|
|
19
|
+
const { platform, arch } = process;
|
|
20
|
+
if (platform === 'linux' && arch === 'x64')
|
|
21
|
+
return { os: 'linux', arch: 'x86_64', ext: '' };
|
|
22
|
+
if (platform === 'linux' && arch === 'arm64')
|
|
23
|
+
return { os: 'linux', arch: 'aarch64', ext: '' };
|
|
24
|
+
if (platform === 'darwin' && arch === 'x64')
|
|
25
|
+
return { os: 'osx', arch: 'x86_64', ext: '' };
|
|
26
|
+
if (platform === 'darwin' && arch === 'arm64')
|
|
27
|
+
return { os: 'osx', arch: 'aarch64', ext: '' };
|
|
28
|
+
if (platform === 'win32')
|
|
29
|
+
return { os: 'windows', arch: 'x86_64', ext: '.exe' };
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Unsupported platform: ${platform} ${arch}. Please install the plugin CLI manually.`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function download(url, dest) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
get(url, (res) => {
|
|
38
|
+
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
39
|
+
download(res.headers.location, dest).then(resolve, reject);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (res.statusCode !== 200) {
|
|
43
|
+
reject(
|
|
44
|
+
new Error(`Download failed with HTTP ${res.statusCode}: ${url}`),
|
|
45
|
+
);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const out = createWriteStream(dest);
|
|
49
|
+
res.pipe(createGunzip()).pipe(out);
|
|
50
|
+
out.on('finish', () => out.close(resolve));
|
|
51
|
+
out.on('error', reject);
|
|
52
|
+
}).on('error', reject);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function installPluginCli() {
|
|
57
|
+
const { os, arch, ext } = detectOsArch();
|
|
58
|
+
const binDir = join(homedir(), '.pact', 'bin');
|
|
59
|
+
const cliPath = join(binDir, `pact-plugin-cli${ext}`);
|
|
60
|
+
|
|
61
|
+
if (existsSync(cliPath)) {
|
|
62
|
+
console.log('=> Plugin CLI already installed');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const url = `https://github.com/pact-foundation/pact-plugins/releases/download/pact-plugin-cli-v${PLUGIN_CLI_VERSION}/pact-plugin-cli-${os}-${arch}${ext}.gz`;
|
|
67
|
+
console.log(`=> Installing plugin CLI v${PLUGIN_CLI_VERSION}`);
|
|
68
|
+
console.log(` OS: ${os}, Arch: ${arch}`);
|
|
69
|
+
console.log(` Downloading into: ${binDir}`);
|
|
70
|
+
|
|
71
|
+
mkdirSync(binDir, { recursive: true });
|
|
72
|
+
await download(url, cliPath);
|
|
73
|
+
if (ext !== '.exe') chmodSync(cliPath, 0o755);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function installMattPlugin() {
|
|
77
|
+
const pluginDir = join(
|
|
78
|
+
homedir(),
|
|
79
|
+
'.pact',
|
|
80
|
+
'plugins',
|
|
81
|
+
`matt-${MATT_PLUGIN_VERSION}`,
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
if (existsSync(pluginDir)) {
|
|
85
|
+
console.log('=> MATT plugin already installed');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const { ext } = detectOsArch();
|
|
90
|
+
const cliPath = join(homedir(), '.pact', 'bin', `pact-plugin-cli${ext}`);
|
|
91
|
+
const url = `https://github.com/mefellows/pact-matt-plugin/releases/tag/v${MATT_PLUGIN_VERSION}`;
|
|
92
|
+
console.log(`=> Installing MATT plugin v${MATT_PLUGIN_VERSION}`);
|
|
93
|
+
execFileSync(cliPath, ['install', url], { stdio: 'inherit' });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function main() {
|
|
97
|
+
await installPluginCli();
|
|
98
|
+
installMattPlugin();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
main().catch((err) => {
|
|
102
|
+
console.error(err.message);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
});
|
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ConfigurationError = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function ConfigurationError() {
|
|
22
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
-
}
|
|
24
|
-
return ConfigurationError;
|
|
25
|
-
}(Error));
|
|
4
|
+
class ConfigurationError extends Error {
|
|
5
|
+
}
|
|
26
6
|
exports.ConfigurationError = ConfigurationError;
|
|
27
7
|
//# sourceMappingURL=configurationError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationError.js","sourceRoot":"","sources":["../../../../src/common/graphQL/configurationError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configurationError.js","sourceRoot":"","sources":["../../../../src/common/graphQL/configurationError.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD"}
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.escapeGraphQlQuery = exports.escapeRegexChars = exports.escapeSpace = void 0;
|
|
7
7
|
exports.validateQuery = validateQuery;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const graphql_1 = require("graphql");
|
|
9
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
10
|
+
const configurationError_1 = require("./configurationError");
|
|
11
|
+
const graphQLQueryError_1 = require("./graphQLQueryError");
|
|
12
12
|
/**
|
|
13
13
|
* Accepts a raw or pre-parsed query, validating in the former case, and
|
|
14
14
|
* returns a normalized raw query.
|
|
@@ -17,10 +17,10 @@ var configurationError_1 = require("./configurationError");
|
|
|
17
17
|
*/
|
|
18
18
|
function validateQuery(query, type) {
|
|
19
19
|
if (!query) {
|
|
20
|
-
throw new configurationError_1.ConfigurationError(
|
|
20
|
+
throw new configurationError_1.ConfigurationError(`You must provide a GraphQL ${type}.`);
|
|
21
21
|
}
|
|
22
22
|
if (typeof query !== 'string') {
|
|
23
|
-
if (
|
|
23
|
+
if (query?.kind === 'Document') {
|
|
24
24
|
// Already parsed, store in string form
|
|
25
25
|
return (0, graphql_1.print)(query);
|
|
26
26
|
}
|
|
@@ -32,19 +32,16 @@ function validateQuery(query, type) {
|
|
|
32
32
|
(0, graphql_tag_1.default)(query);
|
|
33
33
|
}
|
|
34
34
|
catch (e) {
|
|
35
|
-
|
|
35
|
+
const error = e instanceof Error ? e : new Error(String(e));
|
|
36
|
+
throw new graphQLQueryError_1.GraphQLQueryError(`GraphQL ${type} is invalid: ${error.message}`);
|
|
36
37
|
}
|
|
37
38
|
return query;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
const escapeSpace = (s) => s.replace(/\s+/g, '\\s*');
|
|
41
42
|
exports.escapeSpace = escapeSpace;
|
|
42
|
-
|
|
43
|
-
return s.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
44
|
-
};
|
|
43
|
+
const escapeRegexChars = (s) => s.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
45
44
|
exports.escapeRegexChars = escapeRegexChars;
|
|
46
|
-
|
|
47
|
-
return (0, exports.escapeSpace)((0, exports.escapeRegexChars)(s));
|
|
48
|
-
};
|
|
45
|
+
const escapeGraphQlQuery = (s) => (0, exports.escapeSpace)((0, exports.escapeRegexChars)(s));
|
|
49
46
|
exports.escapeGraphQlQuery = escapeGraphQlQuery;
|
|
50
47
|
//# sourceMappingURL=graphQL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphQL.js","sourceRoot":"","sources":["../../../../src/common/graphQL/graphQL.ts"],"names":[],"mappings":";;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"graphQL.js","sourceRoot":"","sources":["../../../../src/common/graphQL/graphQL.ts"],"names":[],"mappings":";;;;;;AAgBA,sCA6BC;AA7CD,qCAA8C;AAC9C,8DAA8B;AAC9B,6DAA0D;AAC1D,2DAAwD;AAOxD;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,KAAuB,EACvB,IAAmB;IAEnB,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,uCAAkB,CAAC,8BAA8B,IAAI,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,EAAE,IAAI,KAAK,UAAU,EAAE,CAAC;YAC/B,uCAAuC;YACvC,OAAO,IAAA,eAAK,EAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QACD,MAAM,IAAI,uCAAkB,CAC1B,uDAAuD,CACxD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yBAAyB;QACzB,IAAI,CAAC;YACH,IAAA,qBAAG,EAAC,KAAK,CAAC,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,MAAM,IAAI,qCAAiB,CACzB,WAAW,IAAI,gBAAgB,KAAK,CAAC,OAAO,EAAE,CAC/C,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAEM,MAAM,WAAW,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAA/D,QAAA,WAAW,eAAoD;AAErE,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAU,EAAE,CACpD,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AADhC,QAAA,gBAAgB,oBACgB;AAEtC,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAU,EAAE,CACtD,IAAA,mBAAW,EAAC,IAAA,wBAAgB,EAAC,CAAC,CAAC,CAAC,CAAC;AADtB,QAAA,kBAAkB,sBACI"}
|
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.GraphQLQueryError = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function GraphQLQueryError() {
|
|
22
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
-
}
|
|
24
|
-
return GraphQLQueryError;
|
|
25
|
-
}(Error));
|
|
4
|
+
class GraphQLQueryError extends Error {
|
|
5
|
+
}
|
|
26
6
|
exports.GraphQLQueryError = GraphQLQueryError;
|
|
27
7
|
//# sourceMappingURL=graphQLQueryError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphQLQueryError.js","sourceRoot":"","sources":["../../../../src/common/graphQL/graphQLQueryError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphQLQueryError.js","sourceRoot":"","sources":["../../../../src/common/graphQL/graphQLQueryError.ts"],"names":[],"mappings":";;;AAAA,MAAa,iBAAkB,SAAQ,KAAK;CAAG;AAA/C,8CAA+C"}
|
package/src/common/logger.js
CHANGED
|
@@ -17,16 +17,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const logger_1 = __importDefault(require("@pact-foundation/pact-core/src/logger"));
|
|
21
|
+
const package_json_1 = require("../../package.json");
|
|
22
22
|
__exportStar(require("@pact-foundation/pact-core/src/logger"), exports);
|
|
23
|
-
|
|
23
|
+
const context = `pact@${package_json_1.version}`;
|
|
24
24
|
exports.default = {
|
|
25
|
-
pactCrash:
|
|
26
|
-
error:
|
|
27
|
-
warn:
|
|
28
|
-
info:
|
|
29
|
-
debug:
|
|
30
|
-
trace:
|
|
25
|
+
pactCrash: (message) => logger_1.default.pactCrash(message, context),
|
|
26
|
+
error: (message) => logger_1.default.error(message, context),
|
|
27
|
+
warn: (message) => logger_1.default.warn(message, context),
|
|
28
|
+
info: (message) => logger_1.default.info(message, context),
|
|
29
|
+
debug: (message) => logger_1.default.debug(message, context),
|
|
30
|
+
trace: (message) => logger_1.default.trace(message, context),
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=logger.js.map
|
package/src/common/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/common/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,mFAA2D;AAE3D,qDAA6C;AAE7C,wEAAsD;AAEtD,MAAM,OAAO,GAAG,QAAQ,sBAAO,EAAE,CAAC;AAElC,kBAAe;IACb,SAAS,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;IACxE,KAAK,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;IAChE,IAAI,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAC9D,IAAI,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAC9D,KAAK,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;IAChE,KAAK,EAAE,CAAC,OAAe,EAAQ,EAAE,CAAC,gBAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;CACjE,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { Rules,
|
|
1
|
+
import type { Matcher, Rules, StatusCodeMatcher } from '../v3/types';
|
|
2
2
|
/**
|
|
3
3
|
* Converts a matcher to the FFI format expected by pact-core
|
|
4
4
|
* @param matcher The matcher to convert
|
|
5
5
|
* @returns The matcher in FFI format
|
|
6
6
|
*/
|
|
7
7
|
export declare const convertMatcherToFFI: (matcher: Matcher<unknown>) => Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Converts a StatusCodeMatcher to the FFI matching rules format expected by pact-core
|
|
10
|
+
* @param matcher The status code matcher
|
|
11
|
+
* @returns The matching rules in FFI format
|
|
12
|
+
*/
|
|
13
|
+
export declare const convertStatusMatcherToFFI: (matcher: StatusCodeMatcher<number>) => Record<string, unknown>;
|
|
8
14
|
/**
|
|
9
15
|
* Validates that the rules parameter is of type Rules
|
|
10
16
|
* @param rules The rules to validate
|