@pactflow/openapi-pact-comparator 1.9.0 → 1.11.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/dist/cli.cjs CHANGED
@@ -4321,7 +4321,7 @@ const {
4321
4321
  Help,
4322
4322
  } = commander;
4323
4323
 
4324
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
4324
+ /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
4325
4325
  function isNothing(subject) {
4326
4326
  return (typeof subject === 'undefined') || (subject === null);
4327
4327
  }
@@ -5532,6 +5532,22 @@ function charFromCodepoint(c) {
5532
5532
  );
5533
5533
  }
5534
5534
 
5535
+ // set a property of a literal object, while protecting against prototype pollution,
5536
+ // see https://github.com/nodeca/js-yaml/issues/164 for more details
5537
+ function setProperty(object, key, value) {
5538
+ // used for this specific key only because Object.defineProperty is slow
5539
+ if (key === '__proto__') {
5540
+ Object.defineProperty(object, key, {
5541
+ configurable: true,
5542
+ enumerable: true,
5543
+ writable: true,
5544
+ value: value
5545
+ });
5546
+ } else {
5547
+ object[key] = value;
5548
+ }
5549
+ }
5550
+
5535
5551
  var simpleEscapeCheck = new Array(256); // integer, for fast access
5536
5552
  var simpleEscapeMap = new Array(256);
5537
5553
  for (var i = 0; i < 256; i++) {
@@ -5710,7 +5726,7 @@ function mergeMappings(state, destination, source, overridableKeys) {
5710
5726
  key = sourceKeys[index];
5711
5727
 
5712
5728
  if (!_hasOwnProperty$1.call(destination, key)) {
5713
- destination[key] = source[key];
5729
+ setProperty(destination, key, source[key]);
5714
5730
  overridableKeys[key] = true;
5715
5731
  }
5716
5732
  }
@@ -5770,17 +5786,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
5770
5786
  throwError(state, 'duplicated mapping key');
5771
5787
  }
5772
5788
 
5773
- // used for this specific key only because Object.defineProperty is slow
5774
- if (keyNode === '__proto__') {
5775
- Object.defineProperty(_result, keyNode, {
5776
- configurable: true,
5777
- enumerable: true,
5778
- writable: true,
5779
- value: valueNode
5780
- });
5781
- } else {
5782
- _result[keyNode] = valueNode;
5783
- }
5789
+ setProperty(_result, keyNode, valueNode);
5784
5790
  delete overridableKeys[keyNode];
5785
5791
  }
5786
5792
 
@@ -16287,11 +16293,11 @@ function* compareResBody(ajv, route, interaction, index, config) {
16287
16293
  };
16288
16294
  }
16289
16295
  if (response) {
16290
- const availableResponseContentTypes = operation.produces || Object.keys(response.content || {});
16296
+ const dereferencedResponse = dereferenceOas(response, oas);
16297
+ const availableResponseContentTypes = operation.produces || Object.keys(dereferencedResponse.content || {});
16291
16298
  const contentType = findMatchingType(requestHeaders.get("accept") || DEFAULT_CONTENT_TYPE, availableResponseContentTypes) ||
16292
16299
  availableResponseContentTypes[0] ||
16293
16300
  DEFAULT_CONTENT_TYPE;
16294
- const dereferencedResponse = dereferenceOas(response, oas);
16295
16301
  const schema = dereferencedResponse?.schema ||
16296
16302
  getByContentType(dereferencedResponse.content || {}, contentType)?.schema;
16297
16303
  const value = body;
@@ -27739,6 +27745,8 @@ const DEFAULT_CONFIG = new Map([
27739
27745
  // SMV casts "[object Object]" queries as objects for validation purposes,
27740
27746
  // rather than flag it as a string - suggesting a broken Pact file
27741
27747
  ["cast-objects-in-pact", quirks],
27748
+ // OPC (like SMV) is case sensitive by default, according to RFC3986
27749
+ ["case-insensitive", false],
27742
27750
  // SMV didn't support multipart/form-data
27743
27751
  ["disable-multipart-formdata", quirks],
27744
27752
  // SMV ignores duplicate slashes in OAS
@@ -32425,6 +32433,7 @@ const SUPPORTED_METHODS = [
32425
32433
  ];
32426
32434
  function setupRouter(oas, config) {
32427
32435
  const router = Router({
32436
+ caseSensitive: !config.get("case-insensitive"),
32428
32437
  ignoreDuplicateSlashes: config.get("ignore-duplicate-slashes"),
32429
32438
  ignoreTrailingSlash: config.get("ignore-trailing-slash"),
32430
32439
  maxParamLength: 2048, // default = 100
@@ -32437,6 +32446,7 @@ function setupRouter(oas, config) {
32437
32446
  "";
32438
32447
  const path = basePath +
32439
32448
  oasPath
32449
+ .replaceAll(":", "::")
32440
32450
  .replaceAll(/{.*?}/g, cleanPathParameter)
32441
32451
  .replaceAll(/{([.;]?)([^*]+?)\*?}/g, "$1:$2(.+)");
32442
32452
  for (const method in oas.paths[oasPath]) {
@@ -32557,7 +32567,7 @@ class Comparator {
32557
32567
  }
32558
32568
  }
32559
32569
 
32560
- var version = "1.9.0";
32570
+ var version = "1.11.0";
32561
32571
  var packageJson = {
32562
32572
  version: version};
32563
32573