@pact-foundation/pact 9.17.3 → 9.18.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 +14 -0
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +62 -91
- package/package.json +8 -8
- package/src/common/logger.d.ts +1 -1
- package/src/common/request.d.ts +1 -2
- package/src/common/request.js +73 -26
- package/src/common/request.js.map +1 -1
- package/src/dsl/verifier.d.ts +1 -0
- package/src/dsl/verifier.js +29 -3
- package/src/dsl/verifier.js.map +1 -1
- package/src/dsl/verifier.spec.js +58 -0
- package/src/dsl/verifier.spec.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [9.18.0](https://github.com/pact-foundation/pact-js/compare/v9.17.3...v9.18.0) (2022-06-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* drop support for pact web incl. karma examples ([d45f898](https://github.com/pact-foundation/pact-js/commit/d45f898b29a62aa77cecff499a46ce365fd2c79a))
|
|
11
|
+
* modify request body inside of verifer ([#873](https://github.com/pact-foundation/pact-js/issues/873)) ([be8ed15](https://github.com/pact-foundation/pact-js/commit/be8ed151c607b69bcf07670df211156887adb29e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Fixes and Improvements
|
|
15
|
+
|
|
16
|
+
* nestjs example should use branches in workflow ([a7adf07](https://github.com/pact-foundation/pact-js/commit/a7adf07d5563cf7ad92d2054b6913c890ef21220))
|
|
17
|
+
* webpack on node 16 ([903cf44](https://github.com/pact-foundation/pact-js/commit/903cf44dd15f19f6132b6d7bf5f89f0cccc70d41))
|
|
18
|
+
|
|
5
19
|
### [9.17.3](https://github.com/pact-foundation/pact-js/compare/v9.17.2...v9.17.3) (2022-03-16)
|
|
6
20
|
|
|
7
21
|
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
|
55
55
|
## Enforcement
|
|
56
56
|
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting the project team at pact-
|
|
58
|
+
reported by contacting the project team at pact-foundation@googlegroups.com. All
|
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Read [Getting started with Pact] for more information for beginners.
|
|
|
56
56
|
- [Publishing Pacts to a Broker](#publishing-pacts-to-a-broker)
|
|
57
57
|
- [Publish in npm scripts](#publish-in-npm-scripts)
|
|
58
58
|
- [Publish in a custom script](#publish-in-a-custom-script)
|
|
59
|
-
|
|
59
|
+
- [Pact publishing options](#pact-publishing-options)
|
|
60
60
|
- [Publishing Verification Results to a Pact Broker](#publishing-verification-results-to-a-pact-broker)
|
|
61
61
|
- [Asynchronous API Testing](#asynchronous-api-testing)
|
|
62
62
|
- [Consumer](#consumer)
|
|
@@ -72,9 +72,7 @@ Read [Getting started with Pact] for more information for beginners.
|
|
|
72
72
|
- [Examples](#examples)
|
|
73
73
|
- [HTTP APIs](#http-apis)
|
|
74
74
|
- [Asynchronous APIs](#asynchronous-apis)
|
|
75
|
-
- [Using Pact in non-Node environments](#using-pact-in-non-node-environments)
|
|
76
|
-
- [Using Pact with Karma](#using-pact-with-karma)
|
|
77
|
-
- [Using Pact with RequireJS](#using-pact-with-requirejs)
|
|
75
|
+
- [Using Pact in non-Node environments such as Karma](#using-pact-in-non-node-environments-such-as-karma)
|
|
78
76
|
- [Pact JS V3](#pact-js-v3)
|
|
79
77
|
- [Using the V3 matching rules](#using-the-v3-matching-rules)
|
|
80
78
|
- [Using Pact with XML](#using-pact-with-xml)
|
|
@@ -84,6 +82,7 @@ Read [Getting started with Pact] for more information for beginners.
|
|
|
84
82
|
- [Debugging issues with Pact-JS V3](#debugging-issues-with-pact-js-v3)
|
|
85
83
|
- [Debugging](#debugging)
|
|
86
84
|
- [Troubleshooting / FAQs](#troubleshooting--faqs)
|
|
85
|
+
- [Actual interactions do not match expected interactions for mock MockService.](#actual-interactions-do-not-match-expected-interactions-for-mock-mockservice)
|
|
87
86
|
- [Corporate Proxies / Firewalls](#corporate-proxies--firewalls)
|
|
88
87
|
- [Alpine + Docker](#alpine--docker)
|
|
89
88
|
- [Parallel tests](#parallel-tests)
|
|
@@ -101,11 +100,19 @@ Read [Getting started with Pact] for more information for beginners.
|
|
|
101
100
|
|
|
102
101
|
## Installation
|
|
103
102
|
|
|
103
|
+
NPM
|
|
104
|
+
```sh
|
|
105
|
+
npm install --save-dev @pact-foundation/pact@latest
|
|
104
106
|
```
|
|
105
|
-
|
|
107
|
+
|
|
108
|
+
Yarn
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
yarn add --dev @pact-foundation/pact@latest
|
|
106
112
|
```
|
|
107
113
|
|
|
108
|
-
|
|
114
|
+
- Ensure you install the package as `devDependencies` by using [`--save-dev`][npm-devdep]/[`--dev`][yarn-devdep] ;
|
|
115
|
+
- Make sure the `ignore-scripts` option is disabled, pact uses npm scripts to download further dependencies.
|
|
109
116
|
|
|
110
117
|
### Do Not Track
|
|
111
118
|
|
|
@@ -195,7 +202,7 @@ The first step is to create a test for your API Consumer. The example below uses
|
|
|
195
202
|
1. Validate the expected interactions were made between your consumer and the Mock Service
|
|
196
203
|
1. Generate the pact(s)
|
|
197
204
|
|
|
198
|
-
Check out the `examples` folder for examples with
|
|
205
|
+
Check out the `examples` folder for examples with Mocha and Jest. The example below is taken from the [integration spec](https://github.com/pact-foundation/pact-js/blob/master/src/pact.integration.spec.ts).
|
|
199
206
|
|
|
200
207
|
```javascript
|
|
201
208
|
const path = require("path")
|
|
@@ -427,7 +434,7 @@ Pending pacts is a feature that allows consumers to publish new contracts or cha
|
|
|
427
434
|
|
|
428
435
|
This enables safe introduction of new contracts into the system, without breaking Provider builds, whilst still providing feedback to Consumers as per before.
|
|
429
436
|
|
|
430
|
-
See the [docs](https://docs.pact.io/pending) and this [article](
|
|
437
|
+
See the [docs](https://docs.pact.io/pending) and this [article](https://docs.pact.io/blog/2020/02/24/how-weve-fixed-the-biggest-problem-with-the-pact-workflow) for more background.
|
|
431
438
|
|
|
432
439
|
#### WIP Pacts
|
|
433
440
|
|
|
@@ -435,7 +442,7 @@ _NOTE_: This feature is available on [Pactflow] by default, and requires [config
|
|
|
435
442
|
|
|
436
443
|
WIP Pacts builds upon pending pacts, enabling provider tests to pull in _any_ contracts applicable to the provider regardless of the `tag` it was given. This is useful, because often times consumers won't follow the exact same tagging convention and so their workflow would be interrupted. This feature enables any pacts determined to be "work in progress" to be verified by the Provider, without causing a build failure. You can enable this behaviour by specifying a valid timestamp for `includeWipPactsSince`. This sets the start window for which new WIP pacts will be pulled down for verification, regardless of the tag.
|
|
437
444
|
|
|
438
|
-
See the [docs](https://docs.pact.io/wip) and this [article](
|
|
445
|
+
See the [docs](https://docs.pact.io/wip) and this [article](https://docs.pact.io/blog/2020/02/24/introducing-wip-pacts) for more background.
|
|
439
446
|
|
|
440
447
|
#### Verifying multiple contracts with the same tag (e.g. for Mobile use cases)
|
|
441
448
|
|
|
@@ -537,7 +544,7 @@ The easiest way to publish pacts to the broker is via an npm script in your pack
|
|
|
537
544
|
|
|
538
545
|
```
|
|
539
546
|
|
|
540
|
-
"pact:publish": "pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx
|
|
547
|
+
"pact:publish": "pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=https://your-broker-url.example.com"
|
|
541
548
|
```
|
|
542
549
|
|
|
543
550
|
For a full list of the options, see the [CLI usage instructions](https://github.com/pact-foundation/pact-ruby-standalone/releases).
|
|
@@ -572,7 +579,7 @@ new Publisher(opts)
|
|
|
572
579
|
| -------------------- | :------: | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
573
580
|
| `providerBaseUrl` | `false` | string | Running API provider host endpoint. |
|
|
574
581
|
| `pactFilesOrDirs` | `true` | array of strings | Array of local Pact files or directories containing pact files. Path must be absolute. Required. |
|
|
575
|
-
| `pactBroker` | `true` | string | The base URL of the Pact Broker. eg. https://test.
|
|
582
|
+
| `pactBroker` | `true` | string | The base URL of the Pact Broker. eg. https://test.pactflow.io. Required. |
|
|
576
583
|
| `pactBrokerToken` | `false` | string | Bearer token for Pact Broker authentication. Optional. If using Pactflow, you likely need this option |
|
|
577
584
|
| `pactBrokerUsername` | `false` | string | Username for Pact Broker basic authentication. Optional. If using Pactflow, you most likely need to use `pactBrokerToken` |
|
|
578
585
|
| `pactBrokerPassword` | `false` | string | Password for Pact Broker basic authentication. Optional. If using Pactflow, you most likely need to use `pactBrokerToken` |
|
|
@@ -926,8 +933,6 @@ The workshop takes you through all of the key concepts using a React consumer an
|
|
|
926
933
|
- [Pact with TypeScript + Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/typescript)
|
|
927
934
|
- [Pact with Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/mocha)
|
|
928
935
|
- [Pact with GraphQL](https://github.com/pact-foundation/pact-js/tree/master/examples/graphql)
|
|
929
|
-
- [Pact with Karma + Jasmine](https://github.com/pact-foundation/pact-js/tree/master/examples/karma/jasmine)
|
|
930
|
-
- [Pact with Karma + Mocha](https://github.com/pact-foundation/pact-js/tree/master/examples/karma/mocha)
|
|
931
936
|
- [Pact with React + Jest](https://github.com/pact-foundation/pact-workshop-js)
|
|
932
937
|
|
|
933
938
|
### Asynchronous APIs
|
|
@@ -935,98 +940,35 @@ The workshop takes you through all of the key concepts using a React consumer an
|
|
|
935
940
|
- [Asynchronous messages](https://github.com/pact-foundation/pact-js/tree/master/examples/messages)
|
|
936
941
|
- [Serverless](https://github.com/pact-foundation/pact-js/tree/master/examples/serverless)
|
|
937
942
|
|
|
938
|
-
## Using Pact in non-Node environments
|
|
943
|
+
## Using Pact in non-Node environments such as Karma
|
|
939
944
|
|
|
940
945
|
Pact requires a Node runtime to be able to start and stop Mock servers, write logs and other things.
|
|
941
946
|
|
|
942
947
|
However, when used within browser or non-Node based environments - such as with Karma or ng-test - this is not possible.
|
|
943
948
|
|
|
944
|
-
|
|
945
|
-
Whilst it still provides a testing DSL, it cannot start and stop mock servers as per the `pact`
|
|
946
|
-
package, so you will need to coordinate this yourself prior to and after executing any tests.
|
|
947
|
-
|
|
948
|
-
To get started, install `pact-web` and [Pact Node](https://github.com/pact-foundation/pact-node):
|
|
949
|
-
|
|
950
|
-
npm install --save-dev @pact-foundation/pact-web @pact-foundation/pact-node
|
|
951
|
-
|
|
952
|
-
If you're not using Karma, you can start and stop the mock server using [Pact Node](https://github.com/pact-foundation/pact-node) or something like [Grunt Pact](https://github.com/pact-foundation/grunt-pact).
|
|
953
|
-
|
|
954
|
-
### Using Pact with Karma
|
|
955
|
-
|
|
956
|
-
We have create a [plugin](https://github.com/pact-foundation/karma-pact) for Karma,
|
|
957
|
-
which will automatically start and stop any Mock Server for your Pact tests.
|
|
958
|
-
|
|
959
|
-
Modify your `karma.conf.js` file as per below to get started:
|
|
960
|
-
|
|
961
|
-
```js
|
|
962
|
-
// Load pact framework - this will start/stop mock server automatically
|
|
963
|
-
frameworks: ['pact'],
|
|
964
|
-
|
|
965
|
-
// Load the pact and default karma plugins
|
|
966
|
-
plugins: [
|
|
967
|
-
'karma-*',
|
|
968
|
-
'@pact-foundation/karma-pact'
|
|
969
|
-
],
|
|
970
|
-
|
|
971
|
-
// load pact web module
|
|
972
|
-
files: [
|
|
973
|
-
'node_modules/@pact-foundation/pact-web/pact-web.js',
|
|
974
|
-
...
|
|
975
|
-
],
|
|
976
|
-
|
|
977
|
-
// Configure the mock service
|
|
978
|
-
pact: [{
|
|
979
|
-
port: 1234,
|
|
980
|
-
consumer: 'KarmaMochaConsumer',
|
|
981
|
-
provider: 'KarmaMochaProvider',
|
|
982
|
-
logLevel: 'DEBUG',
|
|
983
|
-
log: path.resolve(process.cwd(), 'logs', 'pact.log'),
|
|
984
|
-
dir: path.resolve(process.cwd(), 'pacts')
|
|
985
|
-
}],
|
|
986
|
-
```
|
|
987
|
-
|
|
988
|
-
Check out the [Examples](#examples) for how to use the Karma interface.
|
|
989
|
-
|
|
990
|
-
### Using Pact with RequireJS
|
|
991
|
-
|
|
992
|
-
The module name should be "Pact" - not "pact-js". An example config with a karma test might look
|
|
993
|
-
like the following:
|
|
994
|
-
|
|
995
|
-
In `client-spec.js` change the `define` to:
|
|
996
|
-
|
|
997
|
-
```js
|
|
998
|
-
define(['client', 'Pact'], function (example, Pact) {
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
In `test-main.js`:
|
|
1002
|
-
|
|
1003
|
-
```js
|
|
1004
|
-
require.config({
|
|
1005
|
-
baseUrl: "/base",
|
|
1006
|
-
paths: {
|
|
1007
|
-
Pact: "node_modules/pact-web/pact-web",
|
|
1008
|
-
client: "js/client",
|
|
1009
|
-
},
|
|
1010
|
-
deps: allTestFiles,
|
|
1011
|
-
callback: window.__karma__.start,
|
|
1012
|
-
})
|
|
1013
|
-
```
|
|
1014
|
-
|
|
1015
|
-
See this [Stack Overflow](https://stackoverflow.com/a/44170373/1008568) question for background, and
|
|
1016
|
-
this [gist](https://gist.github.com/mefellows/15c9fcb052c2aa9d8951f91d48d6da54) with a working example.
|
|
949
|
+
You will need a Node based test framework such as Jest or Mocha.
|
|
1017
950
|
|
|
1018
951
|
## Pact JS V3
|
|
1019
952
|
|
|
1020
|
-
An initial
|
|
953
|
+
An initial beta version of Pact-JS with support for V3 specification features and XML matching has
|
|
1021
954
|
been released. Current support is for Node 10, 12 and 14. Thanks to the folks at [Align Tech](https://www.aligntech.com/) for sponsoring this work.
|
|
1022
955
|
|
|
1023
956
|
To install it:
|
|
1024
957
|
|
|
1025
|
-
|
|
1026
|
-
|
|
958
|
+
NPM
|
|
959
|
+
```sh
|
|
960
|
+
npm install --save-dev @pact-foundation/pact@beta
|
|
1027
961
|
```
|
|
1028
962
|
|
|
1029
|
-
|
|
963
|
+
Yarn
|
|
964
|
+
|
|
965
|
+
```sh
|
|
966
|
+
yarn add --dev @pact-foundation/pact@beta
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
- Ensure you install the package as `devDependencies` by using [`--save-dev`][npm-devdep]/[`--dev`][yarn-devdep] ;
|
|
970
|
+
- Make sure the `ignore-scripts` option is disabled, pact uses npm scripts to download further dependencies.
|
|
971
|
+
- For examples on how to use it, see [examples/v3/e2e](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/e2e) and [examples/v3/todo-consumer](https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0/examples/v3/todo-consumer) in the `v3.0.0` branch.
|
|
1030
972
|
|
|
1031
973
|
**NOTE: The API of this implementation is likely to change. See this [discussion](https://github.com/pact-foundation/pact-js/discussions/681) for more**
|
|
1032
974
|
|
|
@@ -1211,6 +1153,33 @@ Try starting the mock service manually and seeing if it comes up. When submittin
|
|
|
1211
1153
|
|
|
1212
1154
|
If you are having issues, a good place to start is setting `logLevel: 'debug'` when configuring the `new Pact({...})` object. This will give you detailed in/out requests as far as Pact sees them during verification.
|
|
1213
1155
|
|
|
1156
|
+
### Actual interactions do not match expected interactions for mock MockService.
|
|
1157
|
+
|
|
1158
|
+
If you see an error that looks like this:
|
|
1159
|
+
|
|
1160
|
+
```
|
|
1161
|
+
console.error
|
|
1162
|
+
Pact verification failed!
|
|
1163
|
+
|
|
1164
|
+
at node_modules/@pact-foundation/src/httpPact.ts:152:17
|
|
1165
|
+
|
|
1166
|
+
console.error
|
|
1167
|
+
Actual interactions do not match expected interactions for mock MockService.
|
|
1168
|
+
|
|
1169
|
+
Missing requests:
|
|
1170
|
+
GET http://127.0.0.1:3001/some/path
|
|
1171
|
+
```
|
|
1172
|
+
|
|
1173
|
+
It means your API client code being tested, is not sending the request to the mock service configured by Pact. Pact does not automatically mock your API calls - you need to ensure your API client is correctly configured to poitn at the Pact mock service.
|
|
1174
|
+
|
|
1175
|
+
Given you have constructed a Pact object with name `provider` and you are using a `DogApiClient` class to send requests to your `Dog Service`, you can dynamically configure your API client as follows:
|
|
1176
|
+
|
|
1177
|
+
```
|
|
1178
|
+
provider.setup().then(opts => {
|
|
1179
|
+
dogService = new DogApiClient({ `http://${opts.host}`, port: opts.port })
|
|
1180
|
+
})
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1214
1183
|
### Corporate Proxies / Firewalls
|
|
1215
1184
|
|
|
1216
1185
|
If you're on a corporate machine, it's common for all network calls to route through a proxy - even requests that go to your own machine!
|
|
@@ -1418,3 +1387,5 @@ or chat to us at
|
|
|
1418
1387
|
[spec]: https://github.com/pact-foundation/pact-specification
|
|
1419
1388
|
[changelog]: https://github.com/pact-foundation/pact-js/blob/master/CHANGELOG.md
|
|
1420
1389
|
[pactflow]: https://pactflow.io
|
|
1390
|
+
[npm-devdep]: https://docs.npmjs.com/cli/v8/commands/npm-install
|
|
1391
|
+
[yarn-devdep]: https://classic.yarnpkg.com/en/docs/cli/add#toc-yarn-add-dev-d
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pact-foundation/pact",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.18.0",
|
|
4
4
|
"description": "Pact for all things Javascript",
|
|
5
5
|
"main": "./src/pact.js",
|
|
6
6
|
"types": "./src/pact.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clean": "rimraf docs dist dist-web coverage .nyc_output logs pacts",
|
|
9
9
|
"coverage": "nyc report --reporter=lcov",
|
|
10
|
-
"dist": "tsc &&
|
|
10
|
+
"dist": "tsc && copyfiles package.json ./dist",
|
|
11
11
|
"lint": "tslint -c tslint.json '{src,test,examples}/**/*.ts' -e '**/node_modules/**/*.ts'",
|
|
12
12
|
"lint:fix": "npm run lint -- --fix",
|
|
13
13
|
"format:base": "prettier \"{src,test,examples}/**/*.{ts,js}\"",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"postdist": "npm test",
|
|
17
17
|
"predist": "npm run clean && npm run format:check && npm run lint",
|
|
18
18
|
"release": "standard-version",
|
|
19
|
-
"test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha"
|
|
20
|
-
"webpack": "webpack --config ./config/webpack.web.config.js"
|
|
19
|
+
"test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha"
|
|
21
20
|
},
|
|
22
21
|
"repository": {
|
|
23
22
|
"type": "git",
|
|
@@ -97,6 +96,8 @@
|
|
|
97
96
|
"@pact-foundation/pact-node": "^10.17.2",
|
|
98
97
|
"@types/bluebird": "^3.5.20",
|
|
99
98
|
"@types/express": "^4.17.11",
|
|
99
|
+
"@types/http-proxy": "^1.17.9",
|
|
100
|
+
"axios": "^0.27.2",
|
|
100
101
|
"bluebird": "~3.5.1",
|
|
101
102
|
"body-parser": "^1.18.2",
|
|
102
103
|
"cli-color": "^1.1.0",
|
|
@@ -115,7 +116,8 @@
|
|
|
115
116
|
"pino": "^6.5.1",
|
|
116
117
|
"pino-pretty": "^4.1.0",
|
|
117
118
|
"pkginfo": "^0.4.1",
|
|
118
|
-
"
|
|
119
|
+
"ramda": "^0.26.1",
|
|
120
|
+
"randexp": "^0.5.3"
|
|
119
121
|
},
|
|
120
122
|
"devDependencies": {
|
|
121
123
|
"@babel/cli": "^7.14.5",
|
|
@@ -170,8 +172,6 @@
|
|
|
170
172
|
"ts-node": "^3.3.0",
|
|
171
173
|
"tslint": "^5.11.0",
|
|
172
174
|
"tslint-config-prettier": "^1.15.0",
|
|
173
|
-
"typescript": "^3.3.3"
|
|
174
|
-
"webpack": "^4.45.0",
|
|
175
|
-
"webpack-cli": "^4.3.1"
|
|
175
|
+
"typescript": "^3.3.3"
|
|
176
176
|
}
|
|
177
177
|
}
|
package/src/common/logger.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import pino = require("pino");
|
|
2
2
|
declare const logger: pino.Logger;
|
|
3
|
-
export declare const setLogLevel: (wantedLevel?: number | "error" | "
|
|
3
|
+
export declare const setLogLevel: (wantedLevel?: number | "error" | "fatal" | "warn" | "info" | "debug" | "trace" | undefined) => number | void;
|
|
4
4
|
export declare const traceHttpInteractions: () => void;
|
|
5
5
|
export default logger;
|
package/src/common/request.d.ts
CHANGED
|
@@ -17,6 +17,5 @@ export declare enum HTTPMethod {
|
|
|
17
17
|
}
|
|
18
18
|
export declare type methods = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "COPY" | "LOCK" | "MKCOL" | "MOVE" | "PROPFIND" | "PROPPATCH" | "UNLOCK" | "REPORT";
|
|
19
19
|
export declare class Request {
|
|
20
|
-
|
|
21
|
-
send(method: HTTPMethod | methods, url: string, body?: string): Promise<string>;
|
|
20
|
+
send(method: HTTPMethod, url: string, body?: string): Promise<string>;
|
|
22
21
|
}
|
package/src/common/request.js
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
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;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "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 (_) 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
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
39
|
exports.Request = exports.HTTPMethod = void 0;
|
|
4
|
-
|
|
5
|
-
require("
|
|
6
|
-
var
|
|
40
|
+
var axios_1 = require("axios");
|
|
41
|
+
var https = require("https");
|
|
42
|
+
var logger_1 = require("./logger");
|
|
7
43
|
var HTTPMethod;
|
|
8
44
|
(function (HTTPMethod) {
|
|
9
45
|
HTTPMethod["GET"] = "GET";
|
|
@@ -24,31 +60,42 @@ var HTTPMethod;
|
|
|
24
60
|
})(HTTPMethod = exports.HTTPMethod || (exports.HTTPMethod = {}));
|
|
25
61
|
var Request = /** @class */ (function () {
|
|
26
62
|
function Request() {
|
|
27
|
-
this.transport = Popsicle.createTransport({
|
|
28
|
-
maxBufferSize: Infinity,
|
|
29
|
-
rejectUnauthorized: false,
|
|
30
|
-
type: "text",
|
|
31
|
-
});
|
|
32
63
|
}
|
|
33
64
|
Request.prototype.send = function (method, url, body) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var res, e_1;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0:
|
|
70
|
+
_a.trys.push([0, 2, , 3]);
|
|
71
|
+
return [4 /*yield*/, axios_1.default(url, {
|
|
72
|
+
data: body,
|
|
73
|
+
headers: {
|
|
74
|
+
"Content-Type": "application/json",
|
|
75
|
+
"X-Pact-Mock-Service": "true",
|
|
76
|
+
},
|
|
77
|
+
httpsAgent: new https.Agent({
|
|
78
|
+
keepAlive: true,
|
|
79
|
+
rejectUnauthorized: false,
|
|
80
|
+
}),
|
|
81
|
+
method: method,
|
|
82
|
+
timeout: 10000,
|
|
83
|
+
url: url,
|
|
84
|
+
maxBodyLength: Infinity,
|
|
85
|
+
})];
|
|
86
|
+
case 1:
|
|
87
|
+
res = _a.sent();
|
|
88
|
+
if (res.status >= 200 && res.status < 400) {
|
|
89
|
+
return [2 /*return*/, res.data];
|
|
90
|
+
}
|
|
91
|
+
return [2 /*return*/, Promise.reject(res.data)];
|
|
92
|
+
case 2:
|
|
93
|
+
e_1 = _a.sent();
|
|
94
|
+
logger_1.default.error("error making http request: " + e_1.message);
|
|
95
|
+
return [2 /*return*/, Promise.reject(e_1.response && e_1.response.data ? e_1.response.data : e_1.message)];
|
|
96
|
+
case 3: return [2 /*return*/];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
52
99
|
});
|
|
53
100
|
};
|
|
54
101
|
return Request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/common/request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/common/request.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,6BAA8B;AAC9B,mCAA6B;AAE7B,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAhBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgBrB;AAmBD;IAAA;IAkCA,CAAC;IAjCc,sBAAI,GAAjB,UACE,MAAkB,EAClB,GAAW,EACX,IAAa;;;;;;;wBAGC,qBAAM,eAAK,CAAC,GAAG,EAAE;gCAC3B,IAAI,EAAE,IAAI;gCACV,OAAO,EAAE;oCACP,cAAc,EAAE,kBAAkB;oCAClC,qBAAqB,EAAE,MAAM;iCAC9B;gCACD,UAAU,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC;oCAC1B,SAAS,EAAE,IAAI;oCACf,kBAAkB,EAAE,KAAK;iCAC1B,CAAC;gCACF,MAAM,QAAA;gCACN,OAAO,EAAE,KAAK;gCACd,GAAG,KAAA;gCACH,aAAa,EAAE,QAAQ;6BACxB,CAAC,EAAA;;wBAdI,GAAG,GAAG,SAcV;wBAEF,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE;4BACzC,sBAAO,GAAG,CAAC,IAAI,EAAA;yBAChB;wBACD,sBAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAA;;;wBAE/B,gBAAM,CAAC,KAAK,CAAC,gCAA8B,GAAC,CAAC,OAAS,CAAC,CAAA;wBACvD,sBAAO,OAAO,CAAC,MAAM,CACnB,GAAC,CAAC,QAAQ,IAAI,GAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAC,CAAC,OAAO,CAC5D,EAAA;;;;;KAEJ;IACH,cAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCY,0BAAO"}
|
package/src/dsl/verifier.d.ts
CHANGED
package/src/dsl/verifier.js
CHANGED
|
@@ -130,8 +130,15 @@ var Verifier = /** @class */ (function () {
|
|
|
130
130
|
var _this = this;
|
|
131
131
|
var app = express();
|
|
132
132
|
var proxy = new HttpProxy();
|
|
133
|
-
app.use(
|
|
134
|
-
|
|
133
|
+
app.use(bodyParser.json({
|
|
134
|
+
type: [
|
|
135
|
+
"application/json",
|
|
136
|
+
"application/json; charset=utf-8",
|
|
137
|
+
"application/json; charset=utf8",
|
|
138
|
+
],
|
|
139
|
+
}));
|
|
140
|
+
app.use(bodyParser.urlencoded({ extended: true }));
|
|
141
|
+
app.use("/*", bodyParser.raw({ type: "*/*" }));
|
|
135
142
|
this.registerBeforeHook(app);
|
|
136
143
|
this.registerAfterHook(app);
|
|
137
144
|
// Trace req/res logging
|
|
@@ -148,15 +155,34 @@ var Verifier = /** @class */ (function () {
|
|
|
148
155
|
app.post(this.stateSetupPath, this.createProxyStateHandler());
|
|
149
156
|
// Proxy server will respond to Verifier process
|
|
150
157
|
app.all("/*", function (req, res) {
|
|
151
|
-
logger_1.default.debug("Proxing", req.path);
|
|
158
|
+
logger_1.default.debug("Proxing", req.method, req.path);
|
|
152
159
|
proxy.web(req, res, {
|
|
153
160
|
changeOrigin: _this.config.changeOrigin === true,
|
|
154
161
|
secure: _this.config.validateSSL === true,
|
|
155
162
|
target: _this.config.providerBaseUrl,
|
|
156
163
|
});
|
|
157
164
|
});
|
|
165
|
+
proxy.on("proxyReq", function (proxyReq, req) {
|
|
166
|
+
_this.parseBody(proxyReq, req);
|
|
167
|
+
});
|
|
158
168
|
return app;
|
|
159
169
|
};
|
|
170
|
+
Verifier.prototype.parseBody = function (proxyReq, req) {
|
|
171
|
+
if (!req.body || !Object.keys(req.body).length) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
var bodyData;
|
|
175
|
+
if (Buffer.isBuffer(req.body)) {
|
|
176
|
+
bodyData = req.body;
|
|
177
|
+
}
|
|
178
|
+
else if (typeof req.body === "object") {
|
|
179
|
+
bodyData = JSON.stringify(req.body);
|
|
180
|
+
}
|
|
181
|
+
if (bodyData) {
|
|
182
|
+
proxyReq.setHeader("Content-Length", Buffer.byteLength(bodyData));
|
|
183
|
+
proxyReq.write(bodyData);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
160
186
|
Verifier.prototype.createProxyStateHandler = function () {
|
|
161
187
|
var _this = this;
|
|
162
188
|
return function (req, res) {
|
package/src/dsl/verifier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../../src/dsl/verifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,wDAA6C;AAC7C,yCAA4C;AAE5C,wDAAuD;AACvD,iCAAgE;AAChE,iCAAkC;AAClC,2BAA4B;AAC5B,2CAAsD;AAEtD,mEAA6D;AAC7D,qCAA8C;AAC9C,yBAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../../src/dsl/verifier.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;GAGG;AACH,wDAA6C;AAC7C,yCAA4C;AAE5C,wDAAuD;AACvD,iCAAgE;AAChE,iCAAkC;AAClC,2BAA4B;AAC5B,2CAAsD;AAEtD,mEAA6D;AAC7D,qCAA8C;AAC9C,yBAA0B;AAC1B,sCAAuC;AACvC,wCAAyC;AAwBzC;IAME,kBAAY,MAAwB;QAL5B,YAAO,GAAW,kBAAkB,CAAA;QACpC,mBAAc,GAAW,aAAa,CAAA;QAEtC,qBAAgB,GAAa,CAAC,wBAAwB,CAAC,CAAA;QAG7D,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;SACvB;IACH,CAAC;IAED;;;;OAIG;IACI,iCAAc,GAArB,UAAsB,MAAwB;QAC5C,gBAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;QAEjC,0BAA0B;QAC1B,IAAI,MAAM,EAAE;YACV,gBAAM,CAAC,IAAI,CACT,0HAA0H,CAC3H,CAAA;YACD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;SACvB;QAED,IAAI,gBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YACxB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,4BAAkB,CAAC,uCAAuC,CAAC,CAChE,CAAA;SACF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c,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,oBAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CACvE,CAAA;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAvSD,IAuSC;AAvSY,4BAAQ;AAySrB,IAAM,4BAA4B,GAAG,UAAC,GAAoB;IACxD,OAAA,eAAM,CACJ;QACE,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI,EAAE,GAAG,CAAC,IAAI;KACf,EACD,iBAAQ,CACT;AARD,CAQC,CAAA;AAEH,IAAM,6BAA6B,GAAG,UAAC,IAAS,EAAE,GAAqB;IACrE,OAAA,eAAM,CACJ;QACE,IAAI,MAAA;QACJ,OAAO,EAAE,eAAM,CACb,GAAG,CAAC,UAAU,EAAE,EAChB,UAAC,GAAQ,EAAE,GAAG,EAAE,KAAK;YACnB,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;YAChB,OAAO,GAAG,CAAA;QACZ,CAAC,EACD,EAAE,CACH;QACD,MAAM,EAAE,GAAG,CAAC,UAAU;KACvB,EACD,iBAAQ,CACT;AAdD,CAcC,CAAA"}
|
package/src/dsl/verifier.spec.js
CHANGED
|
@@ -54,6 +54,7 @@ var sinon = require("sinon");
|
|
|
54
54
|
var verifier_1 = require("./verifier");
|
|
55
55
|
var pact_node_1 = require("@pact-foundation/pact-node");
|
|
56
56
|
var logger_1 = require("../common/logger");
|
|
57
|
+
var http = require("http");
|
|
57
58
|
var express = require("express");
|
|
58
59
|
chai.use(chaiAsPromised);
|
|
59
60
|
var expect = chai.expect;
|
|
@@ -136,6 +137,63 @@ describe("Verifier", function () {
|
|
|
136
137
|
});
|
|
137
138
|
});
|
|
138
139
|
});
|
|
140
|
+
describe("#parseBody", function () {
|
|
141
|
+
var proxyReq;
|
|
142
|
+
beforeEach(function () {
|
|
143
|
+
v = new verifier_1.Verifier(opts);
|
|
144
|
+
proxyReq = sinon.createStubInstance(http.ClientRequest);
|
|
145
|
+
});
|
|
146
|
+
describe("when request body exists", function () {
|
|
147
|
+
it("it writes the request if the body is a buffer", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
148
|
+
var req;
|
|
149
|
+
return __generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0:
|
|
152
|
+
req = { body: "" };
|
|
153
|
+
req.body = Buffer.from("foo");
|
|
154
|
+
return [4 /*yield*/, v["parseBody"](proxyReq, req)];
|
|
155
|
+
case 1:
|
|
156
|
+
_a.sent();
|
|
157
|
+
expect(proxyReq.setHeader).to.have.been.called;
|
|
158
|
+
expect(proxyReq.write).to.have.been.called;
|
|
159
|
+
return [2 /*return*/];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}); });
|
|
163
|
+
it("it writes the request if the body is an object", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
164
|
+
var req;
|
|
165
|
+
return __generator(this, function (_a) {
|
|
166
|
+
switch (_a.label) {
|
|
167
|
+
case 0:
|
|
168
|
+
req = { body: { foo: "bar" } };
|
|
169
|
+
return [4 /*yield*/, v["parseBody"](proxyReq, req)];
|
|
170
|
+
case 1:
|
|
171
|
+
_a.sent();
|
|
172
|
+
expect(proxyReq.setHeader).to.have.been.called;
|
|
173
|
+
expect(proxyReq.write).to.have.been.called;
|
|
174
|
+
return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); });
|
|
178
|
+
});
|
|
179
|
+
describe("when request body does not exist", function () {
|
|
180
|
+
it("it does not invoke the request rewrite", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
181
|
+
var req;
|
|
182
|
+
return __generator(this, function (_a) {
|
|
183
|
+
switch (_a.label) {
|
|
184
|
+
case 0:
|
|
185
|
+
req = "foo";
|
|
186
|
+
return [4 /*yield*/, v["parseBody"](proxyReq, req)];
|
|
187
|
+
case 1:
|
|
188
|
+
_a.sent();
|
|
189
|
+
expect(proxyReq.setHeader).to.have.not.been.called;
|
|
190
|
+
expect(proxyReq.write).to.have.not.been.called;
|
|
191
|
+
return [2 /*return*/];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}); });
|
|
195
|
+
});
|
|
196
|
+
});
|
|
139
197
|
describe("#setupStates", function () {
|
|
140
198
|
describe("when there are provider states on the pact", function () {
|
|
141
199
|
describe("and there are handlers associated with those states", function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.spec.js","sourceRoot":"","sources":["../../../src/dsl/verifier.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,2BAA4B;AAC5B,iDAAkD;AAClD,6BAA8B;AAC9B,uCAAsD;AACtD,wDAAuD;AACvD,2CAAqC;
|
|
1
|
+
{"version":3,"file":"verifier.spec.js","sourceRoot":"","sources":["../../../src/dsl/verifier.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAmE;AACnE,2BAA4B;AAC5B,iDAAkD;AAClD,6BAA8B;AAC9B,uCAAsD;AACtD,wDAAuD;AACvD,2CAAqC;AACrC,2BAA4B;AAC5B,iCAAkC;AAGlC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAExB,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;AAE1B,QAAQ,CAAC,UAAU,EAAE;IACnB,SAAS,CAAC;QACR,KAAK,CAAC,OAAO,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,IAAM,KAAK,GAAG,cAAc,CAAA;IAC5B,IAAI,CAAW,CAAA;IACf,IAAI,IAAqB,CAAA;IACzB,IAAI,QAAiB,CAAA;IACrB,IAAM,eAAe,GAAG,mBAAmB,CAAA;IAE3C,+CAA+C;IAC/C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