@redocly/reference-docs 2.45.10 → 2.45.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/bin/cli/commands/redocly-docs-cli.min.js +48 -48
  2. package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +2 -2
  3. package/dist/console.redocly-reference-docs.min.js +1 -1
  4. package/dist/oauth2-redirect.js +1 -1
  5. package/dist/redocly-reference-docs.min.js +663 -664
  6. package/lib/components/OperationParameters/OperationParameters.js +1 -1
  7. package/lib/components/OperationParameters/utils.js +1 -1
  8. package/lib/components/Overlay/Overlay.js +1 -1
  9. package/lib/components/RedoclyReferenceDocs.js +1 -1
  10. package/lib/components/StoreProvider.js +1 -1
  11. package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
  12. package/lib/components/VersionSwitcher.js +1 -1
  13. package/lib/components/common/form.js +1 -1
  14. package/lib/components/console/ActionPanel.js +1 -1
  15. package/lib/components/console/AuthPanel.js +1 -1
  16. package/lib/components/console/Console.js +1 -1
  17. package/lib/components/console/ConsoleBadges.js +1 -1
  18. package/lib/components/console/OAuth2Flow.js +1 -1
  19. package/lib/components/console/OAuth2TokenInput.js +1 -1
  20. package/lib/components/console/ParameterArray.js +1 -1
  21. package/lib/components/console/RequestBody/RequestBody.js +1 -1
  22. package/lib/components/console/RequestBodyForm.js +1 -1
  23. package/lib/components/console/Scope.js +1 -1
  24. package/lib/components/console/ServersDropdown/ServersDropdown.js +1 -1
  25. package/lib/components/console/utils.js +1 -1
  26. package/lib/components/pluggable/PullRight.js +1 -1
  27. package/lib/components/shared/Button.js +1 -1
  28. package/lib/components/styled.elements.js +1 -1
  29. package/lib/redoc-lib/src/common-elements/Tooltip.js +1 -1
  30. package/lib/redoc-lib/src/common-elements/fields-layout.js +1 -1
  31. package/lib/redoc-lib/src/common-elements/fields.js +1 -1
  32. package/lib/redoc-lib/src/common-elements/icons.js +1 -1
  33. package/lib/redoc-lib/src/common-elements/panels.js +1 -1
  34. package/lib/redoc-lib/src/common-elements/perfect-scrollbar.js +1 -1
  35. package/lib/redoc-lib/src/components/CallbackSamples/CallbackSamples.js +1 -1
  36. package/lib/redoc-lib/src/components/DiscriminatorDropdown/DiscriminatorDropdown.js +1 -1
  37. package/lib/redoc-lib/src/components/Fields/EnumValues.js +1 -1
  38. package/lib/redoc-lib/src/components/Fields/FieldDetails.js +1 -1
  39. package/lib/redoc-lib/src/components/RequestSamples/useCodeSamples.js +1 -1
  40. package/lib/redoc-lib/src/components/Schema/ArraySchema.js +1 -1
  41. package/lib/redoc-lib/src/components/Schema/Schema.js +1 -1
  42. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
  43. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +1 -1
  44. package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +1 -1
  45. package/lib/redoc-lib/src/components/SideMenu/styled.elements.js +1 -1
  46. package/lib/redoc-lib/src/components/StickySidebar/ChevronSvg.js +1 -1
  47. package/lib/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.js +1 -1
  48. package/lib/redoc-lib/src/services/MarkdownRenderer.js +1 -1
  49. package/lib/redoc-lib/src/services/MenuBuilder.js +1 -1
  50. package/lib/redoc-lib/src/services/OpenAPIParser.js +1 -1
  51. package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  52. package/lib/redoc-lib/src/services/models/Example.js +1 -1
  53. package/lib/redoc-lib/src/services/models/Schema.js +1 -1
  54. package/lib/redoc-lib/src/services/models/SecurityRequirement.js +1 -1
  55. package/lib/redoc-lib/src/theme.js +1 -1
  56. package/lib/redoc-lib/src/utils/helpers.js +1 -1
  57. package/lib/redoc-lib/src/utils/index.d.ts +1 -0
  58. package/lib/redoc-lib/src/utils/index.js +1 -1
  59. package/lib/redoc-lib/src/utils/jsonToHtml.js +1 -1
  60. package/lib/redoc-lib/src/utils/media-css.js +1 -1
  61. package/lib/redoc-lib/src/utils/memoize.js +1 -1
  62. package/lib/redoc-lib/src/utils/openapi.js +1 -1
  63. package/lib/redoc-lib/src/utils/url.d.ts +1 -0
  64. package/lib/redoc-lib/src/utils/url.js +2 -0
  65. package/lib/services/OAuth2.js +1 -1
  66. package/lib/services/ProMenu.js +1 -1
  67. package/lib/services/ProStore.js +1 -1
  68. package/lib/services/SearchStore.js +1 -1
  69. package/lib/services/code-samples/generator.js +1 -1
  70. package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +1 -1
  71. package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +1 -1
  72. package/lib/services/code-samples/httpsnippet/helpers/lodash-int.js +1 -1
  73. package/lib/services/code-samples/httpsnippet/index.js +1 -1
  74. package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
  75. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +1 -1
  76. package/lib/services/code-samples/httpsnippet/targets/go/native.js +1 -1
  77. package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +1 -1
  78. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
  79. package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
  80. package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
  81. package/lib/services/code-samples/httpsnippet/targets/php/curl.js +1 -1
  82. package/lib/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
  83. package/lib/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
  84. package/lib/services/code-samples/httpsnippet/targets/r/httr.js +1 -1
  85. package/lib/services/code-samples/httpsnippet/targets/r/utils.js +1 -1
  86. package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +1 -1
  87. package/lib/services/extendTheme.js +1 -1
  88. package/lib/services/utils.js +1 -1
  89. package/lib/utils.js +1 -1
  90. package/lib-browser/redoc-lib/src/services/models/Example.js +1 -1
  91. package/lib-browser/redoc-lib/src/utils/helpers.js +1 -1
  92. package/lib-browser/redoc-lib/src/utils/index.d.ts +1 -0
  93. package/lib-browser/redoc-lib/src/utils/index.js +1 -1
  94. package/lib-browser/redoc-lib/src/utils/url.d.ts +1 -0
  95. package/lib-browser/redoc-lib/src/utils/url.js +2 -0
  96. package/lib-browser/services/code-samples/httpsnippet/index.js +1 -1
  97. package/lib-browser/services/utils.js +1 -1
  98. package/lib-esm/redoc-lib/src/services/models/Example.js +1 -1
  99. package/lib-esm/redoc-lib/src/utils/helpers.js +1 -1
  100. package/lib-esm/redoc-lib/src/utils/index.d.ts +1 -0
  101. package/lib-esm/redoc-lib/src/utils/index.js +1 -1
  102. package/lib-esm/redoc-lib/src/utils/url.d.ts +1 -0
  103. package/lib-esm/redoc-lib/src/utils/url.js +2 -0
  104. package/lib-esm/services/code-samples/httpsnippet/index.js +1 -1
  105. package/lib-esm/services/utils.js +1 -1
  106. package/package.json +3 -4
@@ -1,2 +1,2 @@
1
- import*as qs from"querystring";import*as url from"url";import{normalizeMimeType,unescapeServerVariables}from"../../utils";import{MediaTypes}from"../../../types";import targets from"./targets";import reducer from"./helpers/reducer";import{paramsToObject}from"./helpers/code-helpers";export class HTTPSnippet{constructor(e){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=Object.assign({},e);this.request=this.prepare(Object.assign(Object.assign({},r),{httpVersion:r.httpVersion||"HTTP/1.1",queryString:r.queryString||[],headers:r.headers||[],cookies:r.cookies||[],postData:r.postData?Object.assign(Object.assign({},r.postData),{jsonObj:void 0,paramsObj:void 0}):void 0,bodySize:0,headersSize:0,queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},uriObj:{},fullUrl:"",pathParameters:r.pathParameters||{},serverVariables:r.serverVariables||{}}))}prepare(e){var r;if(e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(reducer,{})),e.headers&&e.headers.length){const r=/^HTTP\/2/;e.headersObj=e.headers.reduce((function(t,a){let s=a.name;return e.httpVersion.match(r)&&(s=s.toLowerCase()),t[s]=a.value,t}),{})}e.cookies&&e.cookies.length&&(e.cookiesObj=e.cookies.reduceRight((function(e,r){return e[r.name]=r.value,e}),{}));const t=e.cookies.map((function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}));if(t.length&&(e.allHeaders.cookie=t.join("; ")),e.postData)switch(normalizeMimeType(e.postData.mimeType)){case"multipart/mixed":case"multipart/related":case MediaTypes.MULTIPART:case"multipart/alternative":break;case MediaTypes.URL_ENCODED:(null===(r=e.postData)||void 0===r?void 0:r.params)?(e.postData.paramsObj=e.postData.params.reduce(reducer,{}),e.postData.text=qs.stringify(e.postData.paramsObj)):e.postData.text="";break;case"text/json":case"text/x-json":case MediaTypes.JSON:case"application/x-json":if(e.postData.text)try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(r){e.postData.mimeType="text/plain"}}return e.allHeaders=Object.assign(e.allHeaders,e.headersObj),e.uriObj=new URL(e.url),e.queryObj=Object.assign(e.queryObj,paramsToObject(e.uriObj.searchParams)),e.uriObj.query="",e.uriObj.search="",e.uriObj.path=e.uriObj.pathname=unescapeServerVariables(e.uriObj.pathname),e.url=unescapeServerVariables(url.format(e.uriObj)),e.uriObj.query=e.queryObj,e.uriObj.search=qs.stringify(e.queryObj),e.uriObj.search&&(e.uriObj.path=e.uriObj.pathname+"?"+e.uriObj.search),e.fullUrl=unescapeServerVariables(url.format(e.uriObj)),e}convert(e,r,t){!t&&r&&(t=r);const a=this._matchTarget(e,r);if(a){const s=a(this.request,t,{target:e,client:r});return 1===s.length?s[0]:s}throw new Error("Can not match target")}_matchTarget(e,r){return!!Object.prototype.hasOwnProperty.call(targets,e)&&("string"==typeof r&&"function"==typeof targets[e][r]?targets[e][r]:targets[e][targets[e].info.default])}}
1
+ import*as qs from"querystring";import{normalizeMimeType,unescapeServerVariables}from"../../utils";import{MediaTypes}from"../../../types";import targets from"./targets";import reducer from"./helpers/reducer";import{paramsToObject}from"./helpers/code-helpers";export class HTTPSnippet{constructor(e){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=Object.assign({},e);this.request=this.prepare(Object.assign(Object.assign({},r),{httpVersion:r.httpVersion||"HTTP/1.1",queryString:r.queryString||[],headers:r.headers||[],cookies:r.cookies||[],postData:r.postData?Object.assign(Object.assign({},r.postData),{jsonObj:void 0,paramsObj:void 0}):void 0,bodySize:0,headersSize:0,queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},uriObj:{},fullUrl:"",pathParameters:r.pathParameters||{},serverVariables:r.serverVariables||{}}))}prepare(e){var r;if(e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(reducer,{})),e.headers&&e.headers.length){const r=/^HTTP\/2/;e.headersObj=e.headers.reduce((function(t,a){let s=a.name;return e.httpVersion.match(r)&&(s=s.toLowerCase()),t[s]=a.value,t}),{})}e.cookies&&e.cookies.length&&(e.cookiesObj=e.cookies.reduceRight((function(e,r){return e[r.name]=r.value,e}),{}));const t=e.cookies.map((function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}));if(t.length&&(e.allHeaders.cookie=t.join("; ")),e.postData)switch(normalizeMimeType(e.postData.mimeType)){case"multipart/mixed":case"multipart/related":case MediaTypes.MULTIPART:case"multipart/alternative":break;case MediaTypes.URL_ENCODED:(null===(r=e.postData)||void 0===r?void 0:r.params)?(e.postData.paramsObj=e.postData.params.reduce(reducer,{}),e.postData.text=qs.stringify(e.postData.paramsObj)):e.postData.text="";break;case"text/json":case"text/x-json":case MediaTypes.JSON:case"application/x-json":if(e.postData.text)try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(r){e.postData.mimeType="text/plain"}}e.allHeaders=Object.assign(e.allHeaders,e.headersObj),e.uriObj=new URL(e.url),e.queryObj=Object.assign(e.queryObj,paramsToObject(e.uriObj.searchParams)),e.uriObj.query="",e.uriObj.search="",e.uriObj.path=e.uriObj.pathname=unescapeServerVariables(e.uriObj.pathname);const a=new URL(e.uriObj.toString());return a.search="",e.url=unescapeServerVariables(a.toString()),e.uriObj.query=e.queryObj,e.uriObj.search=qs.stringify(e.queryObj),e.uriObj.search&&(e.uriObj.path=e.uriObj.pathname+"?"+e.uriObj.search),e.fullUrl=unescapeServerVariables(a.toString()),e}convert(e,r,t){!t&&r&&(t=r);const a=this._matchTarget(e,r);if(a){const s=a(this.request,t,{target:e,client:r});return 1===s.length?s[0]:s}throw new Error("Can not match target")}_matchTarget(e,r){return!!Object.prototype.hasOwnProperty.call(targets,e)&&("string"==typeof r&&"function"==typeof targets[e][r]?targets[e][r]:targets[e][targets[e].info.default])}}
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import merge from"deepmerge";import{isMergeableObject,isObject}from"../redoc-lib/src/utils/helpers";export function normalizePath(e){return e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e}export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function randString(e=32){let r="";for(;r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){const r=Object.assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export async function sha256(e){const r=(new TextEncoder).encode(e);return null==cryptoLib?void 0:cryptoLib.subtle.digest("SHA-256",r)}export function base64UrlEncode(e){if(e)return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}
1
+ import merge from"deepmerge";import{isMergeableObject,isObject}from"../redoc-lib/src/utils/helpers";export function normalizePath(e){return e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e}export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function randString(e=32){let r="";for(;r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){const r=Object.assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export async function sha256(e){const r=(new TextEncoder).encode(e);return null==cryptoLib?void 0:cryptoLib.subtle.digest("SHA-256",r)}export function base64UrlEncode(e){if(e)return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,2 +1,2 @@
1
- import{resolve as urlResolve}from"url";import{isJsonLike}from"../../utils";const externalExamplesCache={};export class ExampleModel{constructor(e,r,l,t){Object.defineProperty(this,"mime",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"encoding",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rawValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"summary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalValueUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{resolved:a}=e.deref(r);this.rawValue=a.value,this.value=a.value,this.summary=a.summary,this.description=a.description,a.externalValue&&(this.externalValueUrl=urlResolve(e.definitionUrl||"",a.externalValue))}getExternalValue(e){return this.externalValueUrl?(this.externalValueUrl in externalExamplesCache||(externalExamplesCache[this.externalValueUrl]=fetch(this.externalValueUrl).then((r=>r.text().then((l=>{if(!r.ok)return Promise.reject(new Error(l));if(!isJsonLike(e))return l;try{return JSON.parse(l)}catch(e){return l}}))))),externalExamplesCache[this.externalValueUrl]):Promise.resolve(void 0)}}
1
+ import{isJsonLike,resolveUrl}from"../../utils";const externalExamplesCache={};export class ExampleModel{constructor(e,r,l,t){Object.defineProperty(this,"mime",{enumerable:!0,configurable:!0,writable:!0,value:l}),Object.defineProperty(this,"encoding",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rawValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"summary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalValueUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const{resolved:a}=e.deref(r);this.rawValue=a.value,this.value=a.value,this.summary=a.summary,this.description=a.description,a.externalValue&&(this.externalValueUrl=resolveUrl(e.definitionUrl||"",a.externalValue))}getExternalValue(e){return this.externalValueUrl?(this.externalValueUrl in externalExamplesCache||(externalExamplesCache[this.externalValueUrl]=fetch(this.externalValueUrl).then((r=>r.text().then((l=>{if(!r.ok)return Promise.reject(new Error(l));if(!isJsonLike(e))return l;try{return JSON.parse(l)}catch(e){return l}}))))),externalExamplesCache[this.externalValueUrl]):Promise.resolve(void 0)}}
2
2
  //# sourceMappingURL=Example.js.map
@@ -1,2 +1,2 @@
1
- import slugify from"slugify";import{format,parse}from"url";import{ZERO_BREAKPOINT}from"./media-css";import{isNamedDefinition}from"./openapi";import JsonPointer from"./JsonPointer";export function mapWithLast(e,t){const r=[];for(let n=0;n<e.length-1;n++)r.push(t(e[n],!1));return 0!==e.length&&r.push(t(e[e.length-1],!0)),r}export function mapValues(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=t(e[n],n,e));return r}export function flattenByProp(e,t){const r=[],n=e=>{for(const o of e)r.push(o),o[t]&&n(o[t])};return n(e),r}export function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function appendToMdHeading(e,t,r){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(e))return e.replace(o,`$1\n\n${r}\n$4`);{const n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return`${e}${n}# ${t}\n\n${r}`}}export const mergeObjects=(e,...t)=>{if(!t.length)return e;const r=t.shift();return void 0===r?e:(isMergeableObject(e)&&isMergeableObject(r)&&Object.keys(r).forEach((t=>{isMergeableObject(r[t])?(e[t]||(e[t]={}),["string","number"].includes(typeof e[t])&&(r[t][ZERO_BREAKPOINT]||0===r[t][ZERO_BREAKPOINT]||console.warn(`Theme resolver: using default value of "${e[t]}" for "${t}". This is not recommended. Prefer adding default value by providing "${ZERO_BREAKPOINT}" property to ${JSON.stringify(r[t])}.`),e[t]={[ZERO_BREAKPOINT]:e[t]}),mergeObjects(e[t],r[t])):e[t]=r[t]})),mergeObjects(e,...t))};export const isObject=e=>null!==e&&"object"==typeof e;export const isArrayOfObjects=e=>Array.isArray(e)&&e.some((e=>isObject(e)));export const deleteEmptyArrayItem=e=>e.filter((e=>!!e));export const isMergeableObject=e=>isObject(e)&&!Array.isArray(e);export function safeSlugify(e){return slugify(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}export function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}export function resolveUrl(e,t){let r;if(t.startsWith("//")){const{protocol:n}=parse(e);r=`${n||"https:"}${t}`}else if(isAbsoluteUrl(t))r=t;else if(t.startsWith("/")){const n=parse(e);r=format(Object.assign(Object.assign({},n),{pathname:t}))}else r=stripTrailingSlash(e)+"/"+t;return stripTrailingSlash(r)}export function getBasePath(e){try{return parseURL(e).pathname}catch(t){return e}}export function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}export function removeQueryStringAndHash(e){try{const t=parseURL(e);return t.search="",t.hash="",t.toString()}catch(t){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}export function escapeHTMLAttrChars(e){return e.replace(/["\\]/g,"\\$&")}export function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}export function sanitizeItemId(e){return e&&e.replace(/#/g,"_")}export function getSchemaTitle(e,t){return t||isNamedDefinition(e)&&JsonPointer.baseName(e)||""}export function isLastInArray(e,t){return t===e.length-1}export function isLastProperty(e,t){const r=Object.keys(e);return r.indexOf(t)===r.length-1}
1
+ import slugify from"slugify";import{urlParse}from"./url";import{ZERO_BREAKPOINT}from"./media-css";import{isNamedDefinition}from"./openapi";import JsonPointer from"./JsonPointer";export function mapWithLast(e,t){const r=[];for(let n=0;n<e.length-1;n++)r.push(t(e[n],!1));return 0!==e.length&&r.push(t(e[e.length-1],!0)),r}export function mapValues(e,t){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=t(e[n],n,e));return r}export function flattenByProp(e,t){const r=[],n=e=>{for(const o of e)r.push(o),o[t]&&n(o[t])};return n(e),r}export function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function appendToMdHeading(e,t,r){const n=new RegExp(`(^|\\n)#\\s?${t}\\s*\\n`,"i"),o=new RegExp(`((\\n|^)#\\s*${t}\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)`,"i");if(n.test(e))return e.replace(o,`$1\n\n${r}\n$4`);{const n=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return`${e}${n}# ${t}\n\n${r}`}}export const mergeObjects=(e,...t)=>{if(!t.length)return e;const r=t.shift();return void 0===r?e:(isMergeableObject(e)&&isMergeableObject(r)&&Object.keys(r).forEach((t=>{isMergeableObject(r[t])?(e[t]||(e[t]={}),["string","number"].includes(typeof e[t])&&(r[t][ZERO_BREAKPOINT]||0===r[t][ZERO_BREAKPOINT]||console.warn(`Theme resolver: using default value of "${e[t]}" for "${t}". This is not recommended. Prefer adding default value by providing "${ZERO_BREAKPOINT}" property to ${JSON.stringify(r[t])}.`),e[t]={[ZERO_BREAKPOINT]:e[t]}),mergeObjects(e[t],r[t])):e[t]=r[t]})),mergeObjects(e,...t))};export const isObject=e=>null!==e&&"object"==typeof e;export const isArrayOfObjects=e=>Array.isArray(e)&&e.some((e=>isObject(e)));export const deleteEmptyArrayItem=e=>e.filter((e=>!!e));export const isMergeableObject=e=>isObject(e)&&!Array.isArray(e);export function safeSlugify(e){return slugify(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}export function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}export function resolveUrl(e,t){var r;let n;if(t.startsWith("//"))n=`${(null===(r=urlParse(e,!0))||void 0===r?void 0:r.protocol)||"https:"}${t}`;else if(isAbsoluteUrl(t))n=t;else if(t.startsWith("/")){const r=urlParse(e);r?(r.pathname=t,n=r.toString()):n=t}else n=stripTrailingSlash(e)+"/"+t;return stripTrailingSlash(n)}export function getBasePath(e){try{return parseURL(e).pathname}catch(t){return e}}export function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}export function removeQueryStringAndHash(e){try{const t=parseURL(e);return t.search="",t.hash="",t.toString()}catch(t){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}export function escapeHTMLAttrChars(e){return e.replace(/["\\]/g,"\\$&")}export function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,((e,t)=>String.fromCharCode(parseInt(t,10)))).replace(/&amp;/g,"&").replace(/&quot;/g,'"')}export function sanitizeItemId(e){return e&&e.replace(/#/g,"_")}export function getSchemaTitle(e,t){return t||isNamedDefinition(e)&&JsonPointer.baseName(e)||""}export function isLastInArray(e,t){return t===e.length-1}export function isLastProperty(e,t){const r=Object.keys(e);return r.indexOf(t)===r.length-1}
2
2
  //# sourceMappingURL=helpers.js.map
@@ -9,3 +9,4 @@ export * from './debug';
9
9
  export * from './memoize';
10
10
  export * from './sort';
11
11
  export * from './argValuesHelpers';
12
+ export * from './url';
@@ -1,2 +1,2 @@
1
- export*from"./JsonPointer";export*from"./openapi";export*from"./helpers";export*from"./highlight";export*from"./loadAndBundleSpec";export*from"./dom";export*from"./decorators";export*from"./debug";export*from"./memoize";export*from"./sort";export*from"./argValuesHelpers";
1
+ export*from"./JsonPointer";export*from"./openapi";export*from"./helpers";export*from"./highlight";export*from"./loadAndBundleSpec";export*from"./dom";export*from"./decorators";export*from"./debug";export*from"./memoize";export*from"./sort";export*from"./argValuesHelpers";export*from"./url";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export declare function urlParse(url: string, slashesDenoteHost?: boolean): URL | null;
@@ -0,0 +1,2 @@
1
+ export function urlParse(r,t=!1){let e=r;t&&e.startsWith("//")&&(e="http:"+r);try{const r=URL;return r.parse?r.parse(e):new URL(e)}catch(r){return console.error("Invalid URL: %s",e,r),null}}
2
+ //# sourceMappingURL=url.js.map
@@ -1,2 +1,2 @@
1
- import*as qs from"querystring";import*as url from"url";import{normalizeMimeType,unescapeServerVariables}from"../../utils";import{MediaTypes}from"../../../types";import targets from"./targets";import reducer from"./helpers/reducer";import{paramsToObject}from"./helpers/code-helpers";export class HTTPSnippet{constructor(e){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=Object.assign({},e);this.request=this.prepare(Object.assign(Object.assign({},r),{httpVersion:r.httpVersion||"HTTP/1.1",queryString:r.queryString||[],headers:r.headers||[],cookies:r.cookies||[],postData:r.postData?Object.assign(Object.assign({},r.postData),{jsonObj:void 0,paramsObj:void 0}):void 0,bodySize:0,headersSize:0,queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},uriObj:{},fullUrl:"",pathParameters:r.pathParameters||{},serverVariables:r.serverVariables||{}}))}prepare(e){var r;if(e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(reducer,{})),e.headers&&e.headers.length){const r=/^HTTP\/2/;e.headersObj=e.headers.reduce((function(t,a){let s=a.name;return e.httpVersion.match(r)&&(s=s.toLowerCase()),t[s]=a.value,t}),{})}e.cookies&&e.cookies.length&&(e.cookiesObj=e.cookies.reduceRight((function(e,r){return e[r.name]=r.value,e}),{}));const t=e.cookies.map((function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}));if(t.length&&(e.allHeaders.cookie=t.join("; ")),e.postData)switch(normalizeMimeType(e.postData.mimeType)){case"multipart/mixed":case"multipart/related":case MediaTypes.MULTIPART:case"multipart/alternative":break;case MediaTypes.URL_ENCODED:(null===(r=e.postData)||void 0===r?void 0:r.params)?(e.postData.paramsObj=e.postData.params.reduce(reducer,{}),e.postData.text=qs.stringify(e.postData.paramsObj)):e.postData.text="";break;case"text/json":case"text/x-json":case MediaTypes.JSON:case"application/x-json":if(e.postData.text)try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(r){e.postData.mimeType="text/plain"}}return e.allHeaders=Object.assign(e.allHeaders,e.headersObj),e.uriObj=new URL(e.url),e.queryObj=Object.assign(e.queryObj,paramsToObject(e.uriObj.searchParams)),e.uriObj.query="",e.uriObj.search="",e.uriObj.path=e.uriObj.pathname=unescapeServerVariables(e.uriObj.pathname),e.url=unescapeServerVariables(url.format(e.uriObj)),e.uriObj.query=e.queryObj,e.uriObj.search=qs.stringify(e.queryObj),e.uriObj.search&&(e.uriObj.path=e.uriObj.pathname+"?"+e.uriObj.search),e.fullUrl=unescapeServerVariables(url.format(e.uriObj)),e}convert(e,r,t){!t&&r&&(t=r);const a=this._matchTarget(e,r);if(a){const s=a(this.request,t,{target:e,client:r});return 1===s.length?s[0]:s}throw new Error("Can not match target")}_matchTarget(e,r){return!!Object.prototype.hasOwnProperty.call(targets,e)&&("string"==typeof r&&"function"==typeof targets[e][r]?targets[e][r]:targets[e][targets[e].info.default])}}
1
+ import*as qs from"querystring";import{normalizeMimeType,unescapeServerVariables}from"../../utils";import{MediaTypes}from"../../../types";import targets from"./targets";import reducer from"./helpers/reducer";import{paramsToObject}from"./helpers/code-helpers";export class HTTPSnippet{constructor(e){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const r=Object.assign({},e);this.request=this.prepare(Object.assign(Object.assign({},r),{httpVersion:r.httpVersion||"HTTP/1.1",queryString:r.queryString||[],headers:r.headers||[],cookies:r.cookies||[],postData:r.postData?Object.assign(Object.assign({},r.postData),{jsonObj:void 0,paramsObj:void 0}):void 0,bodySize:0,headersSize:0,queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},uriObj:{},fullUrl:"",pathParameters:r.pathParameters||{},serverVariables:r.serverVariables||{}}))}prepare(e){var r;if(e.queryString&&e.queryString.length&&(e.queryObj=e.queryString.reduce(reducer,{})),e.headers&&e.headers.length){const r=/^HTTP\/2/;e.headersObj=e.headers.reduce((function(t,a){let s=a.name;return e.httpVersion.match(r)&&(s=s.toLowerCase()),t[s]=a.value,t}),{})}e.cookies&&e.cookies.length&&(e.cookiesObj=e.cookies.reduceRight((function(e,r){return e[r.name]=r.value,e}),{}));const t=e.cookies.map((function(e){return encodeURIComponent(e.name)+"="+encodeURIComponent(e.value)}));if(t.length&&(e.allHeaders.cookie=t.join("; ")),e.postData)switch(normalizeMimeType(e.postData.mimeType)){case"multipart/mixed":case"multipart/related":case MediaTypes.MULTIPART:case"multipart/alternative":break;case MediaTypes.URL_ENCODED:(null===(r=e.postData)||void 0===r?void 0:r.params)?(e.postData.paramsObj=e.postData.params.reduce(reducer,{}),e.postData.text=qs.stringify(e.postData.paramsObj)):e.postData.text="";break;case"text/json":case"text/x-json":case MediaTypes.JSON:case"application/x-json":if(e.postData.text)try{e.postData.jsonObj=JSON.parse(e.postData.text)}catch(r){e.postData.mimeType="text/plain"}}e.allHeaders=Object.assign(e.allHeaders,e.headersObj),e.uriObj=new URL(e.url),e.queryObj=Object.assign(e.queryObj,paramsToObject(e.uriObj.searchParams)),e.uriObj.query="",e.uriObj.search="",e.uriObj.path=e.uriObj.pathname=unescapeServerVariables(e.uriObj.pathname);const a=new URL(e.uriObj.toString());return a.search="",e.url=unescapeServerVariables(a.toString()),e.uriObj.query=e.queryObj,e.uriObj.search=qs.stringify(e.queryObj),e.uriObj.search&&(e.uriObj.path=e.uriObj.pathname+"?"+e.uriObj.search),e.fullUrl=unescapeServerVariables(a.toString()),e}convert(e,r,t){!t&&r&&(t=r);const a=this._matchTarget(e,r);if(a){const s=a(this.request,t,{target:e,client:r});return 1===s.length?s[0]:s}throw new Error("Can not match target")}_matchTarget(e,r){return!!Object.prototype.hasOwnProperty.call(targets,e)&&("string"==typeof r&&"function"==typeof targets[e][r]?targets[e][r]:targets[e][targets[e].info.default])}}
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import merge from"deepmerge";import{isMergeableObject,isObject}from"../redoc-lib/src/utils/helpers";export function normalizePath(e){return e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e}export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function randString(e=32){let r="";for(;r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){const r=Object.assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export async function sha256(e){const r=(new TextEncoder).encode(e);return null==cryptoLib?void 0:cryptoLib.subtle.digest("SHA-256",r)}export function base64UrlEncode(e){if(e)return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}
1
+ import merge from"deepmerge";import{isMergeableObject,isObject}from"../redoc-lib/src/utils/helpers";export function normalizePath(e){return e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e}export function isSameMime(e,r){return!(!e||!r)&&normalizeMimeType(e)===normalizeMimeType(r)}export function normalizeMimeType(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(void 0===n)return t;return`${t}/${n.split("+").pop()}`}export function unescapeServerVariables(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}export function arrayMergeStrategy(e,r){if(!e.length||!hasObjectOrArray(e))return r;const t=e.filter((e=>Object.keys(e).length>0));return r.forEach((function(r,n){isMergeableObject(r)?t[n]=merge(e[n],r,{arrayMerge:arrayMergeStrategy}):Array.isArray(r)?t.push(r):t[n]=r})),t}const hasObjectOrArray=e=>e.some((e=>isObject(e)&&Object.keys(e).length>0));export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export const cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;export function randString(e=32){let r="";for(;r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){const r=Object.assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export async function sha256(e){const r=(new TextEncoder).encode(e);return null==cryptoLib?void 0:cryptoLib.subtle.digest("SHA-256",r)}export function base64UrlEncode(e){if(e)return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}
2
2
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/reference-docs",
3
- "version": "2.45.10",
3
+ "version": "2.45.12",
4
4
  "description": "Redocly Reference Docs",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "codemirror": "^5.65.0",
22
22
  "decko": "^1.2.0",
23
23
  "deepmerge": "^4.2.2",
24
- "dompurify": "^2.0.12",
24
+ "dompurify": "3.2.6",
25
25
  "eventemitter3": "^4.0.4",
26
26
  "fast-deep-equal": "^3.1.3",
27
27
  "handlebars": "^4.7.6",
@@ -104,7 +104,6 @@
104
104
  "@testing-library/react-hooks": "^8.0.1",
105
105
  "@testing-library/user-event": "^12.1.10",
106
106
  "@types/codemirror": "0.0.88",
107
- "@types/dompurify": "^2.0.2",
108
107
  "@types/enzyme-to-json": "^1.5.3",
109
108
  "@types/jest": "^25.1.4",
110
109
  "@types/jest-when": "^3.5.2",
@@ -155,7 +154,7 @@
155
154
  "terser": "^5.6.1",
156
155
  "ts-jest": "^28.0.7",
157
156
  "ts-node": "^8.8.1",
158
- "typescript": "4.4.2",
157
+ "typescript": "^4.5.5",
159
158
  "url-polyfill": "^1.1.7",
160
159
  "webpack": "^5.64.4",
161
160
  "webpack-cli": "^4.9.1",