@redocly/reference-docs 2.12.1 → 2.12.4

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 (38) hide show
  1. package/bin/cli/commands/redocly-docs-cli.min.js +43 -36
  2. package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
  3. package/dist/console.redocly-reference-docs.min.js +70 -70
  4. package/dist/oauth2-redirect.js +1 -1
  5. package/dist/redocly-reference-docs.min.js +585 -578
  6. package/lib/components/console/OAuth2Flow.js +1 -1
  7. package/lib/components/console/ServerDropdown.d.ts +1 -1
  8. package/lib/components/console/ServerDropdown.js +1 -1
  9. package/lib/redoc-lib/src/common-elements/schema.d.ts +4 -0
  10. package/lib/redoc-lib/src/common-elements/schema.js +1 -1
  11. package/lib/redoc-lib/src/components/Schema/OneOfSchema.js +1 -1
  12. package/lib/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.js +1 -1
  13. package/lib/redoc-lib/src/services/RedocNormalizedOptions.d.ts +2 -0
  14. package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  15. package/lib/redoc-lib/src/theme.d.ts +4 -0
  16. package/lib/redoc-lib/src/theme.js +1 -1
  17. package/lib/services/OAuth2.js +1 -1
  18. package/lib/services/check.d.ts +0 -1
  19. package/lib/services/check.js +1 -1
  20. package/lib/services/utils.d.ts +1 -0
  21. package/lib/services/utils.js +1 -1
  22. package/lib-esm/components/console/OAuth2Flow.js +1 -1
  23. package/lib-esm/components/console/ServerDropdown.d.ts +1 -1
  24. package/lib-esm/components/console/ServerDropdown.js +1 -1
  25. package/lib-esm/redoc-lib/src/common-elements/schema.d.ts +4 -0
  26. package/lib-esm/redoc-lib/src/common-elements/schema.js +1 -1
  27. package/lib-esm/redoc-lib/src/components/Schema/OneOfSchema.js +1 -1
  28. package/lib-esm/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.js +1 -1
  29. package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.d.ts +2 -0
  30. package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
  31. package/lib-esm/redoc-lib/src/theme.d.ts +4 -0
  32. package/lib-esm/redoc-lib/src/theme.js +1 -1
  33. package/lib-esm/services/OAuth2.js +1 -1
  34. package/lib-esm/services/check.d.ts +0 -1
  35. package/lib-esm/services/check.js +1 -1
  36. package/lib-esm/services/utils.d.ts +1 -0
  37. package/lib-esm/services/utils.js +1 -1
  38. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import{__assign,__decorate}from"tslib";import{observable,makeObservable}from"mobx";import defaultTheme,{resolveTheme}from"../theme";import{isNumeric,mergeObjects,querySelector}from"../utils";import{setRedocLabels}from"./Labels";export function argValueToBoolean(e,a){return void 0===e?a||!1:"string"==typeof e?"false"!==e:e}function argValueToNumber(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?e:void 0}function argValueToInt(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?Math.ceil(e):void 0}function argValueToExpandLevel(e,a){return void 0===a&&(a=0),"all"===e?1/0:argValueToInt(e)||a}var RedocNormalizedOptions=function(){function e(a,t){var r,i,o,l,n,s;void 0===t&&(t={}),Object.defineProperty(this,"theme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollYOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideHostname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInfoDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requiredPropsFirst",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortPropsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortEnumValuesAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortOperationsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortTagsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"noAutoAuth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativeScrollbars",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathInMiddlePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"untrustedDefinition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideDownloadButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disableSearch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showChangeLayoutButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showConsole",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendXUserAgentInTryIt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generatedPayloadSamplesMaxDepth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showExtensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSingleRequestSampleTab",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideRequestPayloadSample",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuToggle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"jsonSampleExpandLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enumSkipQuotes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaTitles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simpleOneOfTypeLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"payloadSampleIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandSingleSchemaField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schemaExpansionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"samplesTabsMaxCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_tryItButtonOverride",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowedMdComponents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultServerVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxDisplayedEnumValues",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreNamedSchemas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_ignoreMimeParameters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_externalCodeSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaPattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOneOfDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this);var u=null===(r=(a=__assign(__assign({},t),a)).theme)||void 0===r?void 0:r.extensionsHook;(null===(i=a.theme)||void 0===i?void 0:i.menu)&&!(null===(o=a.theme)||void 0===o?void 0:o.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),a.theme.sidebar=a.theme.menu),(null===(l=a.theme)||void 0===l?void 0:l.codeSample)&&!(null===(n=a.theme)||void 0===n?void 0:n.codeBlock)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),a.theme.codeBlock=a.theme.codeSample),this.theme=resolveTheme(mergeObjects({},defaultTheme,__assign(__assign({},a.theme),{extensionsHook:void 0}))),this.theme.mediaQueries={print:"@media print"};for(var b=0,d=Object.entries(this.theme.breakpoints);b<d.length;b++){var c=d[b],p=c[0],m=c[1];this.theme.mediaQueries[p]="@media screen and (min-width: "+m+")"}this.theme.extensionsHook=u,setRedocLabels(a.labels),this.scrollYOffset=e.normalizeScrollYOffset(a.scrollYOffset),this.hideHostname=e.normalizeHideHostname(a.hideHostname),this.expandResponses=e.normalizeExpandResponses(a.expandResponses),this.requiredPropsFirst=argValueToBoolean(a.requiredPropsFirst),this.sortPropsAlphabetically=argValueToBoolean(a.sortPropsAlphabetically),this.sortEnumValuesAlphabetically=argValueToBoolean(a.sortEnumValuesAlphabetically),this.sortOperationsAlphabetically=argValueToBoolean(a.sortOperationsAlphabetically),this.sortTagsAlphabetically=argValueToBoolean(a.sortTagsAlphabetically),this.noAutoAuth=argValueToBoolean(a.noAutoAuth),this.nativeScrollbars=argValueToBoolean(a.nativeScrollbars),this.pathInMiddlePanel=argValueToBoolean(a.pathInMiddlePanel),this.untrustedDefinition=argValueToBoolean(a.untrustedDefinition),this.hideDownloadButton=void 0===a.hideDownloadButton?null:argValueToBoolean(a.hideDownloadButton),this.hideInfoDescription=argValueToBoolean(a.hideInfoDescription),this.disableSearch=argValueToBoolean(a.disableSearch),this.onlyRequiredInSamples=argValueToBoolean(a.onlyRequiredInSamples),this.generatedPayloadSamplesMaxDepth=argValueToInt(a.generatedPayloadSamplesMaxDepth)||8,this.sendXUserAgentInTryIt=argValueToBoolean(a.sendXUserAgentInTryIt),this.showExtensions=e.normalizeShowExtensions(a.showExtensions),this.hideSingleRequestSampleTab=argValueToBoolean(a.hideSingleRequestSampleTab),this.hideRequestPayloadSample=argValueToBoolean(a.hideRequestPayloadSample),this.menuToggle=argValueToBoolean(a.menuToggle,!0),this.jsonSampleExpandLevel=argValueToExpandLevel(a.jsonSampleExpandLevel,2),this.enumSkipQuotes=argValueToBoolean(a.enumSkipQuotes),this.hideSchemaTitles=argValueToBoolean(a.hideSchemaTitles),this.simpleOneOfTypeLabel=argValueToBoolean(a.simpleOneOfTypeLabel),this.payloadSampleIdx=e.normalizePayloadSampleIdx(a.payloadSampleIdx),this.expandSingleSchemaField=argValueToBoolean(a.expandSingleSchemaField),this.schemaExpansionLevel=argValueToExpandLevel(a.schemaExpansionLevel),this.samplesTabsMaxCount=argValueToInt(a.samplesTabsMaxCount)||5,this.unstable_tryItButtonOverride=a.unstable_tryItButtonOverride||null,this.unstable_ignoreMimeParameters=argValueToBoolean(a.unstable_ignoreMimeParameters),this.allowedMdComponents=a.allowedMdComponents||{},this.expandDefaultServerVariables=argValueToBoolean(a.expandDefaultServerVariables),this.expandDefaultRequest=argValueToBoolean(a.expandDefaultRequest,!0),this.expandDefaultResponse=argValueToBoolean(a.expandDefaultResponse,!0),this.maxDisplayedEnumValues=argValueToNumber(a.maxDisplayedEnumValues);var h=Array.isArray(a.ignoreNamedSchemas)?a.ignoreNamedSchemas:null===(s=a.ignoreNamedSchemas)||void 0===s?void 0:s.split(",").map((function(e){return e.trim()}));this.ignoreNamedSchemas=new Set(h),this.unstable_externalCodeSamples=a.unstable_externalCodeSamples||[],this.hooks=a.hooks||{},this.hooks.ReplaceTryItAuthPanel&&!this.hooks.ReplaceTryItSecurityPanel&&(console.warn("[warn] ReplaceTryItAuthPanel is deprecated, use ReplaceTryItSecurityPanel instead"),this.hooks.ReplaceTryItSecurityPanel=this.hooks.ReplaceTryItAuthPanel),this.hideSchemaPattern=argValueToBoolean(a.hideSchemaPattern),this.hideOneOfDescription=argValueToBoolean(a.hideOneOfDescription)}return Object.defineProperty(e,"normalizeExpandResponses",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("all"===e)return"all";if("string"==typeof e){var a={};return e.split(",").forEach((function(e){a[e.trim()]=!0})),a}return void 0!==e&&console.warn('expandResponses must be a string but received value "'+e+'" of type '+typeof e),{}}}),Object.defineProperty(e,"normalizeHideHostname",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!e}}),Object.defineProperty(e,"normalizeScrollYOffset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("string"==typeof e&&!isNumeric(e)){var a=querySelector(e);a||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");var t=a&&a.getBoundingClientRect().bottom||0;return function(){return t}}return"number"==typeof e||isNumeric(e)?function(){return"number"==typeof e?e:parseFloat(e)}:"function"==typeof e?function(){var a=e();return"number"!=typeof a&&console.warn('scrollYOffset should return number but returned value "'+a+'" of type '+typeof a),a}:(void 0!==e&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function"),function(){return 0})}}),Object.defineProperty(e,"normalizeShowExtensions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return!1;if(""===e)return!0;if("string"!=typeof e)return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map((function(e){return e.trim()}))}}}),Object.defineProperty(e,"normalizePayloadSampleIdx",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"number"==typeof e?Math.max(0,e):"string"==typeof e&&isFinite(e)?parseInt(e,10):0}}),__decorate([observable],e.prototype,"showConsole",void 0),e}();export{RedocNormalizedOptions};
1
+ import{__assign,__decorate}from"tslib";import{observable,makeObservable}from"mobx";import defaultTheme,{resolveTheme}from"../theme";import{isNumeric,mergeObjects,querySelector}from"../utils";import{setRedocLabels}from"./Labels";export function argValueToBoolean(e,a){return void 0===e?a||!1:"string"==typeof e?"false"!==e:e}function argValueToNumber(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?e:void 0}function argValueToInt(e){return"string"==typeof e?parseInt(e,10):"number"==typeof e?Math.ceil(e):void 0}function argValueToExpandLevel(e,a){return void 0===a&&(a=0),"all"===e?1/0:argValueToInt(e)||a}var RedocNormalizedOptions=function(){function e(a,t){var r,i,o,l,n,s;void 0===t&&(t={}),Object.defineProperty(this,"theme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollYOffset",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideHostname",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideInfoDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requiredPropsFirst",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortPropsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortEnumValuesAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortOperationsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sortTagsAlphabetically",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"noAutoAuth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativeScrollbars",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathInMiddlePanel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"untrustedDefinition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideDownloadButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disableSearch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showChangeLayoutButton",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showConsole",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendXUserAgentInTryIt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"generatedPayloadSamplesMaxDepth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showExtensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSingleRequestSampleTab",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideRequestPayloadSample",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuToggle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"jsonSampleExpandLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enumSkipQuotes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaTitles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simpleOneOfTypeLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"payloadSampleIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandSingleSchemaField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schemaExpansionLevel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"samplesTabsMaxCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_tryItButtonOverride",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allowedMdComponents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultServerVariables",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"expandDefaultResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxDisplayedEnumValues",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreNamedSchemas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_ignoreMimeParameters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unstable_externalCodeSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideSchemaPattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOneOfDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideFab",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this);var u=null===(r=(a=__assign(__assign({},t),a)).theme)||void 0===r?void 0:r.extensionsHook;(null===(i=a.theme)||void 0===i?void 0:i.menu)&&!(null===(o=a.theme)||void 0===o?void 0:o.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),a.theme.sidebar=a.theme.menu),(null===(l=a.theme)||void 0===l?void 0:l.codeSample)&&!(null===(n=a.theme)||void 0===n?void 0:n.codeBlock)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),a.theme.codeBlock=a.theme.codeSample),this.theme=resolveTheme(mergeObjects({},defaultTheme,__assign(__assign({},a.theme),{extensionsHook:void 0}))),this.theme.mediaQueries={print:"@media print"};for(var b=0,d=Object.entries(this.theme.breakpoints);b<d.length;b++){var c=d[b],h=c[0],p=c[1];this.theme.mediaQueries[h]="@media screen and (min-width: "+p+")"}this.theme.extensionsHook=u,setRedocLabels(a.labels),this.scrollYOffset=e.normalizeScrollYOffset(a.scrollYOffset),this.hideHostname=e.normalizeHideHostname(a.hideHostname),this.expandResponses=e.normalizeExpandResponses(a.expandResponses),this.requiredPropsFirst=argValueToBoolean(a.requiredPropsFirst),this.sortPropsAlphabetically=argValueToBoolean(a.sortPropsAlphabetically),this.sortEnumValuesAlphabetically=argValueToBoolean(a.sortEnumValuesAlphabetically),this.sortOperationsAlphabetically=argValueToBoolean(a.sortOperationsAlphabetically),this.sortTagsAlphabetically=argValueToBoolean(a.sortTagsAlphabetically),this.noAutoAuth=argValueToBoolean(a.noAutoAuth),this.nativeScrollbars=argValueToBoolean(a.nativeScrollbars),this.pathInMiddlePanel=argValueToBoolean(a.pathInMiddlePanel),this.untrustedDefinition=argValueToBoolean(a.untrustedDefinition),this.hideDownloadButton=void 0===a.hideDownloadButton?null:argValueToBoolean(a.hideDownloadButton),this.hideInfoDescription=argValueToBoolean(a.hideInfoDescription),this.disableSearch=argValueToBoolean(a.disableSearch),this.onlyRequiredInSamples=argValueToBoolean(a.onlyRequiredInSamples),this.generatedPayloadSamplesMaxDepth=argValueToInt(a.generatedPayloadSamplesMaxDepth)||8,this.sendXUserAgentInTryIt=argValueToBoolean(a.sendXUserAgentInTryIt),this.showExtensions=e.normalizeShowExtensions(a.showExtensions),this.hideSingleRequestSampleTab=argValueToBoolean(a.hideSingleRequestSampleTab),this.hideRequestPayloadSample=argValueToBoolean(a.hideRequestPayloadSample),this.menuToggle=argValueToBoolean(a.menuToggle,!0),this.jsonSampleExpandLevel=argValueToExpandLevel(a.jsonSampleExpandLevel,2),this.enumSkipQuotes=argValueToBoolean(a.enumSkipQuotes),this.hideSchemaTitles=argValueToBoolean(a.hideSchemaTitles),this.simpleOneOfTypeLabel=argValueToBoolean(a.simpleOneOfTypeLabel),this.payloadSampleIdx=e.normalizePayloadSampleIdx(a.payloadSampleIdx),this.expandSingleSchemaField=argValueToBoolean(a.expandSingleSchemaField),this.schemaExpansionLevel=argValueToExpandLevel(a.schemaExpansionLevel),this.samplesTabsMaxCount=argValueToInt(a.samplesTabsMaxCount)||5,this.unstable_tryItButtonOverride=a.unstable_tryItButtonOverride||null,this.unstable_ignoreMimeParameters=argValueToBoolean(a.unstable_ignoreMimeParameters),this.allowedMdComponents=a.allowedMdComponents||{},this.expandDefaultServerVariables=argValueToBoolean(a.expandDefaultServerVariables),this.expandDefaultRequest=argValueToBoolean(a.expandDefaultRequest,!0),this.expandDefaultResponse=argValueToBoolean(a.expandDefaultResponse,!0),this.maxDisplayedEnumValues=argValueToNumber(a.maxDisplayedEnumValues);var m=Array.isArray(a.ignoreNamedSchemas)?a.ignoreNamedSchemas:null===(s=a.ignoreNamedSchemas)||void 0===s?void 0:s.split(",").map((function(e){return e.trim()}));this.ignoreNamedSchemas=new Set(m),this.unstable_externalCodeSamples=a.unstable_externalCodeSamples||[],this.hooks=a.hooks||{},this.hooks.ReplaceTryItAuthPanel&&!this.hooks.ReplaceTryItSecurityPanel&&(console.warn("[warn] ReplaceTryItAuthPanel is deprecated, use ReplaceTryItSecurityPanel instead"),this.hooks.ReplaceTryItSecurityPanel=this.hooks.ReplaceTryItAuthPanel),this.hideSchemaPattern=argValueToBoolean(a.hideSchemaPattern),this.hideOneOfDescription=argValueToBoolean(a.hideOneOfDescription),this.hideFab=argValueToBoolean(a.hideFab)}return Object.defineProperty(e,"normalizeExpandResponses",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("all"===e)return"all";if("string"==typeof e){var a={};return e.split(",").forEach((function(e){a[e.trim()]=!0})),a}return void 0!==e&&console.warn('expandResponses must be a string but received value "'+e+'" of type '+typeof e),{}}}),Object.defineProperty(e,"normalizeHideHostname",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!e}}),Object.defineProperty(e,"normalizeScrollYOffset",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("string"==typeof e&&!isNumeric(e)){var a=querySelector(e);a||console.warn("scrollYOffset value is a selector to non-existing element. Using offset 0 by default");var t=a&&a.getBoundingClientRect().bottom||0;return function(){return t}}return"number"==typeof e||isNumeric(e)?function(){return"number"==typeof e?e:parseFloat(e)}:"function"==typeof e?function(){var a=e();return"number"!=typeof a&&console.warn('scrollYOffset should return number but returned value "'+a+'" of type '+typeof a),a}:(void 0!==e&&console.warn("Wrong value for scrollYOffset ReDoc option: should be string, number or function"),function(){return 0})}}),Object.defineProperty(e,"normalizeShowExtensions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e)return!1;if(""===e)return!0;if("string"!=typeof e)return e;switch(e){case"true":return!0;case"false":return!1;default:return e.split(",").map((function(e){return e.trim()}))}}}),Object.defineProperty(e,"normalizePayloadSampleIdx",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"number"==typeof e?Math.max(0,e):"string"==typeof e&&isFinite(e)?parseInt(e,10):0}}),__decorate([observable],e.prototype,"showConsole",void 0),e}();export{RedocNormalizedOptions};
2
2
  //# sourceMappingURL=RedocNormalizedOptions.js.map
@@ -225,6 +225,10 @@ export interface ResolvedThemeInterface {
225
225
  shape: {
226
226
  borderRadius: string;
227
227
  };
228
+ fab: {
229
+ backgroundColor: string;
230
+ color: string;
231
+ };
228
232
  extensionsHook?: (name: string, props: any) => string;
229
233
  }
230
234
  export declare type primitive = string | number | boolean | undefined | null;
@@ -1,2 +1,2 @@
1
- var _a,_b;import{darken,lighten,readableColor,transparentize}from"polished";import{ZERO_BREAKPOINT}from"./utils/media-css";var defaultTheme={spacing:{unit:5,sectionHorizontal:function(r){return 8*r.spacing.unit},sectionVertical:function(r){return 4*r.spacing.unit}},breakpoints:{small:"50rem",medium:"85rem",large:"105rem"},colors:{tonalOffset:.2,primary:{main:"#0065FB",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.primary.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.primary.main)},contrastText:function(r){var o=r.colors;return readableColor(o.primary.main)}},secondary:{main:"#E4E7EB",light:"#F5F7FA",dark:"#E4E7EB",contrastText:"#3E4C59"},accent:{main:"#59C3FF",light:"#b3dcf3",dark:"#033B73",contrastText:"#ffffff"},success:{main:"#41DE50",light:function(r){var o=r.colors;return lighten(2*o.tonalOffset,o.success.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.success.main)},contrastText:function(r){var o=r.colors;return readableColor(o.success.main)}},warning:{main:"#ffa500",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.warning.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.warning.main)},contrastText:"#ffffff"},error:{main:"#FF6161",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.error.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.error.main)},contrastText:"#ffffff"},text:{primary:"#1F2933",secondary:"#7b8794",light:"#F5F7FA"},border:{dark:"#616E7C",light:"#E4E7EB"},responses:{success:{borderColor:"#B1E996",backgroundColor:"#F6FFF4",tabTextColor:function(r){return r.colors.responses.success.borderColor}},error:{borderColor:"#FFC9C9",backgroundColor:"#FFF4F4",tabTextColor:function(r){return r.colors.responses.error.borderColor}},redirect:{borderColor:function(r){return r.colors.warning.main},backgroundColor:function(r){var o=r.colors;return transparentize(.9,o.responses.redirect.borderColor)},tabTextColor:function(r){return r.colors.responses.redirect.borderColor}},info:{borderColor:"#87ceeb",backgroundColor:function(r){var o=r.colors;return transparentize(.9,o.responses.info.borderColor)},tabTextColor:function(r){return r.colors.responses.info.borderColor}}},http:{get:"#3A9601",post:"#0065FB",put:"#93527B",options:"#947014",patch:"#bf581d",delete:"#C83637",basic:"#707070",link:"#07818F",head:"#A23DAD"}},schema:{linesColor:function(r){return r.colors.border.light},defaultDetailsWidth:"70%",typeNameColor:function(r){return r.colors.text.secondary},typeTitleColor:function(r){return r.schema.typeNameColor},requireLabelColor:"#FF0000",labelsTextSize:"0.9em",nestingSpacing:"1em",nestedBackground:function(r){return r.colors.secondary.light},caretColor:function(r){return r.colors.text.primary},caretSize:"9px"},typography:{fontSize:"14px",lineHeight:"1.5em",fontWeightRegular:"400",fontWeightBold:"600",fontWeightLight:"300",fontFamily:"Source Sans Pro, sans-serif",smoothing:"antialiased",optimizeSpeed:!0,headings:{fontFamily:function(r){return r.typography.fontFamily},fontWeight:"700",lineHeight:"1.6em"},code:{fontSize:"13px",fontFamily:"Source Code Pro, monospace",lineHeight:function(r){return r.typography.lineHeight},fontWeight:function(r){return r.typography.fontWeightRegular},color:"#e53935",backgroundColor:"rgba(38, 50, 56, 0.05)",wrap:!1},links:{color:function(r){return r.colors.primary.main},visited:function(r){return r.typography.links.color},hover:function(r){var o=r.typography;return lighten(.2,o.links.color)},textDecoration:"auto"},fieldName:{fontSize:function(r){return r.typography.code.fontSize},fontFamily:function(r){return r.typography.code.fontFamily},fontWeight:function(r){return r.typography.code.fontWeight}}},sidebar:{separatorLabelColor:function(r){return r.sidebar.textColor},separatorLineColor:"#DADADA",caretColor:function(r){return r.sidebar.textColor},caretSize:function(r){return r.sidebar.spacing.unit},spacing:{unit:8,paddingHorizontal:function(r){return r.sidebar.spacing.unit},paddingVertical:function(r){return r.sidebar.spacing.unit},offsetTop:function(r){return 2*r.sidebar.spacing.unit},offsetLeft:function(r){return 2*r.sidebar.spacing.unit},offsetNesting:function(r){return 2*r.sidebar.spacing.unit}},borderRadius:"4px",fontFamily:function(r){return r.typography.fontFamily},fontSize:function(r){return r.typography.fontSize},showAtBreakpoint:"small",width:"285px",backgroundColor:"#fff",rightLineColor:function(r){return r.colors.border.light},textColor:function(r){return r.colors.text.primary},activeTextColor:function(r){return r.sidebar.textColor},activeBgColor:function(r){return r.colors.border.light}},components:{buttons:{borderRadius:function(r){return r.shape.borderRadius},hoverStyle:"",fontWeight:function(r){return r.typography.fontWeightBold},boxShadow:"none",hoverBoxShadow:"0px 0px 12px 0px rgba(0, 0, 0, 0.1)",fontFamily:"inherit",sizes:{small:{fontSize:"12px",padding:"8px 10px",minWidth:"90px"},medium:{fontSize:"14px",padding:"8px 20px",minWidth:"120px"},large:{fontSize:"14px",padding:"12px 24px",minWidth:"150px"},xlarge:{fontSize:"16px",padding:"20px 24px",minWidth:"200px"}}},httpBadges:{borderRadius:"16px",fontFamily:function(r){return r.typography.code.fontFamily},fontWeight:function(r){return r.typography.fontWeightBold},color:function(r){return r.colors.text.light},sizes:{medium:{fontSize:"12px",lineHeight:"20px"},small:{fontSize:"8px",lineHeight:"15px"}}},tryItButton:{fullWidth:!1},tryItSendButton:{fullWidth:!1},panels:{borderRadius:"8px",backgroundColor:"#fff"},layoutControls:{top:"20px",width:"36px",height:"36px"}},logo:{maxHeight:function(r){return r.sidebar.width},maxWidth:function(r){return r.sidebar.width},gutter:"2px"},rightPanel:{showAtBreakpoint:"medium",backgroundColor:"#1F2933",panelBackgroundColor:"#52606D",panelControlsBackgroundColor:"#323F4B",width:"37.5%",textColor:"#ffffff"},codeBlock:{backgroundColor:function(r){return r.rightPanel.panelControlsBackgroundColor}},shape:{borderRadius:"4px"},layout:{showDarkRightPanel:!1,stacked:{maxWidth:(_a={},_a[ZERO_BREAKPOINT]="",_a.small="90%",_a.medium="75%",_a.large="1200px",_a)},"three-panel":{middlePanelMaxWidth:"none",maxWidth:(_b={},_b[ZERO_BREAKPOINT]="100%",_b.small="100%",_b.medium="100%",_b.large="1800px",_b)}}};export default defaultTheme;export function resolveTheme(r){var o={},t=0,n=function(e,i){Object.keys(e).forEach((function(a){var l=(i?i+".":"")+a,c=e[a];"function"==typeof c?Object.defineProperty(e,a,{get:function(){if(!o[l]){if(++t>1e3)throw new Error("Theme probably contains circular dependency at "+l+": "+c.toString());o[l]=c(r)}return o[l]},enumerable:!0}):"object"==typeof c&&n(c,l)}))};return n(r,""),JSON.parse(JSON.stringify(r))}
1
+ var _a,_b;import{darken,lighten,readableColor,transparentize}from"polished";import{ZERO_BREAKPOINT}from"./utils/media-css";var defaultTheme={spacing:{unit:5,sectionHorizontal:function(r){return 8*r.spacing.unit},sectionVertical:function(r){return 4*r.spacing.unit}},breakpoints:{small:"50rem",medium:"85rem",large:"105rem"},colors:{tonalOffset:.2,primary:{main:"#0065FB",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.primary.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.primary.main)},contrastText:function(r){var o=r.colors;return readableColor(o.primary.main)}},secondary:{main:"#E4E7EB",light:"#F5F7FA",dark:"#E4E7EB",contrastText:"#3E4C59"},accent:{main:"#59C3FF",light:"#b3dcf3",dark:"#033B73",contrastText:"#ffffff"},success:{main:"#41DE50",light:function(r){var o=r.colors;return lighten(2*o.tonalOffset,o.success.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.success.main)},contrastText:function(r){var o=r.colors;return readableColor(o.success.main)}},warning:{main:"#ffa500",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.warning.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.warning.main)},contrastText:"#ffffff"},error:{main:"#FF6161",light:function(r){var o=r.colors;return lighten(o.tonalOffset,o.error.main)},dark:function(r){var o=r.colors;return darken(o.tonalOffset,o.error.main)},contrastText:"#ffffff"},text:{primary:"#1F2933",secondary:"#7b8794",light:"#F5F7FA"},border:{dark:"#616E7C",light:"#E4E7EB"},responses:{success:{borderColor:"#B1E996",backgroundColor:"#F6FFF4",tabTextColor:function(r){return r.colors.responses.success.borderColor}},error:{borderColor:"#FFC9C9",backgroundColor:"#FFF4F4",tabTextColor:function(r){return r.colors.responses.error.borderColor}},redirect:{borderColor:function(r){return r.colors.warning.main},backgroundColor:function(r){var o=r.colors;return transparentize(.9,o.responses.redirect.borderColor)},tabTextColor:function(r){return r.colors.responses.redirect.borderColor}},info:{borderColor:"#87ceeb",backgroundColor:function(r){var o=r.colors;return transparentize(.9,o.responses.info.borderColor)},tabTextColor:function(r){return r.colors.responses.info.borderColor}}},http:{get:"#3A9601",post:"#0065FB",put:"#93527B",options:"#947014",patch:"#bf581d",delete:"#C83637",basic:"#707070",link:"#07818F",head:"#A23DAD"}},schema:{linesColor:function(r){return r.colors.border.light},defaultDetailsWidth:"70%",typeNameColor:function(r){return r.colors.text.secondary},typeTitleColor:function(r){return r.schema.typeNameColor},requireLabelColor:"#FF0000",labelsTextSize:"0.9em",nestingSpacing:"1em",nestedBackground:function(r){return r.colors.secondary.light},caretColor:function(r){return r.colors.text.primary},caretSize:"9px"},typography:{fontSize:"14px",lineHeight:"1.5em",fontWeightRegular:"400",fontWeightBold:"600",fontWeightLight:"300",fontFamily:"Source Sans Pro, sans-serif",smoothing:"antialiased",optimizeSpeed:!0,headings:{fontFamily:function(r){return r.typography.fontFamily},fontWeight:"700",lineHeight:"1.6em"},code:{fontSize:"13px",fontFamily:"Source Code Pro, monospace",lineHeight:function(r){return r.typography.lineHeight},fontWeight:function(r){return r.typography.fontWeightRegular},color:"#e53935",backgroundColor:"rgba(38, 50, 56, 0.05)",wrap:!1},links:{color:function(r){return r.colors.primary.main},visited:function(r){return r.typography.links.color},hover:function(r){var o=r.typography;return lighten(.2,o.links.color)},textDecoration:"auto"},fieldName:{fontSize:function(r){return r.typography.code.fontSize},fontFamily:function(r){return r.typography.code.fontFamily},fontWeight:function(r){return r.typography.code.fontWeight}}},sidebar:{separatorLabelColor:function(r){return r.sidebar.textColor},separatorLineColor:"#DADADA",caretColor:function(r){return r.sidebar.textColor},caretSize:function(r){return r.sidebar.spacing.unit},spacing:{unit:8,paddingHorizontal:function(r){return r.sidebar.spacing.unit},paddingVertical:function(r){return r.sidebar.spacing.unit},offsetTop:function(r){return 2*r.sidebar.spacing.unit},offsetLeft:function(r){return 2*r.sidebar.spacing.unit},offsetNesting:function(r){return 2*r.sidebar.spacing.unit}},borderRadius:"4px",fontFamily:function(r){return r.typography.fontFamily},fontSize:function(r){return r.typography.fontSize},showAtBreakpoint:"small",width:"285px",backgroundColor:"#fff",rightLineColor:function(r){return r.colors.border.light},textColor:function(r){return r.colors.text.primary},activeTextColor:function(r){return r.sidebar.textColor},activeBgColor:function(r){return r.colors.border.light}},components:{buttons:{borderRadius:function(r){return r.shape.borderRadius},hoverStyle:"",fontWeight:function(r){return r.typography.fontWeightBold},boxShadow:"none",hoverBoxShadow:"0px 0px 12px 0px rgba(0, 0, 0, 0.1)",fontFamily:"inherit",sizes:{small:{fontSize:"12px",padding:"8px 10px",minWidth:"90px"},medium:{fontSize:"14px",padding:"8px 20px",minWidth:"120px"},large:{fontSize:"14px",padding:"12px 24px",minWidth:"150px"},xlarge:{fontSize:"16px",padding:"20px 24px",minWidth:"200px"}}},httpBadges:{borderRadius:"16px",fontFamily:function(r){return r.typography.code.fontFamily},fontWeight:function(r){return r.typography.fontWeightBold},color:function(r){return r.colors.text.light},sizes:{medium:{fontSize:"12px",lineHeight:"20px"},small:{fontSize:"8px",lineHeight:"15px"}}},tryItButton:{fullWidth:!1},tryItSendButton:{fullWidth:!1},panels:{borderRadius:"8px",backgroundColor:"#fff"},layoutControls:{top:"20px",width:"36px",height:"36px"}},logo:{maxHeight:function(r){return r.sidebar.width},maxWidth:function(r){return r.sidebar.width},gutter:"2px"},fab:{backgroundColor:"#f2f2f2",color:"#0065FB"},rightPanel:{showAtBreakpoint:"medium",backgroundColor:"#1F2933",panelBackgroundColor:"#52606D",panelControlsBackgroundColor:"#323F4B",width:"37.5%",textColor:"#ffffff"},codeBlock:{backgroundColor:function(r){return r.rightPanel.panelControlsBackgroundColor}},shape:{borderRadius:"4px"},layout:{showDarkRightPanel:!1,stacked:{maxWidth:(_a={},_a[ZERO_BREAKPOINT]="",_a.small="90%",_a.medium="75%",_a.large="1200px",_a)},"three-panel":{middlePanelMaxWidth:"none",maxWidth:(_b={},_b[ZERO_BREAKPOINT]="100%",_b.small="100%",_b.medium="100%",_b.large="1800px",_b)}}};export default defaultTheme;export function resolveTheme(r){var o={},t=0,n=function(e,i){Object.keys(e).forEach((function(a){var l=(i?i+".":"")+a,c=e[a];"function"==typeof c?Object.defineProperty(e,a,{get:function(){if(!o[l]){if(++t>1e3)throw new Error("Theme probably contains circular dependency at "+l+": "+c.toString());o[l]=c(r)}return o[l]},enumerable:!0}):"object"==typeof c&&n(c,l)}))};return n(r,""),JSON.parse(JSON.stringify(r))}
2
2
  //# sourceMappingURL=theme.js.map
@@ -1,2 +1,2 @@
1
- import{__assign,__awaiter,__generator}from"tslib";import*as qs from"querystring";import{cryptoLib}from"./check";var DEFAULT_OAUTH2_REDIRECT_PAGE="/oauth2-redirect.html",OAuth2=function(){function e(){}return Object.defineProperty(e,"authorizeImplicit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=r.authorizationUrl,a=r.clientId,n=r.scopes,i=r.extraParams,o=void 0===i?{}:i,s=r.routingBasePath,c=r.redirectUri,l=r.successCallback,u=r.errorCallback,d=encodeState({date:(new Date).toString()}),h=new URL(t),_="/"===s?"":s,p=""+window.location.origin+_+DEFAULT_OAUTH2_REDIRECT_PAGE;for(var f in h.searchParams.set("client_id",a),h.searchParams.set("redirect_uri",c||p),h.searchParams.set("response_type","token"),h.searchParams.set("state",d),Array.isArray(n)&&h.searchParams.set("scope",n.join(" ")),o)h.searchParams.set(f,o[f]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:t,clientId:a,scopes:n},state:d,successCallback:function(r){l(r),e.clearRedirectData("implicit")},errorCallback:function(r){u(r),e.clearRedirectData("implicit")}},window.open(h.toString())}}),Object.defineProperty(e,"authorizeAuthorizationCode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this,a=r.authorizationUrl,n=r.tokenUrl,i=r.clientId,o=r.clientSecret,s=r.codeVerifier,c=r.codeChallenge,l=r.scopes,u=r.extraParams,d=void 0===u?{}:u,h=r.routingBasePath,_=r.redirectUri,p=r.successCallback,f=r.errorCallback,b=new URL(a),g="/"===h?"":h,w=""+window.location.origin+g+DEFAULT_OAUTH2_REDIRECT_PAGE,v=encodeState({date:(new Date).toString()});for(var m in b.searchParams.set("client_id",i),b.searchParams.set("redirect_uri",_||w),b.searchParams.set("response_type","code"),b.searchParams.set("state",v),Array.isArray(l)&&b.searchParams.set("scope",l.join(" ")),c&&(b.searchParams.set("code_challenge",c),b.searchParams.set("code_challenge_method","S256")),d)b.searchParams.set(m,d[m]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:a,clientId:i,scopes:l},state:v,successCallback:function(r){var a=r.auth_code;return __awaiter(t,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:qs.stringify(__assign(__assign(__assign({client_id:i,client_secret:o},s&&{code_verifier:s}),{code:a,grant_type:"authorization_code",redirect_uri:_||w}),d))})];case 1:return[4,handleResponseCallback(t.sent(),p,f)];case 2:return t.sent(),[3,4];case 3:return r=t.sent(),f(r),[3,4];case 4:return e.clearRedirectData("authorizationCode"),[2]}}))}))},errorCallback:function(r){f(r),e.clearRedirectData("authorizationCode")}},window.open(b.toString())}}),Object.defineProperty(e,"clearRedirectData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:function(){},errorCallback:function(){}}}}),Object.defineProperty(e,"authorizeClientCredentials",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=e.tokenUrl,t=e.clientId,a=e.clientSecret,n=e.scopes,i=void 0===n?[]:n,o=e.extraParams,s=void 0===o?{}:o,c=e.successCallback,l=e.errorCallback;return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:qs.stringify(__assign({client_id:t,client_secret:a,grant_type:"client_credentials",scope:Array.isArray(i)?i.join(" "):void 0},s))})];case 1:return[4,handleResponseCallback(n.sent(),c,l)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),l(e),[3,4];case 4:return[2]}}))}))}}),e}();export{OAuth2};export var oauth2Instance=new OAuth2;function handleResponseCallback(e,r,t){return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.ok?[4,e.json()]:[3,2];case 1:return a=l.sent(),r(a),[3,7];case 2:return n=t,i=Error.bind,(e.headers.get("Content-Type")||"").indexOf("json")>-1?(c=(s=JSON).stringify,[4,e.json()]):[3,4];case 3:return o=c.apply(s,[l.sent()]),[3,6];case 4:return[4,e.text()];case 5:o=l.sent(),l.label=6;case 6:n.apply(void 0,[new(i.apply(Error,[void 0,o]))]),l.label=7;case 7:return[2]}}))}))}export function randString(e){void 0===e&&(e=32);for(var r="";r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){var r=__assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export function sha256(e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){return r=(new TextEncoder).encode(e),[2,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(/=+$/,"")}export function deriveCodeChallenge(e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return r=base64UrlEncode,[4,sha256(e)];case 1:return[2,r.apply(void 0,[t.sent()])]}}))}))}
1
+ import{__assign,__awaiter,__generator}from"tslib";import*as qs from"querystring";import{cryptoLib}from"./utils";var DEFAULT_OAUTH2_REDIRECT_PAGE="/oauth2-redirect.html",OAuth2=function(){function e(){}return Object.defineProperty(e,"authorizeImplicit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=r.authorizationUrl,a=r.clientId,n=r.scopes,i=r.extraParams,o=void 0===i?{}:i,s=r.routingBasePath,c=r.redirectUri,l=r.successCallback,u=r.errorCallback,d=encodeState({date:(new Date).toString()}),h=new URL(t),_="/"===s?"":s,p=""+window.location.origin+_+DEFAULT_OAUTH2_REDIRECT_PAGE;for(var f in h.searchParams.set("client_id",a),h.searchParams.set("redirect_uri",c||p),h.searchParams.set("response_type","token"),h.searchParams.set("state",d),Array.isArray(n)&&h.searchParams.set("scope",n.join(" ")),o)h.searchParams.set(f,o[f]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:t,clientId:a,scopes:n},state:d,successCallback:function(r){l(r),e.clearRedirectData("implicit")},errorCallback:function(r){u(r),e.clearRedirectData("implicit")}},window.open(h.toString())}}),Object.defineProperty(e,"authorizeAuthorizationCode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var t=this,a=r.authorizationUrl,n=r.tokenUrl,i=r.clientId,o=r.clientSecret,s=r.codeVerifier,c=r.codeChallenge,l=r.scopes,u=r.extraParams,d=void 0===u?{}:u,h=r.routingBasePath,_=r.redirectUri,p=r.successCallback,f=r.errorCallback,b=new URL(a),g="/"===h?"":h,w=""+window.location.origin+g+DEFAULT_OAUTH2_REDIRECT_PAGE,v=encodeState({date:(new Date).toString()});for(var m in b.searchParams.set("client_id",i),b.searchParams.set("redirect_uri",_||w),b.searchParams.set("response_type","code"),b.searchParams.set("state",v),Array.isArray(l)&&b.searchParams.set("scope",l.join(" ")),c&&(b.searchParams.set("code_challenge",c),b.searchParams.set("code_challenge_method","S256")),d)b.searchParams.set(m,d[m]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:a,clientId:i,scopes:l},state:v,successCallback:function(r){var a=r.auth_code;return __awaiter(t,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:qs.stringify(__assign(__assign(__assign({client_id:i,client_secret:o},s&&{code_verifier:s}),{code:a,grant_type:"authorization_code",redirect_uri:_||w}),d))})];case 1:return[4,handleResponseCallback(t.sent(),p,f)];case 2:return t.sent(),[3,4];case 3:return r=t.sent(),f(r),[3,4];case 4:return e.clearRedirectData("authorizationCode"),[2]}}))}))},errorCallback:function(r){f(r),e.clearRedirectData("authorizationCode")}},window.open(b.toString())}}),Object.defineProperty(e,"clearRedirectData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:function(){},errorCallback:function(){}}}}),Object.defineProperty(e,"authorizeClientCredentials",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=e.tokenUrl,t=e.clientId,a=e.clientSecret,n=e.scopes,i=void 0===n?[]:n,o=e.extraParams,s=void 0===o?{}:o,c=e.successCallback,l=e.errorCallback;return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:qs.stringify(__assign({client_id:t,client_secret:a,grant_type:"client_credentials",scope:Array.isArray(i)?i.join(" "):void 0},s))})];case 1:return[4,handleResponseCallback(n.sent(),c,l)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),l(e),[3,4];case 4:return[2]}}))}))}}),e}();export{OAuth2};export var oauth2Instance=new OAuth2;function handleResponseCallback(e,r,t){return __awaiter(this,void 0,void 0,(function(){var a,n,i,o,s,c;return __generator(this,(function(l){switch(l.label){case 0:return e.ok?[4,e.json()]:[3,2];case 1:return a=l.sent(),r(a),[3,7];case 2:return n=t,i=Error.bind,(e.headers.get("Content-Type")||"").indexOf("json")>-1?(c=(s=JSON).stringify,[4,e.json()]):[3,4];case 3:return o=c.apply(s,[l.sent()]),[3,6];case 4:return[4,e.text()];case 5:o=l.sent(),l.label=6;case 6:n.apply(void 0,[new(i.apply(Error,[void 0,o]))]),l.label=7;case 7:return[2]}}))}))}export function randString(e){void 0===e&&(e=32);for(var r="";r.length<e;)r+=Math.random().toString(32).substring(2);return r.substring(0,e)}export function encodeState(e){var r=__assign({randomStr:randString()},e);return btoa(JSON.stringify(r))}export function sha256(e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){return r=(new TextEncoder).encode(e),[2,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(/=+$/,"")}export function deriveCodeChallenge(e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){switch(t.label){case 0:return r=base64UrlEncode,[4,sha256(e)];case 1:return[2,r.apply(void 0,[t.sent()])]}}))}))}
2
2
  //# sourceMappingURL=OAuth2.js.map
@@ -1,4 +1,3 @@
1
- export declare const cryptoLib: Crypto | undefined;
2
1
  export declare type LicenseInfo = {
3
2
  t?: boolean;
4
3
  i?: number;
@@ -1,2 +1,2 @@
1
- import{__awaiter,__generator}from"tslib";export var cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;function promisifyIECryptoRes(e){return"then"in e?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t}var getKey=function(){var e=str2ab(atob("undefined"!=typeof REDOCLY_PUBLIC_KEY?REDOCLY_PUBLIC_KEY:"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjNir5fXx/ZXoaEeXQ5XyxbNJ4YJYczoCRdSkL6NLzw1FHnng5Vfcgk5+bvox9QRYRbuk84mA4f2NhywDbXKECAwEAAQ=="));return promisifyIECryptoRes(cryptoLib.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!0,["verify"]))};function textEncode(e){if(window.TextEncoder)return(new TextEncoder).encode(e);for(var t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function verify(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,o,i;return __generator(this,(function(a){switch(a.label){case 0:return n=promisifyIECryptoRes,o=(r=cryptoLib.subtle).verify,i=[{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"}],[4,getKey()];case 1:return[2,n.apply(void 0,[o.apply(r,i.concat([a.sent(),str2ab(atob(t)),textEncode(e)]))])]}}))}))}export function isHostAllowed(e,t){return!0===t||!(!Array.isArray(t)||"undefined"==typeof window)&&(!("localhost"!==e&&"127.0.0.1"!==e&&!e.endsWith(".localhost")&&!t.find((function(t){return t===e||e.endsWith("."+t)})))||!!t.find((function(t){if(t.indexOf("*")===t.lastIndexOf("*")){var n=t.split("*"),r=n[0],o=n[1];return o&&e.startsWith(r)&&e.endsWith(o)&&o.split(".").length>2}})))}export default function parse(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r,o,i;return __generator(this,(function(a){switch(a.label){case 0:if("development"===process.env.NODE_ENV)return[2,{valid:!0,allowed:!0}];if(t=window.location.hostname,!e)return"localhost"===t||"127.0.0.1"===t||t.endsWith(".localhost")?[2,{local:!0}]:[2,{}];n=e.split("."),r=n[0],o=n[1],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,verify(atob(r),o)];case 2:return a.sent()?(i=JSON.parse(atob(r)),[3,4]):[2,{valid:!1}];case 3:return a.sent(),[2,{valid:!1,cryptoMissing:!0}];case 4:return i.valid=!0,(!i.e||Date.now()/1e3>i.e)&&(i.expired=!0),i.allowed=isHostAllowed(t,i.h),[2,i]}}))}))}
1
+ import{__awaiter,__generator}from"tslib";import{cryptoLib}from"./utils";function promisifyIECryptoRes(e){return"then"in e?e:new Promise((function(t){e.oncomplete=function(e){t(e.target.result)}}))}function str2ab(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0,o=e.length;n<o;n++)r[n]=e.charCodeAt(n);return t}var getKey=function(){var e,t=str2ab(atob("undefined"!=typeof REDOCLY_PUBLIC_KEY?REDOCLY_PUBLIC_KEY:"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMHjNir5fXx/ZXoaEeXQ5XyxbNJ4YJYczoCRdSkL6NLzw1FHnng5Vfcgk5+bvox9QRYRbuk84mA4f2NhywDbXKECAwEAAQ=="));return promisifyIECryptoRes(null===(e=cryptoLib)||void 0===e?void 0:e.subtle.importKey("spki",t,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!0,["verify"]))};function textEncode(e){if(window.TextEncoder)return(new TextEncoder).encode(e);for(var t=unescape(encodeURIComponent(e)),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function verify(e,t){var r;return __awaiter(this,void 0,void 0,(function(){var n,o,i,a,s;return __generator(this,(function(l){switch(l.label){case 0:return n=promisifyIECryptoRes,null!==(r=cryptoLib)&&void 0!==r?[3,1]:(o=void 0,[3,3]);case 1:return a=(i=r.subtle).verify,s=[{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"}],[4,getKey()];case 2:o=a.apply(i,s.concat([l.sent(),str2ab(atob(t)),textEncode(e)])),l.label=3;case 3:return[2,n.apply(void 0,[o])]}}))}))}export function isHostAllowed(e,t){return!0===t||!(!Array.isArray(t)||"undefined"==typeof window)&&(!("localhost"!==e&&"127.0.0.1"!==e&&!e.endsWith(".localhost")&&!t.find((function(t){return t===e||e.endsWith("."+t)})))||!!t.find((function(t){if(t.indexOf("*")===t.lastIndexOf("*")){var r=t.split("*"),n=r[0],o=r[1];return o&&e.startsWith(n)&&e.endsWith(o)&&o.split(".").length>2}})))}export default function parse(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,o,i;return __generator(this,(function(a){switch(a.label){case 0:if("development"===process.env.NODE_ENV)return[2,{valid:!0,allowed:!0}];if(t=window.location.hostname,!e)return"localhost"===t||"127.0.0.1"===t||t.endsWith(".localhost")?[2,{local:!0}]:[2,{}];r=e.split("."),n=r[0],o=r[1],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,verify(atob(n),o)];case 2:return a.sent()?(i=JSON.parse(atob(n)),[3,4]):[2,{valid:!1}];case 3:return a.sent(),[2,{valid:!1,cryptoMissing:!0}];case 4:return i.valid=!0,(!i.e||Date.now()/1e3>i.e)&&(i.expired=!0),i.allowed=isHostAllowed(t,i.h),[2,i]}}))}))}
2
2
  //# sourceMappingURL=check.js.map
@@ -13,3 +13,4 @@ export declare function normalizeMimeType(mimeType?: string): string | undefined
13
13
  export declare function unescapeServerVariables(str: string): string;
14
14
  export declare function arrayMerge<T>(target: T[], source: T[]): T[];
15
15
  export declare function isEmptyObject(obj: GenericObject): boolean;
16
+ export declare const cryptoLib: Crypto | undefined;
@@ -1,2 +1,2 @@
1
- import merge from"deepmerge";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 e.split(";")[0].toLowerCase()}export function unescapeServerVariables(e){var r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}export function arrayMerge(e,r){if(e.length){var t=e.map((function(e,t){return merge(e,r[t]||{})}));return r.length>e.length?t.concat(r.slice(e.length)):t}return r}export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}
1
+ import merge from"deepmerge";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 e.split(";")[0].toLowerCase()}export function unescapeServerVariables(e){var r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//")}export function arrayMerge(e,r){if(e.length){var t=e.map((function(e,t){return merge(e,r[t]||{})}));return r.length>e.length?t.concat(r.slice(e.length)):t}return r}export function isEmptyObject(e){return!!e&&0===Object.keys(e).length}export var cryptoLib="undefined"!=typeof window&&(window.crypto||window.msCrypto)||void 0;
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.12.1",
3
+ "version": "2.12.4",
4
4
  "description": "Redocly Reference Docs",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",