swagger-client 3.19.10 → 3.19.11

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.
@@ -2915,7 +2915,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
2915
2915
  return false;
2916
2916
  }
2917
2917
  const reference = await this.toReference(referenceElement.$ref.toValue());
2918
- const retrievalURI = reference.uri;
2918
+ const {
2919
+ uri: retrievalURI
2920
+ } = reference;
2919
2921
  const $refBaseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.resolve(retrievalURI, referenceElement.$ref.toValue());
2920
2922
  this.indirections.push(referenceElement);
2921
2923
  const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__.uriToPointer)($refBaseURI);
@@ -3052,7 +3054,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
3052
3054
  return undefined;
3053
3055
  }
3054
3056
  const reference = await this.toReference(pathItemElement.$ref.toValue());
3055
- const retrievalURI = reference.uri;
3057
+ const {
3058
+ uri: retrievalURI
3059
+ } = reference;
3056
3060
  const $refBaseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.resolve(retrievalURI, pathItemElement.$ref.toValue());
3057
3061
  this.indirections.push(pathItemElement);
3058
3062
  const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_7__.uriToPointer)($refBaseURI);
@@ -3174,9 +3178,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
3174
3178
  }
3175
3179
 
3176
3180
  // compute baseURI using rules around $id and $ref keywords
3177
- let {
3178
- reference
3179
- } = this;
3181
+ let reference = await this.toReference(_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.unsanitize(this.reference.uri));
3180
3182
  let {
3181
3183
  uri: retrievalURI
3182
3184
  } = reference;
@@ -21870,11 +21872,11 @@ const hasMethod = (name, obj) => typeof (obj === null || obj === void 0 ? void 0
21870
21872
  const hasBasicElementProps = element => element != null && Object.prototype.hasOwnProperty.call(element, '_storedElement') && Object.prototype.hasOwnProperty.call(element, '_content');
21871
21873
  const primitiveEq = (val, obj) => {
21872
21874
  var _obj$primitive;
21873
- return (obj === null || obj === void 0 ? void 0 : (_obj$primitive = obj.primitive) === null || _obj$primitive === void 0 ? void 0 : _obj$primitive.call(obj)) === val;
21875
+ return (obj === null || obj === void 0 || (_obj$primitive = obj.primitive) === null || _obj$primitive === void 0 ? void 0 : _obj$primitive.call(obj)) === val;
21874
21876
  };
21875
21877
  const hasClass = (cls, obj) => {
21876
21878
  var _obj$classes, _obj$classes$includes;
21877
- return (obj === null || obj === void 0 ? void 0 : (_obj$classes = obj.classes) === null || _obj$classes === void 0 ? void 0 : (_obj$classes$includes = _obj$classes.includes) === null || _obj$classes$includes === void 0 ? void 0 : _obj$classes$includes.call(_obj$classes, cls)) || false;
21879
+ return (obj === null || obj === void 0 || (_obj$classes = obj.classes) === null || _obj$classes === void 0 || (_obj$classes$includes = _obj$classes.includes) === null || _obj$classes$includes === void 0 ? void 0 : _obj$classes$includes.call(_obj$classes, cls)) || false;
21878
21880
  };
21879
21881
  const isElementType = (name, element) => (element === null || element === void 0 ? void 0 : element.element) === name;
21880
21882
  const createPredicate = predicateCreator => {
@@ -22030,7 +22032,7 @@ const isPrimitiveElement = element => {
22030
22032
  };
22031
22033
  const hasElementSourceMap = element => {
22032
22034
  var _element$meta, _element$meta$get;
22033
- return isSourceMapElement(element === null || element === void 0 ? void 0 : (_element$meta = element.meta) === null || _element$meta === void 0 ? void 0 : (_element$meta$get = _element$meta.get) === null || _element$meta$get === void 0 ? void 0 : _element$meta$get.call(_element$meta, 'sourceMap'));
22035
+ return isSourceMapElement(element === null || element === void 0 || (_element$meta = element.meta) === null || _element$meta === void 0 || (_element$meta$get = _element$meta.get) === null || _element$meta$get === void 0 ? void 0 : _element$meta$get.call(_element$meta, 'sourceMap'));
22034
22036
  };
22035
22037
  const includesSymbols = (symbols, element) => {
22036
22038
  if (symbols.length === 0) {
@@ -23265,8 +23267,8 @@ __webpack_require__.r(__webpack_exports__);
23265
23267
  /* harmony export */ "default": () => (/* binding */ EvaluationJsonPointerError)
23266
23268
  /* harmony export */ });
23267
23269
  class EvaluationJsonPointerError extends Error {
23268
- constructor(message) {
23269
- super(message);
23270
+ constructor(message, options) {
23271
+ super(message, options);
23270
23272
  this.name = this.constructor.name;
23271
23273
  this.message = message;
23272
23274
  if (typeof Error.captureStackTrace === 'function') {
@@ -23288,8 +23290,8 @@ __webpack_require__.r(__webpack_exports__);
23288
23290
  /* harmony export */ "default": () => (/* binding */ InvalidJsonPointerError)
23289
23291
  /* harmony export */ });
23290
23292
  class InvalidJsonPointerError extends Error {
23291
- constructor(pointer) {
23292
- super(`Invalid $ref pointer "${pointer}". Pointers must begin with "/"`);
23293
+ constructor(pointer, options) {
23294
+ super(`Invalid $ref pointer "${pointer}". Pointers must begin with "/"`, options);
23293
23295
  this.name = this.constructor.name;
23294
23296
  this.message = `Invalid $ref pointer "${pointer}". Pointers must begin with "/"`;
23295
23297
  if (typeof Error.captureStackTrace === 'function') {
@@ -36054,6 +36056,7 @@ const plugin = ({
36054
36056
 
36055
36057
  // append incremental numerical suffixes to identical operationIds
36056
36058
  Object.entries(normalizedOperationGroups).forEach(([normalizedOperationId, operationElements]) => {
36059
+ if (!Array.isArray(operationElements)) return;
36057
36060
  if (operationElements.length <= 1) return;
36058
36061
  operationElements.forEach((operationElement, index) => {
36059
36062
  const indexedNormalizedOperationId = `${normalizedOperationId}${index + 1}`;
@@ -40356,7 +40359,9 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
40356
40359
  return false;
40357
40360
  }
40358
40361
  const reference = await this.toReference((_referencingElement$$ = referencingElement.$ref) === null || _referencingElement$$ === void 0 ? void 0 : _referencingElement$$.toValue());
40359
- const retrievalURI = reference.uri;
40362
+ const {
40363
+ uri: retrievalURI
40364
+ } = reference;
40360
40365
  const $refBaseURI = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.resolve(retrievalURI, (_referencingElement$$2 = referencingElement.$ref) === null || _referencingElement$$2 === void 0 ? void 0 : _referencingElement$$2.toValue());
40361
40366
  this.indirections.push(referencingElement);
40362
40367
  const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
@@ -40456,7 +40461,9 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
40456
40461
  return undefined;
40457
40462
  }
40458
40463
  const reference = await this.toReference((_referencingElement$$4 = referencingElement.$ref) === null || _referencingElement$$4 === void 0 ? void 0 : _referencingElement$$4.toValue());
40459
- const retrievalURI = reference.uri;
40464
+ const {
40465
+ uri: retrievalURI
40466
+ } = reference;
40460
40467
  const $refBaseURI = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.resolve(retrievalURI, (_referencingElement$$5 = referencingElement.$ref) === null || _referencingElement$$5 === void 0 ? void 0 : _referencingElement$$5.toValue());
40461
40468
  this.indirections.push(referencingElement);
40462
40469
  const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
@@ -40558,7 +40565,8 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
40558
40565
  } else if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationId)) {
40559
40566
  var _linkElement$operatio4, _linkElement$operatio5;
40560
40567
  const operationId = (_linkElement$operatio4 = linkElement.operationId) === null || _linkElement$operatio4 === void 0 ? void 0 : _linkElement$operatio4.toValue();
40561
- operationElement = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_16__["default"])(e => (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isOperationElement)(e) && e.operationId.equals(operationId), this.reference.value.result);
40568
+ const reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize(this.reference.uri));
40569
+ operationElement = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_16__["default"])(e => (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isOperationElement)(e) && e.operationId.equals(operationId), reference.value.result);
40562
40570
  // OperationElement not found by its operationId
40563
40571
  if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_17__["default"])(operationElement)) {
40564
40572
  throw new Error(`OperationElement(operationId=${operationId}) not found.`);
@@ -40611,9 +40619,7 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
40611
40619
  }
40612
40620
 
40613
40621
  // compute baseURI using rules around $id and $ref keywords
40614
- let {
40615
- reference
40616
- } = this;
40622
+ let reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize(this.reference.uri));
40617
40623
  let {
40618
40624
  uri: retrievalURI
40619
40625
  } = reference;
@@ -41467,7 +41473,7 @@ __webpack_require__.r(__webpack_exports__);
41467
41473
 
41468
41474
 
41469
41475
 
41470
- const resolveSchema$refField = (retrieveURI, schemaElement) => {
41476
+ const resolveSchema$refField = (retrievalURI, schemaElement) => {
41471
41477
  if (typeof schemaElement.$ref === 'undefined') {
41472
41478
  return undefined;
41473
41479
  }
@@ -41475,17 +41481,17 @@ const resolveSchema$refField = (retrieveURI, schemaElement) => {
41475
41481
  const inherited$id = schemaElement.meta.get('inherited$id').toValue();
41476
41482
  const $refBaseURI = (0,ramda__WEBPACK_IMPORTED_MODULE_0__.reduce)((acc, uri) => {
41477
41483
  return _util_url_js__WEBPACK_IMPORTED_MODULE_1__.resolve(acc, _util_url_js__WEBPACK_IMPORTED_MODULE_1__.sanitize(_util_url_js__WEBPACK_IMPORTED_MODULE_1__.stripHash(uri)));
41478
- }, retrieveURI, [...inherited$id, schemaElement.$ref.toValue()]);
41484
+ }, retrievalURI, [...inherited$id, schemaElement.$ref.toValue()]);
41479
41485
  return `${$refBaseURI}${hash === '#' ? '' : hash}`;
41480
41486
  };
41481
- const resolveSchema$idField = (retrieveURI, schemaElement) => {
41487
+ const resolveSchema$idField = (retrievalURI, schemaElement) => {
41482
41488
  if (typeof schemaElement.$id === 'undefined') {
41483
41489
  return undefined;
41484
41490
  }
41485
41491
  const inherited$id = schemaElement.meta.get('inherited$id').toValue();
41486
41492
  return (0,ramda__WEBPACK_IMPORTED_MODULE_0__.reduce)((acc, $id) => {
41487
41493
  return _util_url_js__WEBPACK_IMPORTED_MODULE_1__.resolve(acc, _util_url_js__WEBPACK_IMPORTED_MODULE_1__.sanitize(_util_url_js__WEBPACK_IMPORTED_MODULE_1__.stripHash($id)));
41488
- }, retrieveURI, [...inherited$id, schemaElement.$id.toValue()]);
41494
+ }, retrievalURI, [...inherited$id, schemaElement.$id.toValue()]);
41489
41495
  };
41490
41496
 
41491
41497
  /**
@@ -41702,7 +41708,7 @@ const OpenApi3_1ResolveVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
41702
41708
  }
41703
41709
  return undefined;
41704
41710
  },
41705
- SchemaElement(schemaElement) {
41711
+ async SchemaElement(schemaElement) {
41706
41712
  /**
41707
41713
  * Skip traversal for already visited schemas and all their child schemas.
41708
41714
  * visit function detects cycles in path automatically.
@@ -41719,15 +41725,18 @@ const OpenApi3_1ResolveVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
41719
41725
  }
41720
41726
 
41721
41727
  // compute baseURI using rules around $id and $ref keywords
41722
- const retrieveURI = this.reference.uri;
41723
- const $refBaseURI = (0,_util_js__WEBPACK_IMPORTED_MODULE_10__.resolveSchema$refField)(retrieveURI, schemaElement);
41728
+ const reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize(this.reference.uri));
41729
+ const {
41730
+ uri: retrievalURI
41731
+ } = reference;
41732
+ const $refBaseURI = (0,_util_js__WEBPACK_IMPORTED_MODULE_10__.resolveSchema$refField)(retrievalURI, schemaElement);
41724
41733
  const $refBaseURIStrippedHash = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.stripHash($refBaseURI);
41725
41734
  const file = (0,_util_File_js__WEBPACK_IMPORTED_MODULE_11__["default"])({
41726
41735
  uri: $refBaseURIStrippedHash
41727
41736
  });
41728
41737
  const isUnknownURI = (0,ramda__WEBPACK_IMPORTED_MODULE_2__.none)(r => r.canRead(file), this.options.resolve.resolvers);
41729
41738
  const isURL = !isUnknownURI;
41730
- const isExternal = !isUnknownURI && this.reference.uri !== $refBaseURIStrippedHash;
41739
+ const isExternal = !isUnknownURI && retrievalURI !== $refBaseURIStrippedHash;
41731
41740
 
41732
41741
  // ignore resolving external Reference Objects
41733
41742
  if (!this.options.resolve.external && isExternal) {
@@ -41739,7 +41748,7 @@ const OpenApi3_1ResolveVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
41739
41748
  if (!(0,ramda__WEBPACK_IMPORTED_MODULE_2__.has)($refBaseURIStrippedHash, this.crawlingMap)) {
41740
41749
  try {
41741
41750
  if (isUnknownURI || isURL) {
41742
- this.crawlingMap[$refBaseURIStrippedHash] = this.reference;
41751
+ this.crawlingMap[$refBaseURIStrippedHash] = reference;
41743
41752
  } else {
41744
41753
  this.crawlingMap[$refBaseURIStrippedHash] = this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize($refBaseURI));
41745
41754
  }
@@ -41843,8 +41852,11 @@ const OpenApi3_1ResolveVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
41843
41852
  },
41844
41853
  async crawlSchemaElement(referencingElement) {
41845
41854
  // compute baseURI using rules around $id and $ref keywords
41846
- const retrieveURI = this.reference.uri;
41847
- const $refBaseURI = (0,_util_js__WEBPACK_IMPORTED_MODULE_10__.resolveSchema$refField)(retrieveURI, referencingElement);
41855
+ let reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize(this.reference.uri));
41856
+ const {
41857
+ uri: retrievalURI
41858
+ } = reference;
41859
+ const $refBaseURI = (0,_util_js__WEBPACK_IMPORTED_MODULE_10__.resolveSchema$refField)(retrievalURI, referencingElement);
41848
41860
  const $refBaseURIStrippedHash = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.stripHash($refBaseURI);
41849
41861
  const file = (0,_util_File_js__WEBPACK_IMPORTED_MODULE_11__["default"])({
41850
41862
  uri: $refBaseURIStrippedHash
@@ -41854,12 +41866,10 @@ const OpenApi3_1ResolveVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
41854
41866
  this.indirections.push(referencingElement);
41855
41867
 
41856
41868
  // determining reference, proper evaluation and selection mechanism
41857
- let reference;
41858
41869
  let referencedElement;
41859
41870
  try {
41860
41871
  if (isUnknownURI || isURL) {
41861
41872
  // we're dealing with canonical URI or URL with possible fragment
41862
- reference = this.reference;
41863
41873
  const selector = $refBaseURI;
41864
41874
  referencedElement = (0,_dereference_strategies_openapi_3_1_selectors_uri_index_js__WEBPACK_IMPORTED_MODULE_18__.evaluate)(selector,
41865
41875
  // @ts-ignore
@@ -42071,6 +42081,11 @@ __webpack_require__.r(__webpack_exports__);
42071
42081
  /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38074);
42072
42082
 
42073
42083
 
42084
+
42085
+ /**
42086
+ * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
42087
+ * Node.js is >= 16.9.0 supports error causes natively.
42088
+ */
42074
42089
  class CausedError extends Error {
42075
42090
  constructor(message, options) {
42076
42091
  super(message);