@pact-foundation/pact-core 13.4.1-beta.1 → 13.4.1-beta.13

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 (56) hide show
  1. package/binding.gyp +4 -8
  2. package/build/Makefile +352 -0
  3. package/build/binding.Makefile +6 -0
  4. package/build/copy_release_artifacts.target.mk +47 -0
  5. package/build/gyp-mac-tool +615 -0
  6. package/build/pact.target.mk +207 -0
  7. package/build/set_osx_install_name.target.mk +47 -0
  8. package/ffi/libpact_ffi.dylib +0 -0
  9. package/ffi/libpact_ffi.so +0 -0
  10. package/ffi/osxaarch64/libpact_ffi.dylib +0 -0
  11. package/ffi/pact.h +655 -119
  12. package/ffi/pact_ffi.dll +0 -0
  13. package/ffi/pact_ffi.dll.lib +0 -0
  14. package/native/consumer.cc +89 -33
  15. package/package.json +6 -9
  16. package/src/consumer/__testoutput__/foo-consumer-bar-provider.json +255 -0
  17. package/src/consumer/index.d.ts +1 -0
  18. package/src/consumer/index.js +43 -31
  19. package/src/consumer/index.js.map +1 -1
  20. package/src/consumer/types.d.ts +3 -0
  21. package/src/ffi/index.d.ts +4 -4
  22. package/src/ffi/index.js +6 -9
  23. package/src/ffi/index.js.map +1 -1
  24. package/src/ffi/internals/index.d.ts +0 -2
  25. package/src/ffi/internals/index.js +1 -11
  26. package/src/ffi/internals/index.js.map +1 -1
  27. package/src/ffi/types.d.ts +53 -0
  28. package/src/ffi/types.js +23 -1
  29. package/src/ffi/types.js.map +1 -1
  30. package/src/publisher.d.ts +1 -0
  31. package/src/publisher.js +11 -4
  32. package/src/publisher.js.map +1 -1
  33. package/src/verifier/nativeVerifier.js +12 -12
  34. package/src/verifier/nativeVerifier.js.map +1 -1
  35. package/src/verifier/types.d.ts +3 -0
  36. package/src/verifier/validateOptions.js +3 -1
  37. package/src/verifier/validateOptions.js.map +1 -1
  38. package/standalone/install.d.ts +1 -1
  39. package/standalone/install.js +1 -1
  40. package/ffi/libpact_ffi.so.gz +0 -0
  41. package/native/consumer.c +0 -210
  42. package/src/ffi/argumentMapper/index.d.ts +0 -2
  43. package/src/ffi/argumentMapper/index.js +0 -47
  44. package/src/ffi/argumentMapper/index.js.map +0 -1
  45. package/src/ffi/argumentMapper/types.d.ts +0 -8
  46. package/src/ffi/argumentMapper/types.js +0 -3
  47. package/src/ffi/argumentMapper/types.js.map +0 -1
  48. package/src/ffi/declarations.d.ts +0 -117
  49. package/src/ffi/declarations.js +0 -66
  50. package/src/ffi/declarations.js.map +0 -1
  51. package/src/ffi/internals/types.d.ts +0 -25
  52. package/src/ffi/internals/types.js +0 -3
  53. package/src/ffi/internals/types.js.map +0 -1
  54. package/src/verifier/arguments.d.ts +0 -13
  55. package/src/verifier/arguments.js +0 -89
  56. package/src/verifier/arguments.js.map +0 -1
package/ffi/pact_ffi.dll CHANGED
Binary file
Binary file
@@ -3,6 +3,58 @@
3
3
 
4
4
  using namespace Napi;
5
5
 
6
+ PactSpecification integerToSpecification(Napi::Env &env, uint32_t number) {
7
+ PactSpecification specification = PactSpecification::PactSpecification_V2;
8
+
9
+ switch(number) {
10
+ case 0:
11
+ specification = PactSpecification::PactSpecification_Unknown;
12
+ break;
13
+ case 1:
14
+ specification = PactSpecification::PactSpecification_V1;
15
+ break;
16
+ case 2:
17
+ specification = PactSpecification::PactSpecification_V1_1;
18
+ break;
19
+ case 3:
20
+ specification = PactSpecification::PactSpecification_V2;
21
+ break;
22
+ case 4:
23
+ specification = PactSpecification::PactSpecification_V3;
24
+ break;
25
+ case 5:
26
+ specification = PactSpecification::PactSpecification_V4;
27
+ break;
28
+ default:
29
+ std::string err = "Unable to parse pact specification: ";
30
+ err += number;
31
+
32
+ throw Napi::Error::New(env, err);
33
+ }
34
+
35
+ return specification;
36
+ }
37
+
38
+ InteractionPart integerToInteractionPart(Napi::Env &env, uint32_t number) {
39
+ InteractionPart part = InteractionPart::InteractionPart_Request;
40
+
41
+ switch(number) {
42
+ case 0:
43
+ part = InteractionPart::InteractionPart_Request;
44
+ break;
45
+ case 1:
46
+ part = InteractionPart::InteractionPart_Response;
47
+ break;
48
+ default:
49
+ std::string err = "Unable to parse pact interaction part: ";
50
+ err += number;
51
+
52
+ throw Napi::Error::New(env, err);
53
+ }
54
+
55
+ return part;
56
+ }
57
+
6
58
  /**
7
59
  * Fetch the in-memory logger buffer contents. This will only have any contents if the `buffer`
8
60
  * sink has been configured to log to. The contents will be allocated on the heap and will need
@@ -265,12 +317,12 @@ Napi::Value PactffiWritePactFile(const Napi::CallbackInfo& info) {
265
317
  }
266
318
 
267
319
  int32_t port = info[0].As<Napi::Number>().Int32Value();
268
- std::string dir = info[0].As<Napi::String>().Utf8Value();
269
- bool overwrite = info[0].As<Napi::Boolean>().Value();
320
+ std::string dir = info[1].As<Napi::String>().Utf8Value();
321
+ bool overwrite = info[2].As<Napi::Boolean>().Value();
270
322
 
271
- pactffi_write_pact_file(port, dir.c_str(), overwrite);
323
+ int32_t res = pactffi_write_pact_file(port, dir.c_str(), overwrite);
272
324
 
273
- return info.Env().Undefined();
325
+ return Number::New(env, res);
274
326
  }
275
327
 
276
328
  /**
@@ -455,7 +507,7 @@ Napi::Value PactffiGivenWithParam(const Napi::CallbackInfo& info) {
455
507
  InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
456
508
  std::string description = info[1].As<Napi::String>().Utf8Value();
457
509
  std::string name = info[2].As<Napi::String>().Utf8Value();
458
- std::string value = info[4].As<Napi::String>().Utf8Value();
510
+ std::string value = info[3].As<Napi::String>().Utf8Value();
459
511
 
460
512
  bool res = pactffi_given_with_param(interaction, description.c_str(), name.c_str(), value.c_str());
461
513
 
@@ -541,7 +593,7 @@ Napi::Value PactffiWithQueryParameter(const Napi::CallbackInfo& info) {
541
593
  InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
542
594
  std::string name = info[1].As<Napi::String>().Utf8Value();
543
595
  size_t index = info[2].As<Napi::Number>().Uint32Value();
544
- std::string value = info[2].As<Napi::String>().Utf8Value();
596
+ std::string value = info[3].As<Napi::String>().Utf8Value();
545
597
 
546
598
  bool res = pactffi_with_query_parameter(interaction, name.c_str(), index, value.c_str());
547
599
 
@@ -572,19 +624,20 @@ Napi::Value PactffiWithSpecification(const Napi::CallbackInfo& info) {
572
624
  }
573
625
 
574
626
  if (!info[1].IsNumber()) {
575
- throw Napi::Error::New(env, "PactffiWithSpecification(arg 1) expected a string");
627
+ throw Napi::Error::New(env, "PactffiWithSpecification(arg 1) expected a number");
576
628
  }
577
629
 
578
630
  PactHandle pact = info[0].As<Napi::Number>().Uint32Value();
579
- PactSpecification* specification = info[1].As<External<PactSpecification>>().Data();
580
- // Alternatively could just handle as ints (the rust code ensures the enum is layed out correctly) e.g.
581
- // uint32 specification = info[1].As<Napi::Number>().Uint32Value();
631
+ uint32_t specificationNumber = info[1].As<Napi::Number>().Uint32Value();
632
+ PactSpecification specification = integerToSpecification(env, specificationNumber);
582
633
 
583
- bool res = pactffi_with_specification(pact, *specification);
634
+ bool res = pactffi_with_specification(pact, specification);
584
635
 
585
636
  return Napi::Boolean::New(env, res);
586
637
  }
587
638
 
639
+
640
+
588
641
  /**
589
642
  * Sets the additional metadata on the Pact file. Common uses are to add the client library details such as the name and version
590
643
  * Returns false if the interaction or Pact can't be modified (i.e. the mock server for it has already started)
@@ -669,22 +722,22 @@ Napi::Value PactffiWithHeader(const Napi::CallbackInfo& info) {
669
722
  throw Napi::Error::New(env, "PactffiWithHeader(arg 2) expected a string");
670
723
  }
671
724
 
672
- if (!info[3].IsString()) {
673
- throw Napi::Error::New(env, "PactffiWithHeader(arg 3) expected a string");
725
+ if (!info[3].IsNumber()) {
726
+ throw Napi::Error::New(env, "PactffiWithHeader(arg 3) expected a number");
674
727
  }
675
728
 
676
729
  if (!info[4].IsString()) {
677
730
  throw Napi::Error::New(env, "PactffiWithHeader(arg 4) expected a string");
678
731
  }
679
732
 
680
- PactHandle pact = info[0].As<Napi::Number>().Uint32Value();
681
- InteractionPart* part = info[1].As<External<InteractionPart>>().Data();
682
- // uint32_t part = info[1].As<Napi::Number>().Uint32Value();
733
+ InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
734
+ uint32_t partNumber = info[1].As<Napi::Number>().Uint32Value();
735
+ InteractionPart part = integerToInteractionPart(env, partNumber);
683
736
  std::string name = info[2].As<Napi::String>().Utf8Value();
684
737
  size_t index = info[3].As<Napi::Number>().Uint32Value();
685
- std::string value = info[3].As<Napi::String>().Utf8Value();
738
+ std::string value = info[4].As<Napi::String>().Utf8Value();
686
739
 
687
- bool res = pactffi_with_header(pact, *part, name.c_str(), index, value.c_str());
740
+ bool res = pactffi_with_header(interaction, part, name.c_str(), index, value.c_str());
688
741
 
689
742
  return Napi::Boolean::New(env, res);
690
743
  }
@@ -729,13 +782,13 @@ Napi::Value PactffiWithBody(const Napi::CallbackInfo& info) {
729
782
  throw Napi::Error::New(env, "PactffiWithBody(arg 3) expected a string");
730
783
  }
731
784
 
732
- PactHandle pact = info[0].As<Napi::Number>().Uint32Value();
733
- InteractionPart* part = info[1].As<External<InteractionPart>>().Data();
734
- // uint32_t part = info[1].As<Napi::Number>().Uint32Value();
785
+ InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
786
+ uint32_t partNumber = info[1].As<Napi::Number>().Uint32Value();
787
+ InteractionPart part = integerToInteractionPart(env, partNumber);
735
788
  std::string contentType = info[2].As<Napi::String>().Utf8Value();
736
789
  std::string body = info[3].As<Napi::String>().Utf8Value();
737
790
 
738
- bool res = pactffi_with_body(pact, *part, contentType.c_str(), body.c_str());
791
+ bool res = pactffi_with_body(interaction, part, contentType.c_str(), body.c_str());
739
792
 
740
793
  return Napi::Boolean::New(env, res);
741
794
  }
@@ -787,14 +840,16 @@ Napi::Value PactffiWithBinaryFile(const Napi::CallbackInfo& info) {
787
840
  throw Napi::Error::New(env, "PactffiWithBinaryFile(arg 4) expected a number");
788
841
  }
789
842
 
790
- PactHandle pact = info[0].As<Napi::Number>().Uint32Value();
791
- InteractionPart* part = info[1].As<External<InteractionPart>>().Data();
843
+ InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
844
+ uint32_t partNumber = info[1].As<Napi::Number>().Uint32Value();
845
+ InteractionPart part = integerToInteractionPart(env, partNumber);
846
+
792
847
  // uint32_t part = info[1].As<Napi::Number>().Uint32Value();
793
848
  std::string contentType = info[2].As<Napi::String>().Utf8Value();
794
849
  Napi::Buffer<uint8_t> buffer = info[3].As<Napi::Buffer<uint8_t>>();
795
850
  size_t size = info[4].As<Napi::Number>().Uint32Value();
796
851
 
797
- bool res = pactffi_with_binary_file(pact, *part, contentType.c_str(), buffer.Data(), size);
852
+ bool res = pactffi_with_binary_file(interaction, part, contentType.c_str(), buffer.Data(), size);
798
853
 
799
854
  return Napi::Boolean::New(env, res);
800
855
  }
@@ -817,7 +872,7 @@ Napi::Value PactffiWithBinaryFile(const Napi::CallbackInfo& info) {
817
872
  * InteractionPart part,
818
873
  * const char *content_type,
819
874
  * const char *file,
820
- * const char *part_name);
875
+ * const char part_name);
821
876
  */
822
877
  Napi::Value PactffiWithMultipartFile(const Napi::CallbackInfo& info) {
823
878
  // return: bool
@@ -847,14 +902,15 @@ Napi::Value PactffiWithMultipartFile(const Napi::CallbackInfo& info) {
847
902
  throw Napi::Error::New(env, "PactffiWithMultipartFile(arg 4) expected a string");
848
903
  }
849
904
 
850
- PactHandle pact = info[0].As<Napi::Number>().Uint32Value();
851
- InteractionPart* part = info[1].As<External<InteractionPart>>().Data();
852
- // uint32_t part = info[1].As<Napi::Number>().Uint32Value();
905
+ InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
906
+ uint32_t partNumber = info[1].As<Napi::Number>().Uint32Value();
907
+ InteractionPart part = integerToInteractionPart(env, partNumber);
908
+
853
909
  std::string contentType = info[2].As<Napi::String>().Utf8Value();
854
910
  std::string file = info[3].As<Napi::String>().Utf8Value();
855
911
  std::string partName = info[4].As<Napi::String>().Utf8Value();
856
912
 
857
- StringResult res = pactffi_with_multipart_file(pact, *part, contentType.c_str(), file.c_str(), partName.c_str());
913
+ StringResult res = pactffi_with_multipart_file(interaction, part, contentType.c_str(), file.c_str(), partName.c_str());
858
914
 
859
915
  // TODO: this will also break the https://github.com/pact-foundation/pact-js-core/tree/feat/ffi-consumer/src/consumer branch
860
916
  // which expects a struct
@@ -886,8 +942,8 @@ Napi::Value PactffiResponseStatus(const Napi::CallbackInfo& info) {
886
942
  throw Napi::Error::New(env, "PactffiResponseStatus received < 2 arguments");
887
943
  }
888
944
 
889
- if (!info[0].IsString()) {
890
- throw Napi::Error::New(env, "PactffiResponseStatus(arg 0) expected a string");
945
+ if (!info[0].IsNumber()) {
946
+ throw Napi::Error::New(env, "PactffiResponseStatus(arg 0) expected a number");
891
947
  }
892
948
 
893
949
  if (!info[1].IsNumber()) {
@@ -895,7 +951,7 @@ Napi::Value PactffiResponseStatus(const Napi::CallbackInfo& info) {
895
951
  }
896
952
 
897
953
  InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
898
- unsigned short status = info[0].As<Napi::Number>().Uint32Value();
954
+ unsigned short status = info[1].As<Napi::Number>().Uint32Value();
899
955
 
900
956
  bool res = pactffi_response_status(interaction, status);
901
957
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pact-foundation/pact-core",
3
- "version": "13.4.1-beta.1",
3
+ "version": "13.4.1-beta.13",
4
4
  "description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",
5
5
  "main": "src/index.js",
6
6
  "homepage": "https://github.com/pact-foundation/pact-js-core#readme",
@@ -39,9 +39,9 @@
39
39
  "provider",
40
40
  "verifier"
41
41
  ],
42
- "author": "Michel Boudreau <michelboudreau@gmail.com> (codinghitchhiker.com)",
42
+ "author": "Matt Fellows <m@onegeek.com.au> (http://www.onegeek.com.au)",
43
43
  "contributors": [
44
- "Matt Fellows <m@onegeek.com.au> (http://www.onegeek.com.au)"
44
+ "Michel Boudreau <michelboudreau@gmail.com> (codinghitchhiker.com)"
45
45
  ],
46
46
  "license": "MIT",
47
47
  "bugs": {
@@ -57,15 +57,12 @@
57
57
  "chalk": "4.1.2",
58
58
  "check-types": "7.3.0",
59
59
  "cross-spawn": "7.0.3",
60
- "ffi-napi": "^4.0.3",
61
60
  "mkdirp": "1.0.0",
62
61
  "needle": "2.8.0",
63
62
  "node-addon-api": "^4.2.0",
64
63
  "pino": "6.13.1",
65
64
  "pino-pretty": "^6.0.0",
66
65
  "promise-timeout": "1.3.0",
67
- "ref-napi": "^3.0.3",
68
- "ref-struct-di": "^1.1.1",
69
66
  "rimraf": "2.6.2",
70
67
  "underscore": "1.12.1",
71
68
  "unixify": "1.0.0"
@@ -81,7 +78,6 @@
81
78
  "@types/cross-spawn": "^6.0.1",
82
79
  "@types/decompress": "^4.2.3",
83
80
  "@types/express": "4.11.1",
84
- "@types/ffi-napi": "^2.4.3",
85
81
  "@types/jest": "^27.0.2",
86
82
  "@types/mkdirp": "^0.5.2",
87
83
  "@types/mocha": "9.0.0",
@@ -96,6 +92,7 @@
96
92
  "@types/url-join": "^4.0.0",
97
93
  "@typescript-eslint/eslint-plugin": "^5.2.0",
98
94
  "@typescript-eslint/parser": "^5.2.0",
95
+ "axios": "^0.24.0",
99
96
  "basic-auth": "2.0.0",
100
97
  "body-parser": "1.18.2",
101
98
  "chai": "4.1.2",
@@ -106,10 +103,10 @@
106
103
  "eslint": "^8.1.0",
107
104
  "eslint-config-prettier": "^8.3.0",
108
105
  "express": "4.16.2",
106
+ "form-data": "^4.0.0",
109
107
  "jest": "^27.3.1",
110
108
  "mocha": "^9.1.3",
111
109
  "nodemon": "^2.0.4",
112
- "prebuildify": "^5.0.0",
113
110
  "prettier": "^2.3.0",
114
111
  "sinon": "9.2.4",
115
112
  "snyk": "^1.747.0",
@@ -121,7 +118,7 @@
121
118
  "scripts": {
122
119
  "clean": "rimraf '{src,test,bin,standalone}/**/*.{js,map,d.ts}' 'package.zip' '.tmp' 'tmp'",
123
120
  "lint": "eslint . --ext .ts --config .eslintrc",
124
- "prebuild": "npm run clean",
121
+ "prebuild": "npm run clean && bash script/download-libs.sh",
125
122
  "build": "tsc",
126
123
  "prerelease": "npm run snyk-protect",
127
124
  "release": "standard-version",
@@ -0,0 +1,255 @@
1
+ {
2
+ "consumer": {
3
+ "name": "foo-consumer"
4
+ },
5
+ "interactions": [
6
+ {
7
+ "description": "a request to create a dog with binary data",
8
+ "providerStates": [
9
+ {
10
+ "name": "fido exists"
11
+ }
12
+ ],
13
+ "request": {
14
+ "body": "H4sIAAAAAAAAEyvJyCxWAKLEPIXUvOT8lNQUheKSosy8dADqFSK8GQAAAA==",
15
+ "headers": {
16
+ "Content-Type": "application/octet-stream",
17
+ "x-special-header": "header"
18
+ },
19
+ "matchingRules": {
20
+ "body": {
21
+ "$": {
22
+ "combine": "AND",
23
+ "matchers": [
24
+ {
25
+ "match": "contentType",
26
+ "value": "application/gzip"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ "header": {},
32
+ "query": {}
33
+ },
34
+ "method": "POST",
35
+ "path": "/dogs/1234",
36
+ "query": {
37
+ "someParam": [
38
+ "someValue"
39
+ ]
40
+ }
41
+ },
42
+ "response": {
43
+ "body": {
44
+ "age": 23,
45
+ "alive": true,
46
+ "name": "fido"
47
+ },
48
+ "headers": {
49
+ "Content-Type": "application/json",
50
+ "x-special-response-header": "header"
51
+ },
52
+ "matchingRules": {
53
+ "body": {
54
+ "$.age": {
55
+ "combine": "AND",
56
+ "matchers": [
57
+ {
58
+ "match": "type"
59
+ }
60
+ ]
61
+ },
62
+ "$.alive": {
63
+ "combine": "AND",
64
+ "matchers": [
65
+ {
66
+ "match": "type"
67
+ }
68
+ ]
69
+ },
70
+ "$.name": {
71
+ "combine": "AND",
72
+ "matchers": [
73
+ {
74
+ "match": "type"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ "header": {}
80
+ },
81
+ "status": 200
82
+ }
83
+ },
84
+ {
85
+ "description": "a request to get a create with JSON data",
86
+ "providerStates": [
87
+ {
88
+ "name": "fido exists"
89
+ }
90
+ ],
91
+ "request": {
92
+ "headers": {
93
+ "x-special-header": "header"
94
+ },
95
+ "method": "POST",
96
+ "path": "/dogs/1234",
97
+ "query": {
98
+ "someParam": [
99
+ "someValue"
100
+ ]
101
+ }
102
+ },
103
+ "response": {
104
+ "body": {
105
+ "age": 23,
106
+ "alive": true,
107
+ "name": "fido"
108
+ },
109
+ "headers": {
110
+ "Content-Type": "application/json",
111
+ "x-special-response-header": "header"
112
+ },
113
+ "matchingRules": {
114
+ "body": {
115
+ "$.age": {
116
+ "combine": "AND",
117
+ "matchers": [
118
+ {
119
+ "match": "type"
120
+ }
121
+ ]
122
+ },
123
+ "$.alive": {
124
+ "combine": "AND",
125
+ "matchers": [
126
+ {
127
+ "match": "type"
128
+ }
129
+ ]
130
+ },
131
+ "$.id": {
132
+ "combine": "AND",
133
+ "matchers": [
134
+ {
135
+ "match": "type"
136
+ }
137
+ ]
138
+ },
139
+ "$.name": {
140
+ "combine": "AND",
141
+ "matchers": [
142
+ {
143
+ "match": "type"
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ "header": {}
149
+ },
150
+ "status": 200
151
+ }
152
+ },
153
+ {
154
+ "description": "a request to get a dog with multipart data",
155
+ "providerStates": [
156
+ {
157
+ "name": "fido exists"
158
+ }
159
+ ],
160
+ "request": {
161
+ "body": "--UYYelOPUUVAA5RHD\r\nContent-Disposition: form-data; name=\"my_file\"; filename=\"monkeypatch.rb\"\r\nContent-Type: application/octet-stream\r\n\r\ndef Filelock(lockname, options = {}, &block)\n puts \"Opening file without filelock\"\n File.open(lockname, File::RDWR|File::CREAT, 0644) do |file|\n Timeout::timeout(options.fetch(:timeout, 60), Filelock::ExecTimeout) { yield file }\n end\nend\n\r\n--UYYelOPUUVAA5RHD--\r\n",
162
+ "headers": {
163
+ "Content-Type": "multipart/form-data; boundary=UYYelOPUUVAA5RHD",
164
+ "x-special-header": "header"
165
+ },
166
+ "matchingRules": {
167
+ "body": {
168
+ "$.my_file": {
169
+ "combine": "AND",
170
+ "matchers": [
171
+ {
172
+ "match": "contentType",
173
+ "value": "text/plain"
174
+ }
175
+ ]
176
+ }
177
+ },
178
+ "header": {
179
+ "Content-Type": {
180
+ "combine": "AND",
181
+ "matchers": [
182
+ {
183
+ "match": "regex",
184
+ "regex": "multipart/form-data;(\\s*charset=[^;]*;)?\\s*boundary=.*"
185
+ }
186
+ ]
187
+ }
188
+ },
189
+ "query": {}
190
+ },
191
+ "method": "POST",
192
+ "path": "/dogs/1234",
193
+ "query": {
194
+ "someParam": [
195
+ "someValue"
196
+ ]
197
+ }
198
+ },
199
+ "response": {
200
+ "body": {
201
+ "age": 23,
202
+ "alive": true,
203
+ "name": "fido"
204
+ },
205
+ "headers": {
206
+ "Content-Type": "application/json",
207
+ "x-special-header": "header"
208
+ },
209
+ "matchingRules": {
210
+ "body": {
211
+ "$.age": {
212
+ "combine": "AND",
213
+ "matchers": [
214
+ {
215
+ "match": "type"
216
+ }
217
+ ]
218
+ },
219
+ "$.alive": {
220
+ "combine": "AND",
221
+ "matchers": [
222
+ {
223
+ "match": "type"
224
+ }
225
+ ]
226
+ },
227
+ "$.name": {
228
+ "combine": "AND",
229
+ "matchers": [
230
+ {
231
+ "match": "type"
232
+ }
233
+ ]
234
+ }
235
+ },
236
+ "header": {}
237
+ },
238
+ "status": 200
239
+ }
240
+ }
241
+ ],
242
+ "metadata": {
243
+ "pactRust": {
244
+ "ffi": "0.2.2",
245
+ "mockserver": "0.8.7",
246
+ "models": "0.2.7"
247
+ },
248
+ "pactSpecification": {
249
+ "version": "3.0.0"
250
+ }
251
+ },
252
+ "provider": {
253
+ "name": "bar-provider"
254
+ }
255
+ }
@@ -1,3 +1,4 @@
1
1
  import { FfiSpecificationVersion } from '../ffi/types';
2
2
  import { ConsumerPact } from './types';
3
3
  export declare const makeConsumerPact: (consumer: string, provider: string, version?: FfiSpecificationVersion, logLevel?: import("..").LogLevel) => ConsumerPact;
4
+ export * from './types';