@pactflow/openapi-pact-comparator 1.6.1 → 1.7.1
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 +412 -83
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +371 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +371 -43
- package/dist/index.mjs.map +1 -1
- package/dist/src/documents/pact.d.ts +2 -0
- package/dist/src/transform/flattenAllOf.d.ts +2 -0
- package/dist/src/transform/index.d.ts +0 -1
- package/package.json +17 -17
- package/dist/src/transform/requestSchema.d.ts +0 -2
package/dist/cli.cjs
CHANGED
|
@@ -110,7 +110,7 @@ function requireArgument () {
|
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
if (this._name.
|
|
113
|
+
if (this._name.endsWith('...')) {
|
|
114
114
|
this.variadic = true;
|
|
115
115
|
this._name = this._name.slice(0, -3);
|
|
116
116
|
}
|
|
@@ -130,12 +130,13 @@ function requireArgument () {
|
|
|
130
130
|
* @package
|
|
131
131
|
*/
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
_collectValue(value, previous) {
|
|
134
134
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
135
135
|
return [value];
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
previous.push(value);
|
|
139
|
+
return previous;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
/**
|
|
@@ -180,7 +181,7 @@ function requireArgument () {
|
|
|
180
181
|
);
|
|
181
182
|
}
|
|
182
183
|
if (this.variadic) {
|
|
183
|
-
return this.
|
|
184
|
+
return this._collectValue(arg, previous);
|
|
184
185
|
}
|
|
185
186
|
return arg;
|
|
186
187
|
};
|
|
@@ -1157,12 +1158,13 @@ function requireOption () {
|
|
|
1157
1158
|
* @package
|
|
1158
1159
|
*/
|
|
1159
1160
|
|
|
1160
|
-
|
|
1161
|
+
_collectValue(value, previous) {
|
|
1161
1162
|
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
1162
1163
|
return [value];
|
|
1163
1164
|
}
|
|
1164
1165
|
|
|
1165
|
-
|
|
1166
|
+
previous.push(value);
|
|
1167
|
+
return previous;
|
|
1166
1168
|
}
|
|
1167
1169
|
|
|
1168
1170
|
/**
|
|
@@ -1181,7 +1183,7 @@ function requireOption () {
|
|
|
1181
1183
|
);
|
|
1182
1184
|
}
|
|
1183
1185
|
if (this.variadic) {
|
|
1184
|
-
return this.
|
|
1186
|
+
return this._collectValue(arg, previous);
|
|
1185
1187
|
}
|
|
1186
1188
|
return arg;
|
|
1187
1189
|
};
|
|
@@ -1738,11 +1740,10 @@ function requireCommand () {
|
|
|
1738
1740
|
configureOutput(configuration) {
|
|
1739
1741
|
if (configuration === undefined) return this._outputConfiguration;
|
|
1740
1742
|
|
|
1741
|
-
this._outputConfiguration =
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
);
|
|
1743
|
+
this._outputConfiguration = {
|
|
1744
|
+
...this._outputConfiguration,
|
|
1745
|
+
...configuration,
|
|
1746
|
+
};
|
|
1746
1747
|
return this;
|
|
1747
1748
|
}
|
|
1748
1749
|
|
|
@@ -1868,7 +1869,7 @@ function requireCommand () {
|
|
|
1868
1869
|
*/
|
|
1869
1870
|
addArgument(argument) {
|
|
1870
1871
|
const previousArgument = this.registeredArguments.slice(-1)[0];
|
|
1871
|
-
if (previousArgument
|
|
1872
|
+
if (previousArgument?.variadic) {
|
|
1872
1873
|
throw new Error(
|
|
1873
1874
|
`only the last argument can be variadic '${previousArgument.name()}'`,
|
|
1874
1875
|
);
|
|
@@ -2193,7 +2194,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2193
2194
|
if (val !== null && option.parseArg) {
|
|
2194
2195
|
val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
2195
2196
|
} else if (val !== null && option.variadic) {
|
|
2196
|
-
val = option.
|
|
2197
|
+
val = option._collectValue(val, oldValue);
|
|
2197
2198
|
}
|
|
2198
2199
|
|
|
2199
2200
|
// Fill-in appropriate missing values. Long winded but easy to follow.
|
|
@@ -2972,7 +2973,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2972
2973
|
|
|
2973
2974
|
_chainOrCall(promise, fn) {
|
|
2974
2975
|
// thenable
|
|
2975
|
-
if (promise
|
|
2976
|
+
if (promise?.then && typeof promise.then === 'function') {
|
|
2976
2977
|
// already have a promise, chain callback
|
|
2977
2978
|
return promise.then(() => fn());
|
|
2978
2979
|
}
|
|
@@ -3103,7 +3104,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3103
3104
|
promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');
|
|
3104
3105
|
return promiseChain;
|
|
3105
3106
|
}
|
|
3106
|
-
if (this.parent
|
|
3107
|
+
if (this.parent?.listenerCount(commandEvent)) {
|
|
3107
3108
|
checkForUnknownOptions();
|
|
3108
3109
|
this._processArguments();
|
|
3109
3110
|
this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
@@ -3233,15 +3234,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3233
3234
|
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
3234
3235
|
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
3235
3236
|
*
|
|
3236
|
-
* @param {string[]}
|
|
3237
|
+
* @param {string[]} args
|
|
3237
3238
|
* @return {{operands: string[], unknown: string[]}}
|
|
3238
3239
|
*/
|
|
3239
3240
|
|
|
3240
|
-
parseOptions(
|
|
3241
|
+
parseOptions(args) {
|
|
3241
3242
|
const operands = []; // operands, not options or values
|
|
3242
3243
|
const unknown = []; // first unknown option and remaining unknown args
|
|
3243
3244
|
let dest = operands;
|
|
3244
|
-
const args = argv.slice();
|
|
3245
3245
|
|
|
3246
3246
|
function maybeOption(arg) {
|
|
3247
3247
|
return arg.length > 1 && arg[0] === '-';
|
|
@@ -3249,7 +3249,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3249
3249
|
|
|
3250
3250
|
const negativeNumberArg = (arg) => {
|
|
3251
3251
|
// return false if not a negative number
|
|
3252
|
-
if (
|
|
3252
|
+
if (!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg)) return false;
|
|
3253
3253
|
// negative number is ok unless digit used as an option in command hierarchy
|
|
3254
3254
|
return !this._getCommandAndAncestors().some((cmd) =>
|
|
3255
3255
|
cmd.options
|
|
@@ -3260,13 +3260,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3260
3260
|
|
|
3261
3261
|
// parse options
|
|
3262
3262
|
let activeVariadicOption = null;
|
|
3263
|
-
|
|
3264
|
-
|
|
3263
|
+
let activeGroup = null; // working through group of short options, like -abc
|
|
3264
|
+
let i = 0;
|
|
3265
|
+
while (i < args.length || activeGroup) {
|
|
3266
|
+
const arg = activeGroup ?? args[i++];
|
|
3267
|
+
activeGroup = null;
|
|
3265
3268
|
|
|
3266
3269
|
// literal
|
|
3267
3270
|
if (arg === '--') {
|
|
3268
3271
|
if (dest === unknown) dest.push(arg);
|
|
3269
|
-
dest.push(...args);
|
|
3272
|
+
dest.push(...args.slice(i));
|
|
3270
3273
|
break;
|
|
3271
3274
|
}
|
|
3272
3275
|
|
|
@@ -3284,17 +3287,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3284
3287
|
// recognised option, call listener to assign value with possible custom processing
|
|
3285
3288
|
if (option) {
|
|
3286
3289
|
if (option.required) {
|
|
3287
|
-
const value = args
|
|
3290
|
+
const value = args[i++];
|
|
3288
3291
|
if (value === undefined) this.optionMissingArgument(option);
|
|
3289
3292
|
this.emit(`option:${option.name()}`, value);
|
|
3290
3293
|
} else if (option.optional) {
|
|
3291
3294
|
let value = null;
|
|
3292
3295
|
// historical behaviour is optional value is following arg unless an option
|
|
3293
3296
|
if (
|
|
3294
|
-
args.length
|
|
3295
|
-
(!maybeOption(args[
|
|
3297
|
+
i < args.length &&
|
|
3298
|
+
(!maybeOption(args[i]) || negativeNumberArg(args[i]))
|
|
3296
3299
|
) {
|
|
3297
|
-
value = args
|
|
3300
|
+
value = args[i++];
|
|
3298
3301
|
}
|
|
3299
3302
|
this.emit(`option:${option.name()}`, value);
|
|
3300
3303
|
} else {
|
|
@@ -3317,9 +3320,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3317
3320
|
// option with value following in same argument
|
|
3318
3321
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
3319
3322
|
} else {
|
|
3320
|
-
// boolean option
|
|
3323
|
+
// boolean option
|
|
3321
3324
|
this.emit(`option:${option.name()}`);
|
|
3322
|
-
|
|
3325
|
+
// remove the processed option and keep processing group
|
|
3326
|
+
activeGroup = `-${arg.slice(2)}`;
|
|
3323
3327
|
}
|
|
3324
3328
|
continue;
|
|
3325
3329
|
}
|
|
@@ -3356,26 +3360,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3356
3360
|
) {
|
|
3357
3361
|
if (this._findCommand(arg)) {
|
|
3358
3362
|
operands.push(arg);
|
|
3359
|
-
|
|
3363
|
+
unknown.push(...args.slice(i));
|
|
3360
3364
|
break;
|
|
3361
3365
|
} else if (
|
|
3362
3366
|
this._getHelpCommand() &&
|
|
3363
3367
|
arg === this._getHelpCommand().name()
|
|
3364
3368
|
) {
|
|
3365
|
-
operands.push(arg);
|
|
3366
|
-
if (args.length > 0) operands.push(...args);
|
|
3369
|
+
operands.push(arg, ...args.slice(i));
|
|
3367
3370
|
break;
|
|
3368
3371
|
} else if (this._defaultCommandName) {
|
|
3369
|
-
unknown.push(arg);
|
|
3370
|
-
if (args.length > 0) unknown.push(...args);
|
|
3372
|
+
unknown.push(arg, ...args.slice(i));
|
|
3371
3373
|
break;
|
|
3372
3374
|
}
|
|
3373
3375
|
}
|
|
3374
3376
|
|
|
3375
3377
|
// If using passThroughOptions, stop processing options at first command-argument.
|
|
3376
3378
|
if (this._passThroughOptions) {
|
|
3377
|
-
dest.push(arg);
|
|
3378
|
-
if (args.length > 0) dest.push(...args);
|
|
3379
|
+
dest.push(arg, ...args.slice(i));
|
|
3379
3380
|
break;
|
|
3380
3381
|
}
|
|
3381
3382
|
|
|
@@ -5152,7 +5153,7 @@ function resolveYamlMerge(data) {
|
|
|
5152
5153
|
return data === '<<' || data === null;
|
|
5153
5154
|
}
|
|
5154
5155
|
|
|
5155
|
-
var merge = new type$b('tag:yaml.org,2002:merge', {
|
|
5156
|
+
var merge$1 = new type$b('tag:yaml.org,2002:merge', {
|
|
5156
5157
|
kind: 'scalar',
|
|
5157
5158
|
resolve: resolveYamlMerge
|
|
5158
5159
|
});
|
|
@@ -5401,7 +5402,7 @@ var set$1 = new type$b('tag:yaml.org,2002:set', {
|
|
|
5401
5402
|
var _default = core$2.extend({
|
|
5402
5403
|
implicit: [
|
|
5403
5404
|
timestamp,
|
|
5404
|
-
merge
|
|
5405
|
+
merge$1
|
|
5405
5406
|
],
|
|
5406
5407
|
explicit: [
|
|
5407
5408
|
binary,
|
|
@@ -8140,7 +8141,7 @@ var types$3 = {
|
|
|
8140
8141
|
timestamp: timestamp,
|
|
8141
8142
|
bool: bool,
|
|
8142
8143
|
int: int,
|
|
8143
|
-
merge: merge,
|
|
8144
|
+
merge: merge$1,
|
|
8144
8145
|
omap: omap,
|
|
8145
8146
|
seq: seq,
|
|
8146
8147
|
str: str
|
|
@@ -9047,6 +9048,18 @@ function overRest(func, start, transform) {
|
|
|
9047
9048
|
};
|
|
9048
9049
|
}
|
|
9049
9050
|
|
|
9051
|
+
/**
|
|
9052
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
9053
|
+
*
|
|
9054
|
+
* @private
|
|
9055
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
9056
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
9057
|
+
* @returns {Function} Returns the new function.
|
|
9058
|
+
*/
|
|
9059
|
+
function baseRest(func, start) {
|
|
9060
|
+
return setToString(overRest(func, start, identity), func + '');
|
|
9061
|
+
}
|
|
9062
|
+
|
|
9050
9063
|
/** Used as references for various `Number` constants. */
|
|
9051
9064
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
9052
9065
|
|
|
@@ -9110,6 +9123,63 @@ function isArrayLike(value) {
|
|
|
9110
9123
|
return value != null && isLength(value.length) && !isFunction(value);
|
|
9111
9124
|
}
|
|
9112
9125
|
|
|
9126
|
+
/**
|
|
9127
|
+
* Checks if the given arguments are from an iteratee call.
|
|
9128
|
+
*
|
|
9129
|
+
* @private
|
|
9130
|
+
* @param {*} value The potential iteratee value argument.
|
|
9131
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
9132
|
+
* @param {*} object The potential iteratee object argument.
|
|
9133
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
9134
|
+
* else `false`.
|
|
9135
|
+
*/
|
|
9136
|
+
function isIterateeCall(value, index, object) {
|
|
9137
|
+
if (!isObject(object)) {
|
|
9138
|
+
return false;
|
|
9139
|
+
}
|
|
9140
|
+
var type = typeof index;
|
|
9141
|
+
if (type == 'number'
|
|
9142
|
+
? (isArrayLike(object) && isIndex(index, object.length))
|
|
9143
|
+
: (type == 'string' && index in object)
|
|
9144
|
+
) {
|
|
9145
|
+
return eq(object[index], value);
|
|
9146
|
+
}
|
|
9147
|
+
return false;
|
|
9148
|
+
}
|
|
9149
|
+
|
|
9150
|
+
/**
|
|
9151
|
+
* Creates a function like `_.assign`.
|
|
9152
|
+
*
|
|
9153
|
+
* @private
|
|
9154
|
+
* @param {Function} assigner The function to assign values.
|
|
9155
|
+
* @returns {Function} Returns the new assigner function.
|
|
9156
|
+
*/
|
|
9157
|
+
function createAssigner(assigner) {
|
|
9158
|
+
return baseRest(function(object, sources) {
|
|
9159
|
+
var index = -1,
|
|
9160
|
+
length = sources.length,
|
|
9161
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
9162
|
+
guard = length > 2 ? sources[2] : undefined;
|
|
9163
|
+
|
|
9164
|
+
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
|
9165
|
+
? (length--, customizer)
|
|
9166
|
+
: undefined;
|
|
9167
|
+
|
|
9168
|
+
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
9169
|
+
customizer = length < 3 ? undefined : customizer;
|
|
9170
|
+
length = 1;
|
|
9171
|
+
}
|
|
9172
|
+
object = Object(object);
|
|
9173
|
+
while (++index < length) {
|
|
9174
|
+
var source = sources[index];
|
|
9175
|
+
if (source) {
|
|
9176
|
+
assigner(object, source, index, customizer);
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
return object;
|
|
9180
|
+
});
|
|
9181
|
+
}
|
|
9182
|
+
|
|
9113
9183
|
/** Used for built-in method references. */
|
|
9114
9184
|
var objectProto$9 = Object.prototype;
|
|
9115
9185
|
|
|
@@ -11341,6 +11411,209 @@ function createBaseEach(eachFunc, fromRight) {
|
|
|
11341
11411
|
*/
|
|
11342
11412
|
var baseEach = createBaseEach(baseForOwn);
|
|
11343
11413
|
|
|
11414
|
+
/**
|
|
11415
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
11416
|
+
* `undefined` values.
|
|
11417
|
+
*
|
|
11418
|
+
* @private
|
|
11419
|
+
* @param {Object} object The object to modify.
|
|
11420
|
+
* @param {string} key The key of the property to assign.
|
|
11421
|
+
* @param {*} value The value to assign.
|
|
11422
|
+
*/
|
|
11423
|
+
function assignMergeValue(object, key, value) {
|
|
11424
|
+
if ((value !== undefined && !eq(object[key], value)) ||
|
|
11425
|
+
(value === undefined && !(key in object))) {
|
|
11426
|
+
baseAssignValue(object, key, value);
|
|
11427
|
+
}
|
|
11428
|
+
}
|
|
11429
|
+
|
|
11430
|
+
/**
|
|
11431
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
11432
|
+
* is an object.
|
|
11433
|
+
*
|
|
11434
|
+
* @static
|
|
11435
|
+
* @memberOf _
|
|
11436
|
+
* @since 4.0.0
|
|
11437
|
+
* @category Lang
|
|
11438
|
+
* @param {*} value The value to check.
|
|
11439
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
11440
|
+
* else `false`.
|
|
11441
|
+
* @example
|
|
11442
|
+
*
|
|
11443
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
11444
|
+
* // => true
|
|
11445
|
+
*
|
|
11446
|
+
* _.isArrayLikeObject(document.body.children);
|
|
11447
|
+
* // => true
|
|
11448
|
+
*
|
|
11449
|
+
* _.isArrayLikeObject('abc');
|
|
11450
|
+
* // => false
|
|
11451
|
+
*
|
|
11452
|
+
* _.isArrayLikeObject(_.noop);
|
|
11453
|
+
* // => false
|
|
11454
|
+
*/
|
|
11455
|
+
function isArrayLikeObject(value) {
|
|
11456
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
11457
|
+
}
|
|
11458
|
+
|
|
11459
|
+
/**
|
|
11460
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
11461
|
+
*
|
|
11462
|
+
* @private
|
|
11463
|
+
* @param {Object} object The object to query.
|
|
11464
|
+
* @param {string} key The key of the property to get.
|
|
11465
|
+
* @returns {*} Returns the property value.
|
|
11466
|
+
*/
|
|
11467
|
+
function safeGet(object, key) {
|
|
11468
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
11469
|
+
return;
|
|
11470
|
+
}
|
|
11471
|
+
|
|
11472
|
+
if (key == '__proto__') {
|
|
11473
|
+
return;
|
|
11474
|
+
}
|
|
11475
|
+
|
|
11476
|
+
return object[key];
|
|
11477
|
+
}
|
|
11478
|
+
|
|
11479
|
+
/**
|
|
11480
|
+
* Converts `value` to a plain object flattening inherited enumerable string
|
|
11481
|
+
* keyed properties of `value` to own properties of the plain object.
|
|
11482
|
+
*
|
|
11483
|
+
* @static
|
|
11484
|
+
* @memberOf _
|
|
11485
|
+
* @since 3.0.0
|
|
11486
|
+
* @category Lang
|
|
11487
|
+
* @param {*} value The value to convert.
|
|
11488
|
+
* @returns {Object} Returns the converted plain object.
|
|
11489
|
+
* @example
|
|
11490
|
+
*
|
|
11491
|
+
* function Foo() {
|
|
11492
|
+
* this.b = 2;
|
|
11493
|
+
* }
|
|
11494
|
+
*
|
|
11495
|
+
* Foo.prototype.c = 3;
|
|
11496
|
+
*
|
|
11497
|
+
* _.assign({ 'a': 1 }, new Foo);
|
|
11498
|
+
* // => { 'a': 1, 'b': 2 }
|
|
11499
|
+
*
|
|
11500
|
+
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
11501
|
+
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
11502
|
+
*/
|
|
11503
|
+
function toPlainObject(value) {
|
|
11504
|
+
return copyObject(value, keysIn(value));
|
|
11505
|
+
}
|
|
11506
|
+
|
|
11507
|
+
/**
|
|
11508
|
+
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
11509
|
+
* deep merges and tracks traversed objects enabling objects with circular
|
|
11510
|
+
* references to be merged.
|
|
11511
|
+
*
|
|
11512
|
+
* @private
|
|
11513
|
+
* @param {Object} object The destination object.
|
|
11514
|
+
* @param {Object} source The source object.
|
|
11515
|
+
* @param {string} key The key of the value to merge.
|
|
11516
|
+
* @param {number} srcIndex The index of `source`.
|
|
11517
|
+
* @param {Function} mergeFunc The function to merge values.
|
|
11518
|
+
* @param {Function} [customizer] The function to customize assigned values.
|
|
11519
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
11520
|
+
* counterparts.
|
|
11521
|
+
*/
|
|
11522
|
+
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
11523
|
+
var objValue = safeGet(object, key),
|
|
11524
|
+
srcValue = safeGet(source, key),
|
|
11525
|
+
stacked = stack.get(srcValue);
|
|
11526
|
+
|
|
11527
|
+
if (stacked) {
|
|
11528
|
+
assignMergeValue(object, key, stacked);
|
|
11529
|
+
return;
|
|
11530
|
+
}
|
|
11531
|
+
var newValue = customizer
|
|
11532
|
+
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
11533
|
+
: undefined;
|
|
11534
|
+
|
|
11535
|
+
var isCommon = newValue === undefined;
|
|
11536
|
+
|
|
11537
|
+
if (isCommon) {
|
|
11538
|
+
var isArr = isArray(srcValue),
|
|
11539
|
+
isBuff = !isArr && isBuffer(srcValue),
|
|
11540
|
+
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
11541
|
+
|
|
11542
|
+
newValue = srcValue;
|
|
11543
|
+
if (isArr || isBuff || isTyped) {
|
|
11544
|
+
if (isArray(objValue)) {
|
|
11545
|
+
newValue = objValue;
|
|
11546
|
+
}
|
|
11547
|
+
else if (isArrayLikeObject(objValue)) {
|
|
11548
|
+
newValue = copyArray(objValue);
|
|
11549
|
+
}
|
|
11550
|
+
else if (isBuff) {
|
|
11551
|
+
isCommon = false;
|
|
11552
|
+
newValue = cloneBuffer(srcValue, true);
|
|
11553
|
+
}
|
|
11554
|
+
else if (isTyped) {
|
|
11555
|
+
isCommon = false;
|
|
11556
|
+
newValue = cloneTypedArray(srcValue, true);
|
|
11557
|
+
}
|
|
11558
|
+
else {
|
|
11559
|
+
newValue = [];
|
|
11560
|
+
}
|
|
11561
|
+
}
|
|
11562
|
+
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
11563
|
+
newValue = objValue;
|
|
11564
|
+
if (isArguments(objValue)) {
|
|
11565
|
+
newValue = toPlainObject(objValue);
|
|
11566
|
+
}
|
|
11567
|
+
else if (!isObject(objValue) || isFunction(objValue)) {
|
|
11568
|
+
newValue = initCloneObject(srcValue);
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11571
|
+
else {
|
|
11572
|
+
isCommon = false;
|
|
11573
|
+
}
|
|
11574
|
+
}
|
|
11575
|
+
if (isCommon) {
|
|
11576
|
+
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
11577
|
+
stack.set(srcValue, newValue);
|
|
11578
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
11579
|
+
stack['delete'](srcValue);
|
|
11580
|
+
}
|
|
11581
|
+
assignMergeValue(object, key, newValue);
|
|
11582
|
+
}
|
|
11583
|
+
|
|
11584
|
+
/**
|
|
11585
|
+
* The base implementation of `_.merge` without support for multiple sources.
|
|
11586
|
+
*
|
|
11587
|
+
* @private
|
|
11588
|
+
* @param {Object} object The destination object.
|
|
11589
|
+
* @param {Object} source The source object.
|
|
11590
|
+
* @param {number} srcIndex The index of `source`.
|
|
11591
|
+
* @param {Function} [customizer] The function to customize merged values.
|
|
11592
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
11593
|
+
* counterparts.
|
|
11594
|
+
*/
|
|
11595
|
+
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
11596
|
+
if (object === source) {
|
|
11597
|
+
return;
|
|
11598
|
+
}
|
|
11599
|
+
baseFor(source, function(srcValue, key) {
|
|
11600
|
+
stack || (stack = new Stack);
|
|
11601
|
+
if (isObject(srcValue)) {
|
|
11602
|
+
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
11603
|
+
}
|
|
11604
|
+
else {
|
|
11605
|
+
var newValue = customizer
|
|
11606
|
+
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
11607
|
+
: undefined;
|
|
11608
|
+
|
|
11609
|
+
if (newValue === undefined) {
|
|
11610
|
+
newValue = srcValue;
|
|
11611
|
+
}
|
|
11612
|
+
assignMergeValue(object, key, newValue);
|
|
11613
|
+
}
|
|
11614
|
+
}, keysIn);
|
|
11615
|
+
}
|
|
11616
|
+
|
|
11344
11617
|
/**
|
|
11345
11618
|
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
11346
11619
|
*
|
|
@@ -11439,6 +11712,41 @@ function parent(object, path) {
|
|
|
11439
11712
|
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
11440
11713
|
}
|
|
11441
11714
|
|
|
11715
|
+
/**
|
|
11716
|
+
* This method is like `_.assign` except that it recursively merges own and
|
|
11717
|
+
* inherited enumerable string keyed properties of source objects into the
|
|
11718
|
+
* destination object. Source properties that resolve to `undefined` are
|
|
11719
|
+
* skipped if a destination value exists. Array and plain object properties
|
|
11720
|
+
* are merged recursively. Other objects and value types are overridden by
|
|
11721
|
+
* assignment. Source objects are applied from left to right. Subsequent
|
|
11722
|
+
* sources overwrite property assignments of previous sources.
|
|
11723
|
+
*
|
|
11724
|
+
* **Note:** This method mutates `object`.
|
|
11725
|
+
*
|
|
11726
|
+
* @static
|
|
11727
|
+
* @memberOf _
|
|
11728
|
+
* @since 0.5.0
|
|
11729
|
+
* @category Object
|
|
11730
|
+
* @param {Object} object The destination object.
|
|
11731
|
+
* @param {...Object} [sources] The source objects.
|
|
11732
|
+
* @returns {Object} Returns `object`.
|
|
11733
|
+
* @example
|
|
11734
|
+
*
|
|
11735
|
+
* var object = {
|
|
11736
|
+
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
|
11737
|
+
* };
|
|
11738
|
+
*
|
|
11739
|
+
* var other = {
|
|
11740
|
+
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
11741
|
+
* };
|
|
11742
|
+
*
|
|
11743
|
+
* _.merge(object, other);
|
|
11744
|
+
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
11745
|
+
*/
|
|
11746
|
+
var merge = createAssigner(function(object, source, srcIndex) {
|
|
11747
|
+
baseMerge(object, source, srcIndex);
|
|
11748
|
+
});
|
|
11749
|
+
|
|
11442
11750
|
/**
|
|
11443
11751
|
* The base implementation of `_.unset`.
|
|
11444
11752
|
*
|
|
@@ -11755,22 +12063,6 @@ const traverseWithDereferencing = (schema, visitor) => {
|
|
|
11755
12063
|
_traverseWithDereferencing(schema, schema, [], visitor);
|
|
11756
12064
|
};
|
|
11757
12065
|
|
|
11758
|
-
const transformRequestSchema = (schema) => {
|
|
11759
|
-
// OpenAPI defines allOf to mean the union of all sub-schemas. JSON-Schema
|
|
11760
|
-
// defines allOf to mean that *every* sub-schema needs to be satisfied. In
|
|
11761
|
-
// draft 2019-09, JSON-Schema added "unevaluatedProperties" to support this
|
|
11762
|
-
// behaviour
|
|
11763
|
-
traverseWithDereferencing(schema, (s) => {
|
|
11764
|
-
if (s.allOf) {
|
|
11765
|
-
forEach(s.allOf, (ss) => {
|
|
11766
|
-
delete ss.additionalProperties;
|
|
11767
|
-
});
|
|
11768
|
-
s.unevaluatedProperties = false;
|
|
11769
|
-
}
|
|
11770
|
-
});
|
|
11771
|
-
return schema;
|
|
11772
|
-
};
|
|
11773
|
-
|
|
11774
12066
|
const transformResponseSchema = (schema, noTransformNonNullableResponseSchema) => {
|
|
11775
12067
|
// a provider must provide a superset of what the consumer asks for
|
|
11776
12068
|
// additionalProperties expected in pact response are disallowed
|
|
@@ -11794,30 +12086,62 @@ const transformResponseSchema = (schema, noTransformNonNullableResponseSchema) =
|
|
|
11794
12086
|
}
|
|
11795
12087
|
delete s.required;
|
|
11796
12088
|
});
|
|
11797
|
-
// OpenAPI defines allOf to mean the union of all sub-schemas. JSON-Schema
|
|
11798
|
-
// defines allOf to mean that *every* sub-schema needs to be satisfied. In
|
|
11799
|
-
// draft 2019-09, JSON-Schema added "unevaluatedProperties" to support this
|
|
11800
|
-
// behaviour
|
|
11801
|
-
traverseWithDereferencing(schema, (s) => {
|
|
11802
|
-
if (s.allOf) {
|
|
11803
|
-
forEach(s.allOf, (ss) => {
|
|
11804
|
-
let subschema = ss;
|
|
11805
|
-
if (subschema.$ref) {
|
|
11806
|
-
subschema = get$1(schema, splitPath(subschema.$ref));
|
|
11807
|
-
}
|
|
11808
|
-
delete subschema.additionalProperties;
|
|
11809
|
-
if (subschema.allOf) {
|
|
11810
|
-
// traversal is depth-first; if nested allOf, remove
|
|
11811
|
-
// unevaluatedProperties from previously set deeper schema
|
|
11812
|
-
delete subschema.unevaluatedProperties;
|
|
11813
|
-
}
|
|
11814
|
-
});
|
|
11815
|
-
s.unevaluatedProperties = false;
|
|
11816
|
-
}
|
|
11817
|
-
});
|
|
11818
12089
|
return schema;
|
|
11819
12090
|
};
|
|
11820
12091
|
|
|
12092
|
+
function _flat(s, root) {
|
|
12093
|
+
if (s.allOf) {
|
|
12094
|
+
const { allOf, ...others } = s;
|
|
12095
|
+
return merge(others, ...allOf.map((ss) => {
|
|
12096
|
+
let dereferenced;
|
|
12097
|
+
if (ss.$ref) {
|
|
12098
|
+
const { $ref, ...others } = ss;
|
|
12099
|
+
dereferenced = {
|
|
12100
|
+
...others,
|
|
12101
|
+
...get$1(root, splitPath($ref)),
|
|
12102
|
+
};
|
|
12103
|
+
}
|
|
12104
|
+
return _flat(dereferenced || ss, root);
|
|
12105
|
+
}));
|
|
12106
|
+
}
|
|
12107
|
+
if (s.properties) {
|
|
12108
|
+
for (const ss in s.properties) {
|
|
12109
|
+
s.properties[ss] = _flat(s.properties[ss], root);
|
|
12110
|
+
}
|
|
12111
|
+
return s;
|
|
12112
|
+
}
|
|
12113
|
+
for (const key of [
|
|
12114
|
+
"oneOf",
|
|
12115
|
+
"anyOf",
|
|
12116
|
+
"not",
|
|
12117
|
+
"items",
|
|
12118
|
+
"additionalProperties",
|
|
12119
|
+
]) {
|
|
12120
|
+
if (s[key]) {
|
|
12121
|
+
return {
|
|
12122
|
+
...s,
|
|
12123
|
+
[key]: Array.isArray(s[key])
|
|
12124
|
+
? s[key].map((ss) => _flat(ss, root))
|
|
12125
|
+
: _flat(s[key], root),
|
|
12126
|
+
};
|
|
12127
|
+
}
|
|
12128
|
+
}
|
|
12129
|
+
return s;
|
|
12130
|
+
}
|
|
12131
|
+
// OpenAPI defines allOf to mean the union of all sub-schemas. JSON-Schema
|
|
12132
|
+
// defines allOf to mean that *every* sub-schema needs to be satisfied.
|
|
12133
|
+
// To handle the difference, we flatten 'allOf'
|
|
12134
|
+
function flattenAllOf(s, refs) {
|
|
12135
|
+
// main schema
|
|
12136
|
+
const flattened = _flat(s, s);
|
|
12137
|
+
// any other references
|
|
12138
|
+
for (const ref of refs) {
|
|
12139
|
+
const path = splitPath(ref);
|
|
12140
|
+
set(flattened, path, _flat(get$1(s, path), s));
|
|
12141
|
+
}
|
|
12142
|
+
return flattened;
|
|
12143
|
+
}
|
|
12144
|
+
|
|
11821
12145
|
// draft-06 onwards converts exclusiveMinimum and exclusiveMaximum to numbers
|
|
11822
12146
|
const convertExclusiveMinMax = (s) => {
|
|
11823
12147
|
if (s.exclusiveMaximum === true) {
|
|
@@ -11880,13 +12204,13 @@ const minimumSchema = (originalSchema, oas) => {
|
|
|
11880
12204
|
const subschema = cloneDeep(get$1(oas, path, {}));
|
|
11881
12205
|
delete subschema.description;
|
|
11882
12206
|
delete subschema.example;
|
|
11883
|
-
traverse(
|
|
12207
|
+
traverse(subschema, cleanupDiscriminators);
|
|
11884
12208
|
traverse(subschema, collectReferences);
|
|
11885
12209
|
traverse(subschema, handleNullableSchema);
|
|
11886
12210
|
traverse(subschema, convertExclusiveMinMax);
|
|
11887
12211
|
set(schema, path, subschema);
|
|
11888
12212
|
}
|
|
11889
|
-
return schema;
|
|
12213
|
+
return flattenAllOf(schema, refAdded);
|
|
11890
12214
|
};
|
|
11891
12215
|
|
|
11892
12216
|
const isSimpleSchema = (s, oas) => {
|
|
@@ -15494,7 +15818,7 @@ function* compareReqBody(ajv, route, interaction, index, config) {
|
|
|
15494
15818
|
: true)) {
|
|
15495
15819
|
const value = parseBody(body, requestContentType, config.get("legacy-parser"));
|
|
15496
15820
|
const schemaId = `[root].paths.${path}.${method}.requestBody.content.${contentType}`;
|
|
15497
|
-
const validate = getValidateFunction(ajv, schemaId, () =>
|
|
15821
|
+
const validate = getValidateFunction(ajv, schemaId, () => minimumSchema(schema, oas));
|
|
15498
15822
|
if (!validate(value)) {
|
|
15499
15823
|
for (const error of validate.errors) {
|
|
15500
15824
|
yield {
|
|
@@ -27268,6 +27592,7 @@ var Ajv$1 = /*@__PURE__*/getDefaultExportFromCjs(ajvExports);
|
|
|
27268
27592
|
// a full schema can be found at https://github.com/pactflow/pact-schemas
|
|
27269
27593
|
// but we don't use that here, because we try to be permissive with input
|
|
27270
27594
|
const Interaction = Type.Object({
|
|
27595
|
+
_skip: Type.Optional(Type.Boolean()),
|
|
27271
27596
|
type: Type.Optional(Type.String()),
|
|
27272
27597
|
description: Type.Optional(Type.String()),
|
|
27273
27598
|
providerState: Type.Optional(Type.String()),
|
|
@@ -27396,9 +27721,9 @@ const parse = (pact) => {
|
|
|
27396
27721
|
const interactionParser = version >= 4 ? interactionV4 : version >= 3 ? interactionV3 : interactionV1;
|
|
27397
27722
|
return {
|
|
27398
27723
|
metadata,
|
|
27399
|
-
interactions: interactions
|
|
27400
|
-
|
|
27401
|
-
|
|
27724
|
+
interactions: interactions.map((i) => supportedInteractions(i)
|
|
27725
|
+
? interactionParser(i)
|
|
27726
|
+
: { _skip: true }),
|
|
27402
27727
|
};
|
|
27403
27728
|
};
|
|
27404
27729
|
class ParserError extends Error {
|
|
@@ -32180,6 +32505,10 @@ class Comparator {
|
|
|
32180
32505
|
}
|
|
32181
32506
|
const parsedPact = parse(pact);
|
|
32182
32507
|
for (const [index, interaction] of parsedPact.interactions.entries()) {
|
|
32508
|
+
if (interaction._skip) {
|
|
32509
|
+
// non http/synchronous have been zero-ed out
|
|
32510
|
+
continue;
|
|
32511
|
+
}
|
|
32183
32512
|
const { method, path, query } = interaction.request;
|
|
32184
32513
|
let pathWithLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
32185
32514
|
if (this.#config.get("no-percent-encoding")) {
|
|
@@ -32228,7 +32557,7 @@ class Comparator {
|
|
|
32228
32557
|
}
|
|
32229
32558
|
}
|
|
32230
32559
|
|
|
32231
|
-
var version = "1.
|
|
32560
|
+
var version = "1.7.1";
|
|
32232
32561
|
var packageJson = {
|
|
32233
32562
|
version: version};
|
|
32234
32563
|
|