swagger-client 3.28.1 → 3.28.2

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.
@@ -41,20 +41,20 @@ __webpack_require__.r(__webpack_exports__);
41
41
  /* harmony export */ self: () => (/* binding */ self)
42
42
  /* harmony export */ });
43
43
  /* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57427);
44
- /* harmony import */ var is_plain_object__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58270);
45
- /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49408);
46
- /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(19500);
44
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24955);
45
+ /* harmony import */ var openapi_server_url_templating__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29646);
46
+ /* harmony import */ var _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(19500);
47
47
  /* harmony import */ var _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(83748);
48
- /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3832);
49
- /* harmony import */ var _http_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51670);
50
- /* harmony import */ var _http_serializers_request_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29382);
51
- /* harmony import */ var _swagger2_parameter_builders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(90520);
52
- /* harmony import */ var _oas3_parameter_builders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42276);
53
- /* harmony import */ var _oas3_build_request_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(53044);
54
- /* harmony import */ var _swagger2_build_request_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(77768);
55
- /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(47555);
56
- /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(50324);
57
- /* harmony import */ var _helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(50918);
48
+ /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3832);
49
+ /* harmony import */ var _http_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51670);
50
+ /* harmony import */ var _http_serializers_request_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29382);
51
+ /* harmony import */ var _swagger2_parameter_builders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90520);
52
+ /* harmony import */ var _oas3_parameter_builders_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42276);
53
+ /* harmony import */ var _oas3_build_request_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(53044);
54
+ /* harmony import */ var _swagger2_build_request_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77768);
55
+ /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(47555);
56
+ /* harmony import */ var _helpers_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(50324);
57
+ /* harmony import */ var _helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(50918);
58
58
 
59
59
 
60
60
 
@@ -80,7 +80,7 @@ const parseURIReference = uriReference => {
80
80
  try {
81
81
  return new URL(uriReference);
82
82
  } catch {
83
- const parsedURL = new URL(uriReference, _constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_BASE_URL);
83
+ const parsedURL = new URL(uriReference, _constants_js__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_BASE_URL);
84
84
  const pathname = String(uriReference).startsWith('/') ? parsedURL.pathname : parsedURL.pathname.substring(1);
85
85
  return {
86
86
  hash: parsedURL.hash,
@@ -97,7 +97,7 @@ const parseURIReference = uriReference => {
97
97
  };
98
98
  }
99
99
  };
100
- class OperationNotFoundError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_8__["default"] {}
100
+ class OperationNotFoundError extends _swagger_api_apidom_error__WEBPACK_IMPORTED_MODULE_9__["default"] {}
101
101
  const findParametersWithName = (name, parameters) => parameters.filter(p => p.name === name);
102
102
 
103
103
  // removes parameters that have duplicate 'in' and 'name' properties
@@ -138,10 +138,10 @@ function execute({
138
138
  ...extras
139
139
  }) {
140
140
  // Provide default fetch implementation
141
- const http = userHttp || fetch || _http_index_js__WEBPACK_IMPORTED_MODULE_2__["default"]; // Default to _our_ http
141
+ const http = userHttp || fetch || _http_index_js__WEBPACK_IMPORTED_MODULE_3__["default"]; // Default to _our_ http
142
142
 
143
143
  if (pathName && method && !operationId) {
144
- operationId = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_9__["default"])(pathName, method);
144
+ operationId = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_10__["default"])(pathName, method);
145
145
  }
146
146
  const request = self.buildRequest({
147
147
  spec,
@@ -151,7 +151,7 @@ function execute({
151
151
  http,
152
152
  ...extras
153
153
  });
154
- if (request.body && ((0,is_plain_object__WEBPACK_IMPORTED_MODULE_10__.isPlainObject)(request.body) || Array.isArray(request.body))) {
154
+ if (request.body && ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_11__["default"])(request.body) || Array.isArray(request.body))) {
155
155
  request.body = JSON.stringify(request.body);
156
156
  }
157
157
 
@@ -179,13 +179,13 @@ function buildRequest(options) {
179
179
  parameters,
180
180
  parameterBuilders
181
181
  } = options;
182
- const specIsOAS3 = (0,_helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_11__.isOpenAPI3)(spec);
182
+ const specIsOAS3 = (0,_helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_12__.isOpenAPI3)(spec);
183
183
  if (!parameterBuilders) {
184
184
  // user did not provide custom parameter builders
185
185
  if (specIsOAS3) {
186
- parameterBuilders = _oas3_parameter_builders_js__WEBPACK_IMPORTED_MODULE_5__;
186
+ parameterBuilders = _oas3_parameter_builders_js__WEBPACK_IMPORTED_MODULE_6__;
187
187
  } else {
188
- parameterBuilders = _swagger2_parameter_builders_js__WEBPACK_IMPORTED_MODULE_4__["default"];
188
+ parameterBuilders = _swagger2_parameter_builders_js__WEBPACK_IMPORTED_MODULE_5__["default"];
189
189
  }
190
190
  }
191
191
 
@@ -211,7 +211,7 @@ function buildRequest(options) {
211
211
  if (userFetch) {
212
212
  req.userFetch = userFetch;
213
213
  }
214
- const operationRaw = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_12__["default"])(spec, operationId);
214
+ const operationRaw = (0,_helpers_index_js__WEBPACK_IMPORTED_MODULE_13__["default"])(spec, operationId);
215
215
  if (!operationRaw) {
216
216
  throw new OperationNotFoundError(`Operation ${operationId} not found`);
217
217
  }
@@ -304,10 +304,10 @@ function buildRequest(options) {
304
304
  operation
305
305
  };
306
306
  if (specIsOAS3) {
307
- req = (0,_oas3_build_request_js__WEBPACK_IMPORTED_MODULE_6__["default"])(versionSpecificOptions, req);
307
+ req = (0,_oas3_build_request_js__WEBPACK_IMPORTED_MODULE_7__["default"])(versionSpecificOptions, req);
308
308
  } else {
309
309
  // If not OAS3, then treat as Swagger2.
310
- req = (0,_swagger2_build_request_js__WEBPACK_IMPORTED_MODULE_7__["default"])(versionSpecificOptions, req);
310
+ req = (0,_swagger2_build_request_js__WEBPACK_IMPORTED_MODULE_8__["default"])(versionSpecificOptions, req);
311
311
  }
312
312
 
313
313
  // If the cookie convenience object exists in our request,
@@ -330,13 +330,13 @@ function buildRequest(options) {
330
330
 
331
331
  // Will add the query object into the URL, if it exists
332
332
  // ... will also create a FormData instance, if multipart/form-data (eg: a file)
333
- return (0,_http_serializers_request_index_js__WEBPACK_IMPORTED_MODULE_3__.serializeRequest)(req);
333
+ return (0,_http_serializers_request_index_js__WEBPACK_IMPORTED_MODULE_4__.serializeRequest)(req);
334
334
  }
335
335
  const stripNonAlpha = str => str ? str.replace(/\W/g, '') : null;
336
336
 
337
337
  // be careful when modifying this! it is a publicly-exposed method.
338
338
  function baseUrl(obj) {
339
- const specIsOAS3 = (0,_helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_11__.isOpenAPI3)(obj.spec);
339
+ const specIsOAS3 = (0,_helpers_openapi_predicates_js__WEBPACK_IMPORTED_MODULE_12__.isOpenAPI3)(obj.spec);
340
340
  return specIsOAS3 ? oas3BaseUrl(obj) : swagger2BaseUrl(obj);
341
341
  }
342
342
  const isNonEmptyServerList = value => Array.isArray(value) && value.length > 0;
@@ -358,7 +358,7 @@ function oas3BaseUrl({
358
358
  const rootLevelServers = spec?.servers;
359
359
  servers = isNonEmptyServerList(operationLevelServers) // eslint-disable-line no-nested-ternary
360
360
  ? operationLevelServers : isNonEmptyServerList(pathItemLevelServers) // eslint-disable-line no-nested-ternary
361
- ? pathItemLevelServers : isNonEmptyServerList(rootLevelServers) ? rootLevelServers : [_constants_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPENAPI_3_SERVER];
361
+ ? pathItemLevelServers : isNonEmptyServerList(rootLevelServers) ? rootLevelServers : [_constants_js__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_OPENAPI_3_SERVER];
362
362
 
363
363
  // pick the first server that matches the server url
364
364
  if (server) {
@@ -371,17 +371,18 @@ function oas3BaseUrl({
371
371
  [selectedServerObj] = servers;
372
372
  selectedServerUrl = selectedServerObj.url;
373
373
  }
374
- if (selectedServerUrl.includes('{')) {
375
- // do variable substitution
376
- const varNames = extractServerVariableNames(selectedServerUrl);
377
- varNames.forEach(variable => {
378
- if (selectedServerObj.variables && selectedServerObj.variables[variable]) {
379
- // variable is defined in server
380
- const variableDefinition = selectedServerObj.variables[variable];
381
- const variableValue = serverVariables[variable] || variableDefinition.default;
382
- const re = new RegExp(`{${(0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_13__["default"])(variable)}}`, 'g');
383
- selectedServerUrl = selectedServerUrl.replace(re, variableValue);
384
- }
374
+ if ((0,openapi_server_url_templating__WEBPACK_IMPORTED_MODULE_1__.test)(selectedServerUrl, {
375
+ strict: true
376
+ })) {
377
+ const selectedServerVariables = Object.entries({
378
+ ...selectedServerObj.variables
379
+ }).reduce((acc, [serverVariableName, serverVariable]) => {
380
+ acc[serverVariableName] = serverVariable.default;
381
+ return acc;
382
+ }, {});
383
+ selectedServerUrl = (0,openapi_server_url_templating__WEBPACK_IMPORTED_MODULE_1__.substitute)(selectedServerUrl, {
384
+ ...selectedServerVariables,
385
+ ...serverVariables
385
386
  });
386
387
  }
387
388
  return buildOas3UrlWithContext(selectedServerUrl, contextUrl);
@@ -403,10 +404,6 @@ function buildOas3UrlWithContext(ourUrl = '', contextUrl = '') {
403
404
  }
404
405
  return res[res.length - 1] === '/' ? res.slice(0, -1) : res;
405
406
  }
406
- function extractServerVariableNames(serverURL) {
407
- const match = serverURL.matchAll(/\{([^{}]+)}|([^{}]+)/g);
408
- return Array.from(match, ([, variable]) => variable).filter(Boolean);
409
- }
410
407
 
411
408
  // Compose the baseUrl ( scheme + host + basePath )
412
409
  function swagger2BaseUrl({
@@ -443,7 +440,7 @@ __webpack_require__.r(__webpack_exports__);
443
440
  /* harmony export */ applySecurities: () => (/* binding */ applySecurities),
444
441
  /* harmony export */ "default": () => (/* binding */ buildRequest)
445
442
  /* harmony export */ });
446
- /* harmony import */ var is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58270);
443
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24955);
447
444
  /* harmony import */ var _helpers_btoa_node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39687);
448
445
  // This function runs after the common function,
449
446
  // `src/execute/index.js#buildRequest`
@@ -489,7 +486,7 @@ function buildRequest(options, req) {
489
486
  if (!options.responseContentType && operation.responses) {
490
487
  const mediaTypes = Object.entries(operation.responses).filter(([key, value]) => {
491
488
  const code = parseInt(key, 10);
492
- return code >= 200 && code < 300 && (0,is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value.content);
489
+ return code >= 200 && code < 300 && (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(value.content);
493
490
  }).reduce((acc, [, value]) => acc.concat(Object.keys(value.content)), []);
494
491
  if (mediaTypes.length > 0) {
495
492
  req.headers.accept = mediaTypes.join(', ');
@@ -5736,7 +5733,7 @@ __webpack_require__.r(__webpack_exports__);
5736
5733
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59038);
5737
5734
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69037);
5738
5735
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26876);
5739
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5044);
5736
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65389);
5740
5737
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(89643);
5741
5738
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(66648);
5742
5739
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(3117);
@@ -32778,7 +32775,54 @@ const createRefractor = specPath => (value, options = {}) => refract(value, {
32778
32775
 
32779
32776
  /***/ }),
32780
32777
 
32781
- /***/ 5044:
32778
+ /***/ 56959:
32779
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
32780
+
32781
+ "use strict";
32782
+ __webpack_require__.r(__webpack_exports__);
32783
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32784
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
32785
+ /* harmony export */ });
32786
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33501);
32787
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44824);
32788
+
32789
+ class NormalizeStorage {
32790
+ internalStore;
32791
+ constructor(storageElement, storageField, storageSubField) {
32792
+ this.storageElement = storageElement;
32793
+ this.storageField = storageField;
32794
+ this.storageSubField = storageSubField;
32795
+ }
32796
+ get store() {
32797
+ if (!this.internalStore) {
32798
+ let rootStore = this.storageElement.get(this.storageField);
32799
+ if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isObjectElement)(rootStore)) {
32800
+ rootStore = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ObjectElement();
32801
+ this.storageElement.set(this.storageField, rootStore);
32802
+ }
32803
+ let store = rootStore.get(this.storageSubField);
32804
+ if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isArrayElement)(store)) {
32805
+ store = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement();
32806
+ rootStore.set(this.storageSubField, store);
32807
+ }
32808
+ this.internalStore = store;
32809
+ }
32810
+ return this.internalStore;
32811
+ }
32812
+ append(pointer) {
32813
+ if (!this.includes(pointer)) {
32814
+ this.store.push(pointer);
32815
+ }
32816
+ }
32817
+ includes(pointer) {
32818
+ return this.store.includes(pointer);
32819
+ }
32820
+ }
32821
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NormalizeStorage);
32822
+
32823
+ /***/ }),
32824
+
32825
+ /***/ 65389:
32782
32826
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
32783
32827
 
32784
32828
  "use strict";
@@ -32786,7 +32830,9 @@ __webpack_require__.r(__webpack_exports__);
32786
32830
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32787
32831
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
32788
32832
  /* harmony export */ });
32789
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87024);
32833
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87024);
32834
+ /* harmony import */ var _NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56959);
32835
+
32790
32836
 
32791
32837
  /**
32792
32838
  * Override of Schema.example and Schema.examples field inside the Header Objects.
@@ -32799,13 +32845,27 @@ __webpack_require__.r(__webpack_exports__);
32799
32845
  *
32800
32846
  * The example value SHALL override the example provided by the schema.
32801
32847
  * Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
32848
+ *
32849
+ * NOTE: this plugin is idempotent
32802
32850
  */
32803
- /* eslint-disable no-param-reassign */
32804
- const plugin = () => ({
32805
- predicates
32806
- }) => {
32851
+ const plugin = ({
32852
+ storageField = 'x-normalized'
32853
+ } = {}) => toolbox => {
32854
+ const {
32855
+ predicates,
32856
+ ancestorLineageToJSONPointer
32857
+ } = toolbox;
32858
+ let storage;
32807
32859
  return {
32808
32860
  visitor: {
32861
+ OpenApi3_1Element: {
32862
+ enter(element) {
32863
+ storage = new _NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](element, storageField, 'header-examples');
32864
+ },
32865
+ leave() {
32866
+ storage = undefined;
32867
+ }
32868
+ },
32809
32869
  HeaderElement: {
32810
32870
  leave(headerElement, key, parent, path, ancestors) {
32811
32871
  var _headerElement$schema, _headerElement$schema2;
@@ -32822,6 +32882,12 @@ const plugin = () => ({
32822
32882
  if (typeof ((_headerElement$schema = headerElement.schema) === null || _headerElement$schema === void 0 ? void 0 : _headerElement$schema.example) === 'undefined' && typeof ((_headerElement$schema2 = headerElement.schema) === null || _headerElement$schema2 === void 0 ? void 0 : _headerElement$schema2.examples) === 'undefined') {
32823
32883
  return;
32824
32884
  }
32885
+ const headerJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, headerElement]);
32886
+
32887
+ // skip visiting this Header Object if it's already normalized
32888
+ if (storage.includes(headerJSONPointer)) {
32889
+ return;
32890
+ }
32825
32891
 
32826
32892
  /**
32827
32893
  * Header.examples and Schema.examples have preferences over the older
@@ -32830,13 +32896,15 @@ const plugin = () => ({
32830
32896
  if (typeof headerElement.examples !== 'undefined' && predicates.isObjectElement(headerElement.examples)) {
32831
32897
  // @ts-ignore
32832
32898
  const examples = headerElement.examples.map(example => {
32833
- return _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep.safe(example.value);
32899
+ return _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep.safe(example.value);
32834
32900
  });
32835
32901
  if (typeof headerElement.schema.examples !== 'undefined') {
32836
32902
  headerElement.schema.set('examples', examples);
32903
+ storage.append(headerJSONPointer);
32837
32904
  }
32838
32905
  if (typeof headerElement.schema.example !== 'undefined') {
32839
- headerElement.schema.set('example', examples);
32906
+ headerElement.schema.set('example', examples[0]);
32907
+ storage.append(headerJSONPointer);
32840
32908
  }
32841
32909
  return;
32842
32910
  }
@@ -32846,10 +32914,12 @@ const plugin = () => ({
32846
32914
  */
32847
32915
  if (typeof headerElement.example !== 'undefined') {
32848
32916
  if (typeof headerElement.schema.examples !== 'undefined') {
32849
- headerElement.schema.set('examples', [(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(headerElement.example)]);
32917
+ headerElement.schema.set('examples', [(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(headerElement.example)]);
32918
+ storage.append(headerJSONPointer);
32850
32919
  }
32851
32920
  if (typeof headerElement.schema.example !== 'undefined') {
32852
- headerElement.schema.set('example', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(headerElement.example));
32921
+ headerElement.schema.set('example', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(headerElement.example));
32922
+ storage.append(headerJSONPointer);
32853
32923
  }
32854
32924
  }
32855
32925
  }
@@ -32857,8 +32927,6 @@ const plugin = () => ({
32857
32927
  }
32858
32928
  };
32859
32929
  };
32860
- /* eslint-enable */
32861
-
32862
32930
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
32863
32931
 
32864
32932
  /***/ }),
@@ -32871,11 +32939,13 @@ __webpack_require__.r(__webpack_exports__);
32871
32939
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
32872
32940
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
32873
32941
  /* harmony export */ });
32874
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82974);
32875
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37012);
32876
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43022);
32877
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9999);
32878
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87024);
32942
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82974);
32943
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37012);
32944
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43022);
32945
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9999);
32946
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(87024);
32947
+ /* harmony import */ var _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56959);
32948
+
32879
32949
 
32880
32950
 
32881
32951
  const removeSpaces = operationId => {
@@ -32911,25 +32981,33 @@ const normalizeOperationId = (operationId, path, method) => {
32911
32981
  * This plugin also guarantees the uniqueness of all defined Operation.operationId fields,
32912
32982
  * and make sure Link.operationId fields are pointing to correct and normalized Operation.operationId fields.
32913
32983
  *
32984
+ * NOTE: this plugin is idempotent
32914
32985
  */
32915
- /* eslint-disable no-param-reassign */
32916
32986
 
32987
+ /* eslint-disable no-param-reassign */
32917
32988
  const plugin = ({
32989
+ storageField = 'x-normalized',
32918
32990
  operationIdNormalizer = normalizeOperationId
32919
- } = {}) => ({
32920
- predicates,
32921
- namespace
32922
- }) => {
32923
- const paths = [];
32991
+ } = {}) => toolbox => {
32992
+ const {
32993
+ predicates,
32994
+ ancestorLineageToJSONPointer,
32995
+ namespace
32996
+ } = toolbox;
32997
+ const pathTemplates = [];
32924
32998
  const normalizedOperations = [];
32925
32999
  const links = [];
33000
+ let storage;
32926
33001
  return {
32927
33002
  visitor: {
32928
33003
  OpenApi3_1Element: {
33004
+ enter(element) {
33005
+ storage = new _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](element, storageField, 'operation-ids');
33006
+ },
32929
33007
  leave() {
32930
33008
  // group normalized operations by normalized operationId
32931
- const normalizedOperationGroups = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(operationElement => {
32932
- return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement.operationId);
33009
+ const normalizedOperationGroups = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement => {
33010
+ return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(operationElement.operationId);
32933
33011
  }, normalizedOperations);
32934
33012
 
32935
33013
  // append incremental numerical suffixes to identical operationIds
@@ -32946,15 +33024,15 @@ const plugin = ({
32946
33024
  // rectify possibly broken Link.operationId fields
32947
33025
  links.forEach(linkElement => {
32948
33026
  if (typeof linkElement.operationId === 'undefined') return;
32949
- const linkOperationId = String((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(linkElement.operationId));
33027
+ const linkOperationId = String((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(linkElement.operationId));
32950
33028
  const operationElement = normalizedOperations.find(normalizedOperationElement => {
32951
- const originalOperationId = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(normalizedOperationElement.meta.get('originalOperationId'));
33029
+ const originalOperationId = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(normalizedOperationElement.meta.get('originalOperationId'));
32952
33030
  return originalOperationId === linkOperationId;
32953
33031
  });
32954
33032
 
32955
33033
  // Link Object doesn't need to be rectified
32956
33034
  if (typeof operationElement === 'undefined') return;
32957
- linkElement.operationId = _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__.cloneDeep.safe(operationElement.operationId);
33035
+ linkElement.operationId = _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.cloneDeep.safe(operationElement.operationId);
32958
33036
  linkElement.meta.set('originalOperationId', linkOperationId);
32959
33037
  linkElement.set('__originalOperationId', linkOperationId);
32960
33038
  });
@@ -32962,30 +33040,37 @@ const plugin = ({
32962
33040
  // cleanup the references
32963
33041
  normalizedOperations.length = 0;
32964
33042
  links.length = 0;
33043
+ storage = undefined;
32965
33044
  }
32966
33045
  },
32967
33046
  PathItemElement: {
32968
33047
  enter(pathItemElement) {
32969
33048
  // `path` meta may not be always available, e.g. in Callback Object or Components Object
32970
- const path = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])('path', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(pathItemElement.meta.get('path')));
32971
- paths.push(path);
33049
+ const pathTemplate = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])('path', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(pathItemElement.meta.get('path')));
33050
+ pathTemplates.push(pathTemplate);
32972
33051
  },
32973
33052
  leave() {
32974
- paths.pop();
33053
+ pathTemplates.pop();
32975
33054
  }
32976
33055
  },
32977
33056
  OperationElement: {
32978
- enter(operationElement) {
33057
+ enter(operationElement, key, parent, path, ancestors) {
32979
33058
  // operationId field is undefined, needs no normalization
32980
33059
  if (typeof operationElement.operationId === 'undefined') return;
33060
+ const operationJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, operationElement]);
33061
+
33062
+ // skip visiting this Operation Object if it's already normalized
33063
+ if (storage.includes(operationJSONPointer)) {
33064
+ return;
33065
+ }
32981
33066
 
32982
33067
  // cast operationId to string type
32983
- const originalOperationId = String((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement.operationId));
33068
+ const originalOperationId = String((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(operationElement.operationId));
32984
33069
  // perform operationId normalization
32985
- const path = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(paths);
33070
+ const pathTemplate = (0,ramda__WEBPACK_IMPORTED_MODULE_5__["default"])(pathTemplates);
32986
33071
  // `http-method` meta may not be always available, e.g. in Callback Object or Components Object
32987
- const method = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])('method', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(operationElement.meta.get('http-method')));
32988
- const normalizedOperationId = operationIdNormalizer(originalOperationId, path, method);
33072
+ const method = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])('method', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_2__["default"])(operationElement.meta.get('http-method')));
33073
+ const normalizedOperationId = operationIdNormalizer(originalOperationId, pathTemplate, method);
32989
33074
 
32990
33075
  // normalization is not necessary
32991
33076
  if (originalOperationId === normalizedOperationId) return;
@@ -32995,6 +33080,7 @@ const plugin = ({
32995
33080
  operationElement.set('__originalOperationId', originalOperationId);
32996
33081
  operationElement.meta.set('originalOperationId', originalOperationId);
32997
33082
  normalizedOperations.push(operationElement);
33083
+ storage.append(operationJSONPointer);
32998
33084
  }
32999
33085
  },
33000
33086
  LinkElement: {
@@ -33023,7 +33109,9 @@ __webpack_require__.r(__webpack_exports__);
33023
33109
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33024
33110
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
33025
33111
  /* harmony export */ });
33026
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87024);
33112
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87024);
33113
+ /* harmony import */ var _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56959);
33114
+
33027
33115
 
33028
33116
  /**
33029
33117
  * Override of Schema.example and Schema.examples field inside the Parameter Objects.
@@ -33036,13 +33124,27 @@ __webpack_require__.r(__webpack_exports__);
33036
33124
  *
33037
33125
  * The example value SHALL override the example provided by the schema.
33038
33126
  * Furthermore, if referencing a schema that contains an example, the examples value SHALL override the example provided by the schema.
33127
+ *
33128
+ * NOTE: this plugin is idempotent
33039
33129
  */
33040
- /* eslint-disable no-param-reassign */
33041
- const plugin = () => ({
33042
- predicates
33043
- }) => {
33130
+ const plugin = ({
33131
+ storageField = 'x-normalized'
33132
+ } = {}) => toolbox => {
33133
+ const {
33134
+ predicates,
33135
+ ancestorLineageToJSONPointer
33136
+ } = toolbox;
33137
+ let storage;
33044
33138
  return {
33045
33139
  visitor: {
33140
+ OpenApi3_1Element: {
33141
+ enter(element) {
33142
+ storage = new _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](element, storageField, 'parameter-examples');
33143
+ },
33144
+ leave() {
33145
+ storage = undefined;
33146
+ }
33147
+ },
33046
33148
  ParameterElement: {
33047
33149
  leave(parameterElement, key, parent, path, ancestors) {
33048
33150
  var _parameterElement$sch, _parameterElement$sch2;
@@ -33059,6 +33161,12 @@ const plugin = () => ({
33059
33161
  if (typeof ((_parameterElement$sch = parameterElement.schema) === null || _parameterElement$sch === void 0 ? void 0 : _parameterElement$sch.example) === 'undefined' && typeof ((_parameterElement$sch2 = parameterElement.schema) === null || _parameterElement$sch2 === void 0 ? void 0 : _parameterElement$sch2.examples) === 'undefined') {
33060
33162
  return;
33061
33163
  }
33164
+ const parameterJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, parameterElement]);
33165
+
33166
+ // skip visiting this Parameter Object if it's already normalized
33167
+ if (storage.includes(parameterJSONPointer)) {
33168
+ return;
33169
+ }
33062
33170
 
33063
33171
  /**
33064
33172
  * Parameter.examples and Schema.examples have preferences over the older
@@ -33067,13 +33175,15 @@ const plugin = () => ({
33067
33175
  if (typeof parameterElement.examples !== 'undefined' && predicates.isObjectElement(parameterElement.examples)) {
33068
33176
  // @ts-ignore
33069
33177
  const examples = parameterElement.examples.map(example => {
33070
- return _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep.safe(example.value);
33178
+ return _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep.safe(example.value);
33071
33179
  });
33072
33180
  if (typeof parameterElement.schema.examples !== 'undefined') {
33073
33181
  parameterElement.schema.set('examples', examples);
33182
+ storage.append(parameterJSONPointer);
33074
33183
  }
33075
33184
  if (typeof parameterElement.schema.example !== 'undefined') {
33076
33185
  parameterElement.schema.set('example', examples);
33186
+ storage.append(parameterJSONPointer);
33077
33187
  }
33078
33188
  return;
33079
33189
  }
@@ -33083,10 +33193,12 @@ const plugin = () => ({
33083
33193
  */
33084
33194
  if (typeof parameterElement.example !== 'undefined') {
33085
33195
  if (typeof parameterElement.schema.examples !== 'undefined') {
33086
- parameterElement.schema.set('examples', [(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(parameterElement.example)]);
33196
+ parameterElement.schema.set('examples', [(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(parameterElement.example)]);
33197
+ storage.append(parameterJSONPointer);
33087
33198
  }
33088
33199
  if (typeof parameterElement.schema.example !== 'undefined') {
33089
- parameterElement.schema.set('example', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(parameterElement.example));
33200
+ parameterElement.schema.set('example', (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(parameterElement.example));
33201
+ storage.append(parameterJSONPointer);
33090
33202
  }
33091
33203
  }
33092
33204
  }
@@ -33094,8 +33206,6 @@ const plugin = () => ({
33094
33206
  }
33095
33207
  };
33096
33208
  };
33097
- /* eslint-enable */
33098
-
33099
33209
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugin);
33100
33210
 
33101
33211
  /***/ }),
@@ -33108,11 +33218,13 @@ __webpack_require__.r(__webpack_exports__);
33108
33218
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33109
33219
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
33110
33220
  /* harmony export */ });
33111
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43022);
33112
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(52220);
33113
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59307);
33221
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43022);
33222
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52220);
33223
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(59307);
33114
33224
  /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9999);
33115
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58335);
33225
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(58335);
33226
+ /* harmony import */ var _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56959);
33227
+
33116
33228
 
33117
33229
 
33118
33230
 
@@ -33124,11 +33236,17 @@ __webpack_require__.r(__webpack_exports__);
33124
33236
  * A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item,
33125
33237
  * the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters.
33126
33238
  * A unique parameter is defined by a combination of a name and location.
33239
+ *
33240
+ * NOTE: this plugin is idempotent
33127
33241
  */
33128
33242
  /* eslint-disable no-param-reassign */
33129
- const plugin = () => ({
33130
- predicates
33131
- }) => {
33243
+ const plugin = ({
33244
+ storageField = 'x-normalized'
33245
+ } = {}) => toolbox => {
33246
+ const {
33247
+ predicates,
33248
+ ancestorLineageToJSONPointer
33249
+ } = toolbox;
33132
33250
  /**
33133
33251
  * Establishes identity between two Parameter Objects.
33134
33252
  *
@@ -33144,8 +33262,17 @@ const plugin = () => ({
33144
33262
  return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(parameter1.name) === (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(parameter2.name) && (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(parameter1.in) === (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(parameter2.in);
33145
33263
  };
33146
33264
  const pathItemParameters = [];
33265
+ let storage;
33147
33266
  return {
33148
33267
  visitor: {
33268
+ OpenApi3_1Element: {
33269
+ enter(element) {
33270
+ storage = new _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](element, storageField, 'parameters');
33271
+ },
33272
+ leave() {
33273
+ storage = undefined;
33274
+ }
33275
+ },
33149
33276
  PathItemElement: {
33150
33277
  enter(pathItemElement, key, parent, path, ancestors) {
33151
33278
  // skip visiting this Path Item
@@ -33166,18 +33293,25 @@ const plugin = () => ({
33166
33293
  }
33167
33294
  },
33168
33295
  OperationElement: {
33169
- leave(operationElement) {
33170
- const parentPathItemParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(pathItemParameters);
33296
+ leave(operationElement, key, parent, path, ancestors) {
33297
+ const parentPathItemParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(pathItemParameters);
33171
33298
 
33172
33299
  // no Path Item Object parameters to inherit from
33173
33300
  if (!Array.isArray(parentPathItemParameters) || parentPathItemParameters.length === 0) {
33174
33301
  return;
33175
33302
  }
33176
- const operationParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])([], ['parameters', 'content'], operationElement);
33303
+ const operationJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, operationElement]);
33304
+
33305
+ // skip visiting this Operation Object if it's already normalized
33306
+ if (storage.includes(operationJSONPointer)) {
33307
+ return;
33308
+ }
33309
+ const operationParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])([], ['parameters', 'content'], operationElement);
33177
33310
 
33178
33311
  // prefers the first item if two items compare equal based on the predicate
33179
- const mergedParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])(parameterEquals, [...operationParameters, ...parentPathItemParameters]);
33180
- operationElement.parameters = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_4__["default"](mergedParameters);
33312
+ const mergedParameters = (0,ramda__WEBPACK_IMPORTED_MODULE_4__["default"])(parameterEquals, [...operationParameters, ...parentPathItemParameters]);
33313
+ operationElement.parameters = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_5__["default"](mergedParameters);
33314
+ storage.append(operationJSONPointer);
33181
33315
  }
33182
33316
  }
33183
33317
  }
@@ -33197,7 +33331,9 @@ __webpack_require__.r(__webpack_exports__);
33197
33331
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
33198
33332
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
33199
33333
  /* harmony export */ });
33200
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20673);
33334
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20673);
33335
+ /* harmony import */ var _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56959);
33336
+
33201
33337
 
33202
33338
  /**
33203
33339
  * Override of Security Requirement Objects.
@@ -33208,22 +33344,30 @@ __webpack_require__.r(__webpack_exports__);
33208
33344
  * To remove a top-level security declaration, an empty array can be used.
33209
33345
  * When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object,
33210
33346
  * only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
33347
+ *
33348
+ * NOTE: this plugin is idempotent
33211
33349
  */
33212
-
33213
33350
  /* eslint-disable no-param-reassign */
33214
- const plugin = () => ({
33215
- predicates
33216
- }) => {
33351
+ const plugin = ({
33352
+ storageField = 'x-normalized'
33353
+ } = {}) => toolbox => {
33354
+ const {
33355
+ predicates,
33356
+ ancestorLineageToJSONPointer
33357
+ } = toolbox;
33217
33358
  let topLevelSecurity;
33359
+ let storage;
33218
33360
  return {
33219
33361
  visitor: {
33220
33362
  OpenApi3_1Element: {
33221
33363
  enter(openapiElement) {
33364
+ storage = new _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](openapiElement, storageField, 'security-requirements');
33222
33365
  if (predicates.isArrayElement(openapiElement.security)) {
33223
33366
  topLevelSecurity = openapiElement.security;
33224
33367
  }
33225
33368
  },
33226
33369
  leave() {
33370
+ storage = undefined;
33227
33371
  topLevelSecurity = undefined;
33228
33372
  }
33229
33373
  },
@@ -33233,11 +33377,18 @@ const plugin = () => ({
33233
33377
  if (ancestors.some(predicates.isComponentsElement)) {
33234
33378
  return;
33235
33379
  }
33380
+ const operationJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, operationElement]);
33381
+
33382
+ // skip visiting this Operation Object if it's already normalized
33383
+ if (storage.includes(operationJSONPointer)) {
33384
+ return;
33385
+ }
33236
33386
  const missingOperationLevelSecurity = typeof operationElement.security === 'undefined';
33237
33387
  const hasTopLevelSecurity = typeof topLevelSecurity !== 'undefined';
33238
33388
  if (missingOperationLevelSecurity && hasTopLevelSecurity) {
33239
33389
  var _topLevelSecurity;
33240
- operationElement.security = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_0__["default"]((_topLevelSecurity = topLevelSecurity) === null || _topLevelSecurity === void 0 ? void 0 : _topLevelSecurity.content);
33390
+ operationElement.security = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_1__["default"]((_topLevelSecurity = topLevelSecurity) === null || _topLevelSecurity === void 0 ? void 0 : _topLevelSecurity.content);
33391
+ storage.append(operationJSONPointer);
33241
33392
  }
33242
33393
  }
33243
33394
  }
@@ -33259,8 +33410,10 @@ __webpack_require__.r(__webpack_exports__);
33259
33410
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
33260
33411
  /* harmony export */ });
33261
33412
  /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87204);
33262
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60748);
33263
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84253);
33413
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60748);
33414
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84253);
33415
+ /* harmony import */ var _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56959);
33416
+
33264
33417
 
33265
33418
  /**
33266
33419
  * Override of Server Objects.
@@ -33274,32 +33427,48 @@ __webpack_require__.r(__webpack_exports__);
33274
33427
  * If an alternative server object is specified at the Path Item Object level, it will override OpenAPI.servers.
33275
33428
  * If an alternative server object is specified at the Operation Object level, it will override PathItem.servers and OpenAPI.servers respectively.
33276
33429
  */
33277
-
33278
33430
  /* eslint-disable no-param-reassign */
33279
- const plugin = () => ({
33280
- predicates,
33281
- namespace
33282
- }) => {
33431
+ const plugin = ({
33432
+ storageField = 'x-normalized'
33433
+ } = {}) => toolbox => {
33434
+ const {
33435
+ namespace,
33436
+ ancestorLineageToJSONPointer,
33437
+ predicates
33438
+ } = toolbox;
33439
+ let storage;
33283
33440
  return {
33284
33441
  visitor: {
33285
- OpenApi3_1Element(openapiElement) {
33286
- const isServersUndefined = typeof openapiElement.servers === 'undefined';
33287
- const isServersArrayElement = predicates.isArrayElement(openapiElement.servers);
33288
- const isServersEmpty = isServersArrayElement && openapiElement.servers.length === 0;
33289
- // @ts-ignore
33290
- const defaultServer = namespace.elements.Server.refract({
33291
- url: '/'
33292
- });
33293
- if (isServersUndefined || !isServersArrayElement) {
33294
- openapiElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_0__["default"]([defaultServer]);
33295
- } else if (isServersArrayElement && isServersEmpty) {
33296
- openapiElement.servers.push(defaultServer);
33442
+ OpenApi3_1Element: {
33443
+ enter(openapiElement) {
33444
+ const isServersUndefined = typeof openapiElement.servers === 'undefined';
33445
+ const isServersArrayElement = predicates.isArrayElement(openapiElement.servers);
33446
+ const isServersEmpty = isServersArrayElement && openapiElement.servers.length === 0;
33447
+ // @ts-ignore
33448
+ const defaultServer = namespace.elements.Server.refract({
33449
+ url: '/'
33450
+ });
33451
+ if (isServersUndefined || !isServersArrayElement) {
33452
+ openapiElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_0__["default"]([defaultServer]);
33453
+ } else if (isServersArrayElement && isServersEmpty) {
33454
+ openapiElement.servers.push(defaultServer);
33455
+ }
33456
+ storage = new _normalize_header_examples_NormalizeStorage_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](openapiElement, storageField, 'servers');
33457
+ },
33458
+ leave() {
33459
+ storage = undefined;
33297
33460
  }
33298
33461
  },
33299
33462
  PathItemElement(pathItemElement, key, parent, path, ancestors) {
33300
33463
  // skip visiting this Path Item
33301
33464
  if (ancestors.some(predicates.isComponentsElement)) return;
33302
33465
  if (!ancestors.some(predicates.isOpenApi3_1Element)) return;
33466
+ const pathItemJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, pathItemElement]);
33467
+
33468
+ // skip visiting this Path Item Object if it's already normalized
33469
+ if (storage.includes(pathItemJSONPointer)) {
33470
+ return;
33471
+ }
33303
33472
  const parentOpenapiElement = ancestors.find(predicates.isOpenApi3_1Element);
33304
33473
  const isServersUndefined = typeof pathItemElement.servers === 'undefined';
33305
33474
  const isServersArrayElement = predicates.isArrayElement(pathItemElement.servers);
@@ -33311,18 +33480,25 @@ const plugin = () => ({
33311
33480
  const openapiServersContent = (_parentOpenapiElement = parentOpenapiElement.servers) === null || _parentOpenapiElement === void 0 ? void 0 : _parentOpenapiElement.content;
33312
33481
  const openapiServers = openapiServersContent !== null && openapiServersContent !== void 0 ? openapiServersContent : [];
33313
33482
  if (isServersUndefined || !isServersArrayElement) {
33314
- pathItemElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_1__["default"](openapiServers);
33483
+ pathItemElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__["default"](openapiServers);
33315
33484
  } else if (isServersArrayElement && isServersEmpty) {
33316
33485
  openapiServers.forEach(server => {
33317
33486
  pathItemElement.servers.push(server);
33318
33487
  });
33319
33488
  }
33489
+ storage.append(pathItemJSONPointer);
33320
33490
  }
33321
33491
  },
33322
33492
  OperationElement(operationElement, key, parent, path, ancestors) {
33323
33493
  // skip visiting this Operation
33324
33494
  if (ancestors.some(predicates.isComponentsElement)) return;
33325
33495
  if (!ancestors.some(predicates.isOpenApi3_1Element)) return;
33496
+ const operationJSONPointer = ancestorLineageToJSONPointer([...ancestors, parent, operationElement]);
33497
+
33498
+ // skip visiting this Operation Object if it's already normalized
33499
+ if (storage.includes(operationJSONPointer)) {
33500
+ return;
33501
+ }
33326
33502
 
33327
33503
  // @TODO(vladimir.gorej@gmail.com): can be replaced by Array.prototype.findLast in future
33328
33504
  const parentPathItemElement = [...ancestors].reverse().find(predicates.isPathItemElement);
@@ -33335,12 +33511,13 @@ const plugin = () => ({
33335
33511
  const pathItemServers = pathItemServersContent !== null && pathItemServersContent !== void 0 ? pathItemServersContent : [];
33336
33512
  if (isServersUndefined || !isServersArrayElement) {
33337
33513
  // duplicate parent PathItem.servers into this Operation object
33338
- operationElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__["default"](pathItemServers);
33514
+ operationElement.servers = new _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__["default"](pathItemServers);
33339
33515
  } else if (isServersArrayElement && isServersEmpty) {
33340
33516
  pathItemServers.forEach(server => {
33341
33517
  operationElement.servers.push(server);
33342
33518
  });
33343
33519
  }
33520
+ storage.append(operationJSONPointer);
33344
33521
  }
33345
33522
  }
33346
33523
  }
@@ -34149,30 +34326,55 @@ __webpack_require__.r(__webpack_exports__);
34149
34326
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34150
34327
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
34151
34328
  /* harmony export */ });
34152
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1667);
34153
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33501);
34154
- /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(85536);
34155
- /* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70281);
34156
- /* harmony import */ var _namespace_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41544);
34329
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33501);
34330
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9999);
34331
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1667);
34332
+ /* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60672);
34333
+ /* harmony import */ var _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85536);
34334
+ /* harmony import */ var _predicates_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(70281);
34335
+ /* harmony import */ var _namespace_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41544);
34336
+
34157
34337
 
34158
34338
 
34159
34339
 
34160
34340
 
34341
+ /**
34342
+ * Translates visitor ancestor lineage to a JSON Pointer tokens.
34343
+ * Ancestor lineage is constructed of following visitor method arguments:
34344
+ *
34345
+ * - ancestors
34346
+ * - parent
34347
+ * - element
34348
+ */
34349
+ const ancestorLineageToJSONPointer = elementPath => {
34350
+ const jsonPointerTokens = elementPath.reduce((path, element, index) => {
34351
+ if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isMemberElement)(element)) {
34352
+ const token = String((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element.key));
34353
+ path.push(token);
34354
+ } else if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isArrayElement)(elementPath[index - 2])) {
34355
+ const token = String(elementPath[index - 2].content.indexOf(element));
34356
+ path.push(token);
34357
+ }
34358
+ return path;
34359
+ }, []);
34360
+ return (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_2__["default"])(jsonPointerTokens);
34361
+ };
34161
34362
  const createToolbox = () => {
34162
- const namespace = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.createNamespace)(_namespace_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]);
34363
+ const namespace = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.createNamespace)(_namespace_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]);
34163
34364
  const predicates = {
34164
- ..._predicates_mjs__WEBPACK_IMPORTED_MODULE_2__,
34165
- isElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isElement,
34166
- isStringElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isStringElement,
34167
- isArrayElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isArrayElement,
34168
- isObjectElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isObjectElement,
34169
- isMemberElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isMemberElement,
34170
- isServersElement: _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_4__.isServersElement,
34171
- includesClasses: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.includesClasses,
34172
- hasElementSourceMap: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap
34365
+ ..._predicates_mjs__WEBPACK_IMPORTED_MODULE_5__,
34366
+ isElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isElement,
34367
+ isStringElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isStringElement,
34368
+ isArrayElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isArrayElement,
34369
+ isObjectElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isObjectElement,
34370
+ isMemberElement: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.isMemberElement,
34371
+ isServersElement: _swagger_api_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_6__.isServersElement,
34372
+ includesClasses: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.includesClasses,
34373
+ hasElementSourceMap: _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.hasElementSourceMap
34173
34374
  };
34174
34375
  return {
34175
34376
  predicates,
34377
+ ancestorLineageToJSONPointer,
34176
34378
  namespace
34177
34379
  };
34178
34380
  };
@@ -41071,52 +41273,6 @@ var PatchError = /** @class */ (function (_super) {
41071
41273
 
41072
41274
 
41073
41275
 
41074
- /***/ }),
41075
-
41076
- /***/ 58270:
41077
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
41078
-
41079
- "use strict";
41080
- __webpack_require__.r(__webpack_exports__);
41081
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
41082
- /* harmony export */ isPlainObject: () => (/* binding */ isPlainObject)
41083
- /* harmony export */ });
41084
- /*!
41085
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
41086
- *
41087
- * Copyright (c) 2014-2017, Jon Schlinkert.
41088
- * Released under the MIT License.
41089
- */
41090
-
41091
- function isObject(o) {
41092
- return Object.prototype.toString.call(o) === '[object Object]';
41093
- }
41094
-
41095
- function isPlainObject(o) {
41096
- var ctor,prot;
41097
-
41098
- if (isObject(o) === false) return false;
41099
-
41100
- // If has modified constructor
41101
- ctor = o.constructor;
41102
- if (ctor === undefined) return true;
41103
-
41104
- // If has modified prototype
41105
- prot = ctor.prototype;
41106
- if (isObject(prot) === false) return false;
41107
-
41108
- // If constructor does not have an Object-specific method
41109
- if (prot.hasOwnProperty('isPrototypeOf') === false) {
41110
- return false;
41111
- }
41112
-
41113
- // Most likely a plain Object
41114
- return true;
41115
- }
41116
-
41117
-
41118
-
41119
-
41120
41276
  /***/ }),
41121
41277
 
41122
41278
  /***/ 20382:
@@ -45311,15 +45467,15 @@ __webpack_require__.r(__webpack_exports__);
45311
45467
  function grammar() {
45312
45468
  // ```
45313
45469
  // SUMMARY
45314
- // rules = 20
45470
+ // rules = 19
45315
45471
  // udts = 0
45316
- // opcodes = 113
45472
+ // opcodes = 102
45317
45473
  // --- ABNF original opcodes
45318
- // ALT = 10
45474
+ // ALT = 9
45319
45475
  // CAT = 7
45320
45476
  // REP = 11
45321
45477
  // RNM = 31
45322
- // TLS = 51
45478
+ // TLS = 41
45323
45479
  // TBS = 0
45324
45480
  // TRG = 3
45325
45481
  // --- SABNF superset opcodes
@@ -45430,27 +45586,21 @@ function grammar() {
45430
45586
  isBkr: false
45431
45587
  };
45432
45588
  this.rules[16] = {
45433
- name: 'sub-delims-no-slash',
45434
- lower: 'sub-delims-no-slash',
45435
- index: 16,
45436
- isBkr: false
45437
- };
45438
- this.rules[17] = {
45439
45589
  name: 'ALPHA',
45440
45590
  lower: 'alpha',
45441
- index: 17,
45591
+ index: 16,
45442
45592
  isBkr: false
45443
45593
  };
45444
- this.rules[18] = {
45594
+ this.rules[17] = {
45445
45595
  name: 'DIGIT',
45446
45596
  lower: 'digit',
45447
- index: 18,
45597
+ index: 17,
45448
45598
  isBkr: false
45449
45599
  };
45450
- this.rules[19] = {
45600
+ this.rules[18] = {
45451
45601
  name: 'HEXDIG',
45452
45602
  lower: 'hexdig',
45453
- index: 19,
45603
+ index: 18,
45454
45604
  isBkr: false
45455
45605
  };
45456
45606
 
@@ -45714,8 +45864,8 @@ function grammar() {
45714
45864
  }; // RNM(pct-encoded)
45715
45865
  this.rules[10].opcodes[4] = {
45716
45866
  type: 4,
45717
- index: 16
45718
- }; // RNM(sub-delims-no-slash)
45867
+ index: 15
45868
+ }; // RNM(sub-delims)
45719
45869
  this.rules[10].opcodes[5] = {
45720
45870
  type: 7,
45721
45871
  string: [58]
@@ -45765,8 +45915,8 @@ function grammar() {
45765
45915
  }; // RNM(pct-encoded)
45766
45916
  this.rules[12].opcodes[4] = {
45767
45917
  type: 4,
45768
- index: 16
45769
- }; // RNM(sub-delims-no-slash)
45918
+ index: 15
45919
+ }; // RNM(sub-delims)
45770
45920
  this.rules[12].opcodes[5] = {
45771
45921
  type: 7,
45772
45922
  string: [58]
@@ -45784,11 +45934,11 @@ function grammar() {
45784
45934
  }; // ALT
45785
45935
  this.rules[13].opcodes[1] = {
45786
45936
  type: 4,
45787
- index: 17
45937
+ index: 16
45788
45938
  }; // RNM(ALPHA)
45789
45939
  this.rules[13].opcodes[2] = {
45790
45940
  type: 4,
45791
- index: 18
45941
+ index: 17
45792
45942
  }; // RNM(DIGIT)
45793
45943
  this.rules[13].opcodes[3] = {
45794
45944
  type: 7,
@@ -45819,11 +45969,11 @@ function grammar() {
45819
45969
  }; // TLS
45820
45970
  this.rules[14].opcodes[2] = {
45821
45971
  type: 4,
45822
- index: 19
45972
+ index: 18
45823
45973
  }; // RNM(HEXDIG)
45824
45974
  this.rules[14].opcodes[3] = {
45825
45975
  type: 4,
45826
- index: 19
45976
+ index: 18
45827
45977
  }; // RNM(HEXDIG)
45828
45978
 
45829
45979
  /* sub-delims */
@@ -45877,109 +46027,62 @@ function grammar() {
45877
46027
  string: [61]
45878
46028
  }; // TLS
45879
46029
 
45880
- /* sub-delims-no-slash */
46030
+ /* ALPHA */
45881
46031
  this.rules[16].opcodes = [];
45882
46032
  this.rules[16].opcodes[0] = {
45883
- type: 1,
45884
- children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
45885
- }; // ALT
45886
- this.rules[16].opcodes[1] = {
45887
- type: 7,
45888
- string: [33]
45889
- }; // TLS
45890
- this.rules[16].opcodes[2] = {
45891
- type: 7,
45892
- string: [36]
45893
- }; // TLS
45894
- this.rules[16].opcodes[3] = {
45895
- type: 7,
45896
- string: [38]
45897
- }; // TLS
45898
- this.rules[16].opcodes[4] = {
45899
- type: 7,
45900
- string: [39]
45901
- }; // TLS
45902
- this.rules[16].opcodes[5] = {
45903
- type: 7,
45904
- string: [40]
45905
- }; // TLS
45906
- this.rules[16].opcodes[6] = {
45907
- type: 7,
45908
- string: [41]
45909
- }; // TLS
45910
- this.rules[16].opcodes[7] = {
45911
- type: 7,
45912
- string: [42]
45913
- }; // TLS
45914
- this.rules[16].opcodes[8] = {
45915
- type: 7,
45916
- string: [43]
45917
- }; // TLS
45918
- this.rules[16].opcodes[9] = {
45919
- type: 7,
45920
- string: [44]
45921
- }; // TLS
45922
- this.rules[16].opcodes[10] = {
45923
- type: 7,
45924
- string: [59]
45925
- }; // TLS
45926
-
45927
- /* ALPHA */
45928
- this.rules[17].opcodes = [];
45929
- this.rules[17].opcodes[0] = {
45930
46033
  type: 1,
45931
46034
  children: [1, 2]
45932
46035
  }; // ALT
45933
- this.rules[17].opcodes[1] = {
46036
+ this.rules[16].opcodes[1] = {
45934
46037
  type: 5,
45935
46038
  min: 65,
45936
46039
  max: 90
45937
46040
  }; // TRG
45938
- this.rules[17].opcodes[2] = {
46041
+ this.rules[16].opcodes[2] = {
45939
46042
  type: 5,
45940
46043
  min: 97,
45941
46044
  max: 122
45942
46045
  }; // TRG
45943
46046
 
45944
46047
  /* DIGIT */
45945
- this.rules[18].opcodes = [];
45946
- this.rules[18].opcodes[0] = {
46048
+ this.rules[17].opcodes = [];
46049
+ this.rules[17].opcodes[0] = {
45947
46050
  type: 5,
45948
46051
  min: 48,
45949
46052
  max: 57
45950
46053
  }; // TRG
45951
46054
 
45952
46055
  /* HEXDIG */
45953
- this.rules[19].opcodes = [];
45954
- this.rules[19].opcodes[0] = {
46056
+ this.rules[18].opcodes = [];
46057
+ this.rules[18].opcodes[0] = {
45955
46058
  type: 1,
45956
46059
  children: [1, 2, 3, 4, 5, 6, 7]
45957
46060
  }; // ALT
45958
- this.rules[19].opcodes[1] = {
46061
+ this.rules[18].opcodes[1] = {
45959
46062
  type: 4,
45960
- index: 18
46063
+ index: 17
45961
46064
  }; // RNM(DIGIT)
45962
- this.rules[19].opcodes[2] = {
46065
+ this.rules[18].opcodes[2] = {
45963
46066
  type: 7,
45964
46067
  string: [97]
45965
46068
  }; // TLS
45966
- this.rules[19].opcodes[3] = {
46069
+ this.rules[18].opcodes[3] = {
45967
46070
  type: 7,
45968
46071
  string: [98]
45969
46072
  }; // TLS
45970
- this.rules[19].opcodes[4] = {
46073
+ this.rules[18].opcodes[4] = {
45971
46074
  type: 7,
45972
46075
  string: [99]
45973
46076
  }; // TLS
45974
- this.rules[19].opcodes[5] = {
46077
+ this.rules[18].opcodes[5] = {
45975
46078
  type: 7,
45976
46079
  string: [100]
45977
46080
  }; // TLS
45978
- this.rules[19].opcodes[6] = {
46081
+ this.rules[18].opcodes[6] = {
45979
46082
  type: 7,
45980
46083
  string: [101]
45981
46084
  }; // TLS
45982
- this.rules[19].opcodes[7] = {
46085
+ this.rules[18].opcodes[7] = {
45983
46086
  type: 7,
45984
46087
  string: [102]
45985
46088
  }; // TLS
@@ -45998,17 +46101,15 @@ function grammar() {
45998
46101
  str += "fragment-literal = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" / \"/\" / \"?\" )\n";
45999
46102
  str += "fragment-marker = \"#\"\n";
46000
46103
  str += "slash = \"/\"\n";
46001
- str += "path-literal = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\n";
46104
+ str += "path-literal = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" )\n";
46002
46105
  str += "template-expression = \"{\" template-expression-param-name \"}\"\n";
46003
- str += "template-expression-param-name = 1*( unreserved / pct-encoded / sub-delims-no-slash / \":\" / \"@\" )\n";
46106
+ str += "template-expression-param-name = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" )\n";
46004
46107
  str += "\n";
46005
46108
  str += "; Characters definitions (from RFC 3986)\n";
46006
46109
  str += "unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n";
46007
46110
  str += "pct-encoded = \"%\" HEXDIG HEXDIG\n";
46008
46111
  str += "sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n";
46009
46112
  str += " / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n";
46010
- str += "sub-delims-no-slash = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n";
46011
- str += " / \"*\" / \"+\" / \",\" / \";\"\n";
46012
46113
  str += "ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n";
46013
46114
  str += "DIGIT = %x30-39 ; 0-9\n";
46014
46115
  str += "HEXDIG = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\n";
@@ -46040,10 +46141,10 @@ const encodePathComponent = component => {
46040
46141
  if (isEncoded(component)) {
46041
46142
  return component;
46042
46143
  }
46043
- return encodeURIComponent(component);
46144
+ return encodeURIComponent(component).replace(/%5B/g, '[').replace(/%5D/g, ']');
46044
46145
  };
46045
46146
  const significantTypes = ['slash', 'path-literal', 'query-marker', 'query-literal', 'template-expression-param-name'];
46046
- const resolve = (pathTemplate, parameters = {}, options = {}) => {
46147
+ const resolve = (pathTemplate, parameters, options = {}) => {
46047
46148
  const defaultOptions = {
46048
46149
  encoder: encodePathComponent
46049
46150
  };
@@ -46057,7 +46158,7 @@ const resolve = (pathTemplate, parameters = {}, options = {}) => {
46057
46158
  parseResult.ast.translate(parts);
46058
46159
  const resolvedParts = parts.filter(([type]) => significantTypes.includes(type)).map(([type, value]) => {
46059
46160
  if (type === 'template-expression-param-name') {
46060
- return Object.hasOwn(parameters, value) ? mergedOptions.encoder(parameters[value]) : `{${value}}`;
46161
+ return Object.hasOwn(parameters, value) ? mergedOptions.encoder(parameters[value], value) : `{${value}}`;
46061
46162
  }
46062
46163
  return value;
46063
46164
  });
@@ -46103,6 +46204,819 @@ const test = (str, {
46103
46204
 
46104
46205
  /***/ }),
46105
46206
 
46207
+ /***/ 29646:
46208
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46209
+
46210
+ "use strict";
46211
+ __webpack_require__.r(__webpack_exports__);
46212
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46213
+ /* harmony export */ Grammar: () => (/* reexport safe */ _server_url_templating_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]),
46214
+ /* harmony export */ encodeServerVariable: () => (/* reexport safe */ _substitute_mjs__WEBPACK_IMPORTED_MODULE_3__.encodeServerVariable),
46215
+ /* harmony export */ parse: () => (/* reexport safe */ _parse_index_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
46216
+ /* harmony export */ substitute: () => (/* reexport safe */ _substitute_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
46217
+ /* harmony export */ test: () => (/* reexport safe */ _test_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])
46218
+ /* harmony export */ });
46219
+ /* harmony import */ var _server_url_templating_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77527);
46220
+ /* harmony import */ var _test_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3406);
46221
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39790);
46222
+ /* harmony import */ var _substitute_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16254);
46223
+
46224
+
46225
+
46226
+
46227
+
46228
+ /***/ }),
46229
+
46230
+ /***/ 31189:
46231
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46232
+
46233
+ "use strict";
46234
+ __webpack_require__.r(__webpack_exports__);
46235
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46236
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46237
+ /* harmony export */ });
46238
+ /* harmony import */ var _apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16646);
46239
+
46240
+ const literals = (state, chars, phraseIndex, phraseLength, data) => {
46241
+ if (state === _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_PRE) {
46242
+ if (Array.isArray(data) === false) {
46243
+ throw new Error("parser's user data must be an array");
46244
+ }
46245
+ data.push(['literals', _apg_lite__WEBPACK_IMPORTED_MODULE_0__.utilities.charsToString(chars, phraseIndex, phraseLength)]);
46246
+ }
46247
+ return _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_OK;
46248
+ };
46249
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (literals);
46250
+
46251
+ /***/ }),
46252
+
46253
+ /***/ 20071:
46254
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46255
+
46256
+ "use strict";
46257
+ __webpack_require__.r(__webpack_exports__);
46258
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46259
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46260
+ /* harmony export */ });
46261
+ /* harmony import */ var _apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16646);
46262
+
46263
+ const serverUrlTemplate = (state, chars, phraseIndex, phraseLength, data) => {
46264
+ if (state === _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_PRE) {
46265
+ if (Array.isArray(data) === false) {
46266
+ throw new Error("parser's user data must be an array");
46267
+ }
46268
+ data.push(['server-url-template', _apg_lite__WEBPACK_IMPORTED_MODULE_0__.utilities.charsToString(chars, phraseIndex, phraseLength)]);
46269
+ }
46270
+ return _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_OK;
46271
+ };
46272
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (serverUrlTemplate);
46273
+
46274
+ /***/ }),
46275
+
46276
+ /***/ 23859:
46277
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46278
+
46279
+ "use strict";
46280
+ __webpack_require__.r(__webpack_exports__);
46281
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46282
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46283
+ /* harmony export */ });
46284
+ /* harmony import */ var _apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16646);
46285
+
46286
+ const serverVariableName = (state, chars, phraseIndex, phraseLength, data) => {
46287
+ if (state === _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_PRE) {
46288
+ if (Array.isArray(data) === false) {
46289
+ throw new Error("parser's user data must be an array");
46290
+ }
46291
+ data.push(['server-variable-name', _apg_lite__WEBPACK_IMPORTED_MODULE_0__.utilities.charsToString(chars, phraseIndex, phraseLength)]);
46292
+ }
46293
+ return _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_OK;
46294
+ };
46295
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (serverVariableName);
46296
+
46297
+ /***/ }),
46298
+
46299
+ /***/ 97837:
46300
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46301
+
46302
+ "use strict";
46303
+ __webpack_require__.r(__webpack_exports__);
46304
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46305
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46306
+ /* harmony export */ });
46307
+ /* harmony import */ var _apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16646);
46308
+
46309
+ const serverVariable = (state, chars, phraseIndex, phraseLength, data) => {
46310
+ if (state === _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_PRE) {
46311
+ if (Array.isArray(data) === false) {
46312
+ throw new Error("parser's user data must be an array");
46313
+ }
46314
+ data.push(['server-variable', _apg_lite__WEBPACK_IMPORTED_MODULE_0__.utilities.charsToString(chars, phraseIndex, phraseLength)]);
46315
+ }
46316
+ return _apg_lite__WEBPACK_IMPORTED_MODULE_0__.identifiers.SEM_OK;
46317
+ };
46318
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (serverVariable);
46319
+
46320
+ /***/ }),
46321
+
46322
+ /***/ 39790:
46323
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46324
+
46325
+ "use strict";
46326
+ __webpack_require__.r(__webpack_exports__);
46327
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46328
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46329
+ /* harmony export */ });
46330
+ /* harmony import */ var _apg_lite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16646);
46331
+ /* harmony import */ var _server_url_templating_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(77527);
46332
+ /* harmony import */ var _callbacks_server_url_template_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20071);
46333
+ /* harmony import */ var _callbacks_server_variable_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(97837);
46334
+ /* harmony import */ var _callbacks_server_variable_name_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23859);
46335
+ /* harmony import */ var _callbacks_literals_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31189);
46336
+
46337
+
46338
+
46339
+
46340
+
46341
+
46342
+ const grammar = new _server_url_templating_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
46343
+ const parse = serverURLTemplate => {
46344
+ const parser = new _apg_lite__WEBPACK_IMPORTED_MODULE_0__.Parser();
46345
+ parser.ast = new _apg_lite__WEBPACK_IMPORTED_MODULE_0__.Ast();
46346
+ parser.ast.callbacks['server-url-template'] = _callbacks_server_url_template_mjs__WEBPACK_IMPORTED_MODULE_1__["default"];
46347
+ parser.ast.callbacks['server-variable'] = _callbacks_server_variable_mjs__WEBPACK_IMPORTED_MODULE_2__["default"];
46348
+ parser.ast.callbacks['server-variable-name'] = _callbacks_server_variable_name_mjs__WEBPACK_IMPORTED_MODULE_3__["default"];
46349
+ parser.ast.callbacks['literals'] = _callbacks_literals_mjs__WEBPACK_IMPORTED_MODULE_4__["default"];
46350
+ const result = parser.parse(grammar, 'server-url-template', serverURLTemplate);
46351
+ return {
46352
+ result,
46353
+ ast: parser.ast
46354
+ };
46355
+ };
46356
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
46357
+
46358
+ /***/ }),
46359
+
46360
+ /***/ 77527:
46361
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46362
+
46363
+ "use strict";
46364
+ __webpack_require__.r(__webpack_exports__);
46365
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46366
+ /* harmony export */ "default": () => (/* binding */ grammar)
46367
+ /* harmony export */ });
46368
+ // copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
46369
+ // license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
46370
+ //
46371
+ // Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
46372
+ function grammar() {
46373
+ // ```
46374
+ // SUMMARY
46375
+ // rules = 12
46376
+ // udts = 0
46377
+ // opcodes = 87
46378
+ // --- ABNF original opcodes
46379
+ // ALT = 9
46380
+ // CAT = 2
46381
+ // REP = 3
46382
+ // RNM = 14
46383
+ // TLS = 26
46384
+ // TBS = 6
46385
+ // TRG = 27
46386
+ // --- SABNF superset opcodes
46387
+ // UDT = 0
46388
+ // AND = 0
46389
+ // NOT = 0
46390
+ // characters = [33 - 1114109]
46391
+ // ```
46392
+ /* OBJECT IDENTIFIER (for internal parser use) */
46393
+ this.grammarObject = 'grammarObject';
46394
+
46395
+ /* RULES */
46396
+ this.rules = [];
46397
+ this.rules[0] = {
46398
+ name: 'server-url-template',
46399
+ lower: 'server-url-template',
46400
+ index: 0,
46401
+ isBkr: false
46402
+ };
46403
+ this.rules[1] = {
46404
+ name: 'server-variable',
46405
+ lower: 'server-variable',
46406
+ index: 1,
46407
+ isBkr: false
46408
+ };
46409
+ this.rules[2] = {
46410
+ name: 'server-variable-name',
46411
+ lower: 'server-variable-name',
46412
+ index: 2,
46413
+ isBkr: false
46414
+ };
46415
+ this.rules[3] = {
46416
+ name: 'literals',
46417
+ lower: 'literals',
46418
+ index: 3,
46419
+ isBkr: false
46420
+ };
46421
+ this.rules[4] = {
46422
+ name: 'ALPHA',
46423
+ lower: 'alpha',
46424
+ index: 4,
46425
+ isBkr: false
46426
+ };
46427
+ this.rules[5] = {
46428
+ name: 'DIGIT',
46429
+ lower: 'digit',
46430
+ index: 5,
46431
+ isBkr: false
46432
+ };
46433
+ this.rules[6] = {
46434
+ name: 'HEXDIG',
46435
+ lower: 'hexdig',
46436
+ index: 6,
46437
+ isBkr: false
46438
+ };
46439
+ this.rules[7] = {
46440
+ name: 'pct-encoded',
46441
+ lower: 'pct-encoded',
46442
+ index: 7,
46443
+ isBkr: false
46444
+ };
46445
+ this.rules[8] = {
46446
+ name: 'unreserved',
46447
+ lower: 'unreserved',
46448
+ index: 8,
46449
+ isBkr: false
46450
+ };
46451
+ this.rules[9] = {
46452
+ name: 'sub-delims',
46453
+ lower: 'sub-delims',
46454
+ index: 9,
46455
+ isBkr: false
46456
+ };
46457
+ this.rules[10] = {
46458
+ name: 'ucschar',
46459
+ lower: 'ucschar',
46460
+ index: 10,
46461
+ isBkr: false
46462
+ };
46463
+ this.rules[11] = {
46464
+ name: 'iprivate',
46465
+ lower: 'iprivate',
46466
+ index: 11,
46467
+ isBkr: false
46468
+ };
46469
+
46470
+ /* UDTS */
46471
+ this.udts = [];
46472
+
46473
+ /* OPCODES */
46474
+ /* server-url-template */
46475
+ this.rules[0].opcodes = [];
46476
+ this.rules[0].opcodes[0] = {
46477
+ type: 3,
46478
+ min: 1,
46479
+ max: Infinity
46480
+ }; // REP
46481
+ this.rules[0].opcodes[1] = {
46482
+ type: 1,
46483
+ children: [2, 3]
46484
+ }; // ALT
46485
+ this.rules[0].opcodes[2] = {
46486
+ type: 4,
46487
+ index: 3
46488
+ }; // RNM(literals)
46489
+ this.rules[0].opcodes[3] = {
46490
+ type: 4,
46491
+ index: 1
46492
+ }; // RNM(server-variable)
46493
+
46494
+ /* server-variable */
46495
+ this.rules[1].opcodes = [];
46496
+ this.rules[1].opcodes[0] = {
46497
+ type: 2,
46498
+ children: [1, 2, 3]
46499
+ }; // CAT
46500
+ this.rules[1].opcodes[1] = {
46501
+ type: 7,
46502
+ string: [123]
46503
+ }; // TLS
46504
+ this.rules[1].opcodes[2] = {
46505
+ type: 4,
46506
+ index: 2
46507
+ }; // RNM(server-variable-name)
46508
+ this.rules[1].opcodes[3] = {
46509
+ type: 7,
46510
+ string: [125]
46511
+ }; // TLS
46512
+
46513
+ /* server-variable-name */
46514
+ this.rules[2].opcodes = [];
46515
+ this.rules[2].opcodes[0] = {
46516
+ type: 3,
46517
+ min: 1,
46518
+ max: Infinity
46519
+ }; // REP
46520
+ this.rules[2].opcodes[1] = {
46521
+ type: 1,
46522
+ children: [2, 3, 4, 5, 6]
46523
+ }; // ALT
46524
+ this.rules[2].opcodes[2] = {
46525
+ type: 4,
46526
+ index: 8
46527
+ }; // RNM(unreserved)
46528
+ this.rules[2].opcodes[3] = {
46529
+ type: 4,
46530
+ index: 7
46531
+ }; // RNM(pct-encoded)
46532
+ this.rules[2].opcodes[4] = {
46533
+ type: 4,
46534
+ index: 9
46535
+ }; // RNM(sub-delims)
46536
+ this.rules[2].opcodes[5] = {
46537
+ type: 7,
46538
+ string: [58]
46539
+ }; // TLS
46540
+ this.rules[2].opcodes[6] = {
46541
+ type: 7,
46542
+ string: [64]
46543
+ }; // TLS
46544
+
46545
+ /* literals */
46546
+ this.rules[3].opcodes = [];
46547
+ this.rules[3].opcodes[0] = {
46548
+ type: 3,
46549
+ min: 1,
46550
+ max: Infinity
46551
+ }; // REP
46552
+ this.rules[3].opcodes[1] = {
46553
+ type: 1,
46554
+ children: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
46555
+ }; // ALT
46556
+ this.rules[3].opcodes[2] = {
46557
+ type: 6,
46558
+ string: [33]
46559
+ }; // TBS
46560
+ this.rules[3].opcodes[3] = {
46561
+ type: 5,
46562
+ min: 35,
46563
+ max: 36
46564
+ }; // TRG
46565
+ this.rules[3].opcodes[4] = {
46566
+ type: 6,
46567
+ string: [38]
46568
+ }; // TBS
46569
+ this.rules[3].opcodes[5] = {
46570
+ type: 5,
46571
+ min: 40,
46572
+ max: 59
46573
+ }; // TRG
46574
+ this.rules[3].opcodes[6] = {
46575
+ type: 6,
46576
+ string: [61]
46577
+ }; // TBS
46578
+ this.rules[3].opcodes[7] = {
46579
+ type: 5,
46580
+ min: 63,
46581
+ max: 91
46582
+ }; // TRG
46583
+ this.rules[3].opcodes[8] = {
46584
+ type: 6,
46585
+ string: [93]
46586
+ }; // TBS
46587
+ this.rules[3].opcodes[9] = {
46588
+ type: 6,
46589
+ string: [95]
46590
+ }; // TBS
46591
+ this.rules[3].opcodes[10] = {
46592
+ type: 5,
46593
+ min: 97,
46594
+ max: 122
46595
+ }; // TRG
46596
+ this.rules[3].opcodes[11] = {
46597
+ type: 6,
46598
+ string: [126]
46599
+ }; // TBS
46600
+ this.rules[3].opcodes[12] = {
46601
+ type: 4,
46602
+ index: 10
46603
+ }; // RNM(ucschar)
46604
+ this.rules[3].opcodes[13] = {
46605
+ type: 4,
46606
+ index: 11
46607
+ }; // RNM(iprivate)
46608
+ this.rules[3].opcodes[14] = {
46609
+ type: 4,
46610
+ index: 7
46611
+ }; // RNM(pct-encoded)
46612
+
46613
+ /* ALPHA */
46614
+ this.rules[4].opcodes = [];
46615
+ this.rules[4].opcodes[0] = {
46616
+ type: 1,
46617
+ children: [1, 2]
46618
+ }; // ALT
46619
+ this.rules[4].opcodes[1] = {
46620
+ type: 5,
46621
+ min: 65,
46622
+ max: 90
46623
+ }; // TRG
46624
+ this.rules[4].opcodes[2] = {
46625
+ type: 5,
46626
+ min: 97,
46627
+ max: 122
46628
+ }; // TRG
46629
+
46630
+ /* DIGIT */
46631
+ this.rules[5].opcodes = [];
46632
+ this.rules[5].opcodes[0] = {
46633
+ type: 5,
46634
+ min: 48,
46635
+ max: 57
46636
+ }; // TRG
46637
+
46638
+ /* HEXDIG */
46639
+ this.rules[6].opcodes = [];
46640
+ this.rules[6].opcodes[0] = {
46641
+ type: 1,
46642
+ children: [1, 2, 3, 4, 5, 6, 7]
46643
+ }; // ALT
46644
+ this.rules[6].opcodes[1] = {
46645
+ type: 4,
46646
+ index: 5
46647
+ }; // RNM(DIGIT)
46648
+ this.rules[6].opcodes[2] = {
46649
+ type: 7,
46650
+ string: [97]
46651
+ }; // TLS
46652
+ this.rules[6].opcodes[3] = {
46653
+ type: 7,
46654
+ string: [98]
46655
+ }; // TLS
46656
+ this.rules[6].opcodes[4] = {
46657
+ type: 7,
46658
+ string: [99]
46659
+ }; // TLS
46660
+ this.rules[6].opcodes[5] = {
46661
+ type: 7,
46662
+ string: [100]
46663
+ }; // TLS
46664
+ this.rules[6].opcodes[6] = {
46665
+ type: 7,
46666
+ string: [101]
46667
+ }; // TLS
46668
+ this.rules[6].opcodes[7] = {
46669
+ type: 7,
46670
+ string: [102]
46671
+ }; // TLS
46672
+
46673
+ /* pct-encoded */
46674
+ this.rules[7].opcodes = [];
46675
+ this.rules[7].opcodes[0] = {
46676
+ type: 2,
46677
+ children: [1, 2, 3]
46678
+ }; // CAT
46679
+ this.rules[7].opcodes[1] = {
46680
+ type: 7,
46681
+ string: [37]
46682
+ }; // TLS
46683
+ this.rules[7].opcodes[2] = {
46684
+ type: 4,
46685
+ index: 6
46686
+ }; // RNM(HEXDIG)
46687
+ this.rules[7].opcodes[3] = {
46688
+ type: 4,
46689
+ index: 6
46690
+ }; // RNM(HEXDIG)
46691
+
46692
+ /* unreserved */
46693
+ this.rules[8].opcodes = [];
46694
+ this.rules[8].opcodes[0] = {
46695
+ type: 1,
46696
+ children: [1, 2, 3, 4, 5, 6]
46697
+ }; // ALT
46698
+ this.rules[8].opcodes[1] = {
46699
+ type: 4,
46700
+ index: 4
46701
+ }; // RNM(ALPHA)
46702
+ this.rules[8].opcodes[2] = {
46703
+ type: 4,
46704
+ index: 5
46705
+ }; // RNM(DIGIT)
46706
+ this.rules[8].opcodes[3] = {
46707
+ type: 7,
46708
+ string: [45]
46709
+ }; // TLS
46710
+ this.rules[8].opcodes[4] = {
46711
+ type: 7,
46712
+ string: [46]
46713
+ }; // TLS
46714
+ this.rules[8].opcodes[5] = {
46715
+ type: 7,
46716
+ string: [95]
46717
+ }; // TLS
46718
+ this.rules[8].opcodes[6] = {
46719
+ type: 7,
46720
+ string: [126]
46721
+ }; // TLS
46722
+
46723
+ /* sub-delims */
46724
+ this.rules[9].opcodes = [];
46725
+ this.rules[9].opcodes[0] = {
46726
+ type: 1,
46727
+ children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
46728
+ }; // ALT
46729
+ this.rules[9].opcodes[1] = {
46730
+ type: 7,
46731
+ string: [33]
46732
+ }; // TLS
46733
+ this.rules[9].opcodes[2] = {
46734
+ type: 7,
46735
+ string: [36]
46736
+ }; // TLS
46737
+ this.rules[9].opcodes[3] = {
46738
+ type: 7,
46739
+ string: [38]
46740
+ }; // TLS
46741
+ this.rules[9].opcodes[4] = {
46742
+ type: 7,
46743
+ string: [39]
46744
+ }; // TLS
46745
+ this.rules[9].opcodes[5] = {
46746
+ type: 7,
46747
+ string: [40]
46748
+ }; // TLS
46749
+ this.rules[9].opcodes[6] = {
46750
+ type: 7,
46751
+ string: [41]
46752
+ }; // TLS
46753
+ this.rules[9].opcodes[7] = {
46754
+ type: 7,
46755
+ string: [42]
46756
+ }; // TLS
46757
+ this.rules[9].opcodes[8] = {
46758
+ type: 7,
46759
+ string: [43]
46760
+ }; // TLS
46761
+ this.rules[9].opcodes[9] = {
46762
+ type: 7,
46763
+ string: [44]
46764
+ }; // TLS
46765
+ this.rules[9].opcodes[10] = {
46766
+ type: 7,
46767
+ string: [59]
46768
+ }; // TLS
46769
+ this.rules[9].opcodes[11] = {
46770
+ type: 7,
46771
+ string: [61]
46772
+ }; // TLS
46773
+
46774
+ /* ucschar */
46775
+ this.rules[10].opcodes = [];
46776
+ this.rules[10].opcodes[0] = {
46777
+ type: 1,
46778
+ children: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
46779
+ }; // ALT
46780
+ this.rules[10].opcodes[1] = {
46781
+ type: 5,
46782
+ min: 160,
46783
+ max: 55295
46784
+ }; // TRG
46785
+ this.rules[10].opcodes[2] = {
46786
+ type: 5,
46787
+ min: 63744,
46788
+ max: 64975
46789
+ }; // TRG
46790
+ this.rules[10].opcodes[3] = {
46791
+ type: 5,
46792
+ min: 65008,
46793
+ max: 65519
46794
+ }; // TRG
46795
+ this.rules[10].opcodes[4] = {
46796
+ type: 5,
46797
+ min: 65536,
46798
+ max: 131069
46799
+ }; // TRG
46800
+ this.rules[10].opcodes[5] = {
46801
+ type: 5,
46802
+ min: 131072,
46803
+ max: 196605
46804
+ }; // TRG
46805
+ this.rules[10].opcodes[6] = {
46806
+ type: 5,
46807
+ min: 196608,
46808
+ max: 262141
46809
+ }; // TRG
46810
+ this.rules[10].opcodes[7] = {
46811
+ type: 5,
46812
+ min: 262144,
46813
+ max: 327677
46814
+ }; // TRG
46815
+ this.rules[10].opcodes[8] = {
46816
+ type: 5,
46817
+ min: 327680,
46818
+ max: 393213
46819
+ }; // TRG
46820
+ this.rules[10].opcodes[9] = {
46821
+ type: 5,
46822
+ min: 393216,
46823
+ max: 458749
46824
+ }; // TRG
46825
+ this.rules[10].opcodes[10] = {
46826
+ type: 5,
46827
+ min: 458752,
46828
+ max: 524285
46829
+ }; // TRG
46830
+ this.rules[10].opcodes[11] = {
46831
+ type: 5,
46832
+ min: 524288,
46833
+ max: 589821
46834
+ }; // TRG
46835
+ this.rules[10].opcodes[12] = {
46836
+ type: 5,
46837
+ min: 589824,
46838
+ max: 655357
46839
+ }; // TRG
46840
+ this.rules[10].opcodes[13] = {
46841
+ type: 5,
46842
+ min: 655360,
46843
+ max: 720893
46844
+ }; // TRG
46845
+ this.rules[10].opcodes[14] = {
46846
+ type: 5,
46847
+ min: 720896,
46848
+ max: 786429
46849
+ }; // TRG
46850
+ this.rules[10].opcodes[15] = {
46851
+ type: 5,
46852
+ min: 786432,
46853
+ max: 851965
46854
+ }; // TRG
46855
+ this.rules[10].opcodes[16] = {
46856
+ type: 5,
46857
+ min: 851968,
46858
+ max: 917501
46859
+ }; // TRG
46860
+ this.rules[10].opcodes[17] = {
46861
+ type: 5,
46862
+ min: 921600,
46863
+ max: 983037
46864
+ }; // TRG
46865
+
46866
+ /* iprivate */
46867
+ this.rules[11].opcodes = [];
46868
+ this.rules[11].opcodes[0] = {
46869
+ type: 1,
46870
+ children: [1, 2, 3]
46871
+ }; // ALT
46872
+ this.rules[11].opcodes[1] = {
46873
+ type: 5,
46874
+ min: 57344,
46875
+ max: 63743
46876
+ }; // TRG
46877
+ this.rules[11].opcodes[2] = {
46878
+ type: 5,
46879
+ min: 983040,
46880
+ max: 1048573
46881
+ }; // TRG
46882
+ this.rules[11].opcodes[3] = {
46883
+ type: 5,
46884
+ min: 1048576,
46885
+ max: 1114109
46886
+ }; // TRG
46887
+
46888
+ // The `toString()` function will display the original grammar file(s) that produced these opcodes.
46889
+ this.toString = function toString() {
46890
+ let str = "";
46891
+ str += "; OpenAPI Server URL templating ABNF syntax\n";
46892
+ str += "server-url-template = 1*( literals / server-variable )\n";
46893
+ str += "server-variable = \"{\" server-variable-name \"}\"\n";
46894
+ str += "server-variable-name = 1*( unreserved / pct-encoded / sub-delims / \":\" / \"@\" )\n";
46895
+ str += "literals = 1*( %x21 / %x23-24 / %x26 / %x28-3B / %x3D / %x3F-5B\n";
46896
+ str += " / %x5D / %x5F / %x61-7A / %x7E / ucschar / iprivate\n";
46897
+ str += " / pct-encoded)\n";
46898
+ str += " ; any Unicode character except: CTL, SP,\n";
46899
+ str += " ; DQUOTE, \"'\", \"%\" (aside from pct-encoded),\n";
46900
+ str += " ; \"<\", \">\", \"\\\", \"^\", \"`\", \"{\", \"|\", \"}\"\n";
46901
+ str += "\n";
46902
+ str += "; Characters definitions (from RFC 6570)\n";
46903
+ str += "ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n";
46904
+ str += "DIGIT = %x30-39 ; 0-9\n";
46905
+ str += "HEXDIG = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\n";
46906
+ str += " ; case-insensitive\n";
46907
+ str += "\n";
46908
+ str += "pct-encoded = \"%\" HEXDIG HEXDIG\n";
46909
+ str += "unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n";
46910
+ str += "sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n";
46911
+ str += " / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n";
46912
+ str += "\n";
46913
+ str += "ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF\n";
46914
+ str += " / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD\n";
46915
+ str += " / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD\n";
46916
+ str += " / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD\n";
46917
+ str += " / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD\n";
46918
+ str += " / %xD0000-DFFFD / %xE1000-EFFFD\n";
46919
+ str += "\n";
46920
+ str += "iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD\n";
46921
+ return str;
46922
+ };
46923
+ }
46924
+
46925
+ /***/ }),
46926
+
46927
+ /***/ 16254:
46928
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46929
+
46930
+ "use strict";
46931
+ __webpack_require__.r(__webpack_exports__);
46932
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46933
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
46934
+ /* harmony export */ encodeServerVariable: () => (/* binding */ encodeServerVariable)
46935
+ /* harmony export */ });
46936
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39790);
46937
+
46938
+ const isEncoded = serverVariableValue => {
46939
+ try {
46940
+ return typeof serverVariableValue === 'string' && decodeURIComponent(serverVariableValue) !== serverVariableValue;
46941
+ } catch {
46942
+ return false;
46943
+ }
46944
+ };
46945
+ const encodeServerVariable = serverVariableValue => {
46946
+ if (isEncoded(serverVariableValue)) {
46947
+ return serverVariableValue;
46948
+ }
46949
+ return encodeURIComponent(serverVariableValue).replace(/%5B/g, '[').replace(/%5D/g, ']');
46950
+ };
46951
+ const significantTypes = ['literals', 'server-variable-name'];
46952
+ const substitute = (serverURLTemplate, serverVariables, options = {}) => {
46953
+ const defaultOptions = {
46954
+ encoder: encodeServerVariable
46955
+ };
46956
+ const mergedOptions = {
46957
+ ...defaultOptions,
46958
+ ...options
46959
+ };
46960
+ const parseResult = (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(serverURLTemplate);
46961
+ if (!parseResult.result.success) return serverURLTemplate;
46962
+ const parts = [];
46963
+ parseResult.ast.translate(parts);
46964
+ const substitutedParts = parts.filter(([type]) => significantTypes.includes(type)).map(([type, value]) => {
46965
+ if (type === 'server-variable-name') {
46966
+ return Object.hasOwn(serverVariables, value) ? mergedOptions.encoder(serverVariables[value], value) : `{${value}}`;
46967
+ }
46968
+ return value;
46969
+ });
46970
+ return substitutedParts.join('');
46971
+ };
46972
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (substitute);
46973
+
46974
+ /***/ }),
46975
+
46976
+ /***/ 3406:
46977
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46978
+
46979
+ "use strict";
46980
+ __webpack_require__.r(__webpack_exports__);
46981
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
46982
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
46983
+ /* harmony export */ });
46984
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39790);
46985
+
46986
+ /**
46987
+ * Test if a string is a server URL template.
46988
+ *
46989
+ * @param {string} serverURLTemplate
46990
+ * @param {Object} [options={}] - An object.
46991
+ * @param {boolean} [options.strict=true] - A boolean indicating presence of at least one `Server Variable` AST node.
46992
+ * @returns {boolean}
46993
+ */
46994
+ const test = (serverURLTemplate, {
46995
+ strict = false
46996
+ } = {}) => {
46997
+ try {
46998
+ const parseResult = (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(serverURLTemplate);
46999
+ if (!parseResult.result.success) return false;
47000
+ const parts = [];
47001
+ parseResult.ast.translate(parts);
47002
+ const hasServerVariable = parts.some(([type]) => type === 'server-variable');
47003
+ if (!strict && !hasServerVariable) {
47004
+ try {
47005
+ new URL(serverURLTemplate, 'https://vladimirgorej.com');
47006
+ return true;
47007
+ } catch {
47008
+ return false;
47009
+ }
47010
+ }
47011
+ return strict ? hasServerVariable : true;
47012
+ } catch {
47013
+ return false;
47014
+ }
47015
+ };
47016
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (test);
47017
+
47018
+ /***/ }),
47019
+
46106
47020
  /***/ 89360:
46107
47021
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
46108
47022
 
@@ -46124,12 +47038,12 @@ __webpack_require__.r(__webpack_exports__);
46124
47038
  /* harmony import */ var _isNotNil_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(32458);
46125
47039
  /* harmony import */ var _isNonEmptyArray_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8609);
46126
47040
  /* harmony import */ var _stubUndefined_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(21504);
46127
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
47041
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
46128
47042
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
46129
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
46130
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
46131
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
46132
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
47043
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
47044
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
47045
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
47046
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
46133
47047
 
46134
47048
 
46135
47049
  /**