@redocly/reference-docs 2.1.15 → 2.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli/commands/redocly-docs-cli.min.js +28 -28
- package/dist/console.redocly-reference-docs.min.js +3 -3
- package/dist/oauth2-redirect.js +2 -2
- package/dist/redocly-reference-docs.min.js +11 -11
- package/lib/components/Endpoint/Endpoint.d.ts +2 -2
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Endpoint/ServerList.d.ts +2 -2
- package/lib/components/Endpoint/ServerList.js +1 -1
- package/lib/components/Endpoint/Summary.d.ts +2 -2
- package/lib/components/Endpoint/Summary.js +1 -1
- package/lib/components/NextSectionButton.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/Panel/Accordion.js +1 -1
- package/lib/components/Panel/PanelBody.d.ts +1 -1
- package/lib/components/Panel/PanelBody.js +1 -1
- package/lib/components/Panel/PanelComponent.d.ts +2 -3
- package/lib/components/Panel/PanelComponent.js +1 -1
- package/lib/components/Panel/ResponsePanel.js +1 -1
- package/lib/components/ProProviders.js +1 -1
- package/lib/components/RedoclyReferenceDocs.d.ts +3 -3
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/Samples/ExampleSwitch.d.ts +1 -1
- package/lib/components/Samples/ExampleSwitch.js +1 -1
- package/lib/components/Samples/SamplesTabs.js +1 -1
- package/lib/components/Search/MenuItemProSearch.d.ts +4 -4
- package/lib/components/Search/ProSearchBox.d.ts +6 -6
- package/lib/components/Search/ProSearchBox.js +1 -1
- package/lib/components/Search/SearchField.js +1 -1
- package/lib/components/Search/styled.d.ts +3 -3
- package/lib/components/StoreProvider.d.ts +4 -4
- package/lib/components/StoreProvider.js +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabs.js +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib/components/common/Checkbox.js +1 -1
- package/lib/components/common/FileUpload/helper.d.ts +1 -1
- package/lib/components/common/FileUpload/helper.js +1 -1
- package/lib/components/common/TextField.d.ts +3 -3
- package/lib/components/common/TextField.js +1 -1
- package/lib/components/console/OperationParameters.d.ts +1 -1
- package/lib/components/console/OperationParameters.js +1 -1
- package/lib/components/console/RequestBody.js +1 -1
- package/lib/components/console/ResponsePanel.d.ts +1 -1
- package/lib/components/console/ResponsePanel.js +1 -1
- package/lib/components/console/ServerDropdown.d.ts +1 -1
- package/lib/components/console/ServerDropdown.js +1 -1
- package/lib/redoc-lib/src/common-elements/LinkToField.d.ts +3 -2
- package/lib/redoc-lib/src/common-elements/LinkToField.js +1 -1
- package/lib/redoc-lib/src/components/ApiLogo/ApiLogo.js +1 -1
- package/lib/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +5 -2
- package/lib/redoc-lib/src/components/ApiLogo/styled.elements.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib/redoc-lib/src/services/models/Example.js +1 -1
- package/lib/redoc-lib/src/services/models/Field.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Operation.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib/redoc-lib/src/theme.d.ts +1 -0
- package/lib/redoc-lib/src/utils/JsonPointer.d.ts +5 -5
- package/lib/redoc-lib/src/utils/JsonPointer.js +1 -1
- package/lib/redoc-lib/src/utils/loadAndBundleSpec.js +1 -1
- package/lib/redoc-lib/src/utils/memoize.js +1 -1
- package/lib/redoc-lib/src/utils/openapi.d.ts +0 -2
- package/lib/services/ProMenu.d.ts +2 -5
- package/lib/services/ProStore.d.ts +3 -2
- package/lib/services/ProStore.js +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/helpers/reducer.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
- package/lib/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
- package/lib/services/extendTheme.d.ts +4 -4
- package/lib/services/extendTheme.js +1 -1
- package/lib/services/history/ProHashHistoryService.d.ts +1 -1
- package/lib/services/history/PushStateHistoryService.d.ts +1 -1
- package/lib/services/utils.d.ts +1 -1
- package/lib/standalone.d.ts +4 -3
- package/lib/standalone.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib-esm/components/Endpoint/Endpoint.d.ts +2 -2
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Endpoint/ServerList.d.ts +2 -2
- package/lib-esm/components/Endpoint/ServerList.js +1 -1
- package/lib-esm/components/Endpoint/Summary.d.ts +2 -2
- package/lib-esm/components/Endpoint/Summary.js +1 -1
- package/lib-esm/components/NextSectionButton.js +1 -1
- package/lib-esm/components/Overlay.js +1 -1
- package/lib-esm/components/Panel/Accordion.js +1 -1
- package/lib-esm/components/Panel/PanelBody.d.ts +1 -1
- package/lib-esm/components/Panel/PanelBody.js +1 -1
- package/lib-esm/components/Panel/PanelComponent.d.ts +2 -3
- package/lib-esm/components/Panel/PanelComponent.js +1 -1
- package/lib-esm/components/Panel/ResponsePanel.js +1 -1
- package/lib-esm/components/ProProviders.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocs.d.ts +3 -3
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/Samples/ExampleSwitch.d.ts +1 -1
- package/lib-esm/components/Samples/ExampleSwitch.js +1 -1
- package/lib-esm/components/Samples/SamplesTabs.js +1 -1
- package/lib-esm/components/Search/MenuItemProSearch.d.ts +4 -4
- package/lib-esm/components/Search/ProSearchBox.d.ts +6 -6
- package/lib-esm/components/Search/ProSearchBox.js +1 -1
- package/lib-esm/components/Search/SearchField.js +1 -1
- package/lib-esm/components/Search/styled.d.ts +3 -3
- package/lib-esm/components/StoreProvider.d.ts +4 -4
- package/lib-esm/components/StoreProvider.js +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabs.js +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib-esm/components/common/Checkbox.js +1 -1
- package/lib-esm/components/common/FileUpload/helper.d.ts +1 -1
- package/lib-esm/components/common/FileUpload/helper.js +1 -1
- package/lib-esm/components/common/TextField.d.ts +3 -3
- package/lib-esm/components/common/TextField.js +1 -1
- package/lib-esm/components/console/OperationParameters.d.ts +1 -1
- package/lib-esm/components/console/OperationParameters.js +1 -1
- package/lib-esm/components/console/RequestBody.js +1 -1
- package/lib-esm/components/console/ResponsePanel.d.ts +1 -1
- package/lib-esm/components/console/ResponsePanel.js +1 -1
- package/lib-esm/components/console/ServerDropdown.d.ts +1 -1
- package/lib-esm/components/console/ServerDropdown.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/LinkToField.d.ts +3 -2
- package/lib-esm/redoc-lib/src/common-elements/LinkToField.js +1 -1
- package/lib-esm/redoc-lib/src/components/ApiLogo/ApiLogo.js +1 -1
- package/lib-esm/redoc-lib/src/components/ApiLogo/styled.elements.d.ts +5 -2
- package/lib-esm/redoc-lib/src/components/ApiLogo/styled.elements.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/redoc-lib/src/services/RedocNormalizedOptions.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Example.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Field.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib-esm/redoc-lib/src/theme.d.ts +1 -0
- package/lib-esm/redoc-lib/src/utils/JsonPointer.d.ts +5 -5
- package/lib-esm/redoc-lib/src/utils/JsonPointer.js +1 -1
- package/lib-esm/redoc-lib/src/utils/loadAndBundleSpec.js +1 -1
- package/lib-esm/redoc-lib/src/utils/memoize.js +1 -1
- package/lib-esm/redoc-lib/src/utils/openapi.d.ts +0 -2
- package/lib-esm/services/ProMenu.d.ts +2 -5
- package/lib-esm/services/ProStore.d.ts +3 -2
- package/lib-esm/services/ProStore.js +1 -1
- package/lib-esm/services/code-samples/generator.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/helpers/reducer.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/php/utils.d.ts +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/php/utils.js +1 -1
- package/lib-esm/services/extendTheme.d.ts +4 -4
- package/lib-esm/services/extendTheme.js +1 -1
- package/lib-esm/services/history/ProHashHistoryService.d.ts +1 -1
- package/lib-esm/services/history/PushStateHistoryService.d.ts +1 -1
- package/lib-esm/services/utils.d.ts +1 -1
- package/lib-esm/standalone.d.ts +4 -3
- package/lib-esm/standalone.js +1 -1
- package/lib-esm/utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -56,10 +56,7 @@ export declare class ProMenu {
|
|
|
56
56
|
* current active item
|
|
57
57
|
*/
|
|
58
58
|
get activeItem(): IMenuItem;
|
|
59
|
-
getItemById: (id: string) => (
|
|
60
|
-
type: "spec" | MenuItemType;
|
|
61
|
-
linkable?: boolean | undefined;
|
|
62
|
-
} & IMenuItem) | undefined;
|
|
59
|
+
getItemById: (id: string) => (ExtendedMenuItem & IMenuItem) | undefined;
|
|
63
60
|
/**
|
|
64
61
|
* update active items on initial page load
|
|
65
62
|
* @param currentId
|
|
@@ -97,7 +94,7 @@ export declare class ProMenu {
|
|
|
97
94
|
* activate menu item and scroll to it
|
|
98
95
|
* @see MenuStore.activate
|
|
99
96
|
*/
|
|
100
|
-
activateAndScroll(item?: IMenuItem, updateLocation?: boolean, rewriteHistory?: boolean, currentId?: string): void;
|
|
97
|
+
activateAndScroll(item?: IMenuItem | ExtendedMenuItem, updateLocation?: boolean, rewriteHistory?: boolean, currentId?: string): void;
|
|
101
98
|
/**
|
|
102
99
|
* scrolls to active section
|
|
103
100
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IValueDidChange } from 'mobx';
|
|
1
2
|
import { ContentItemModel, IMenuItem, MarkerService, OperationModel, RedocNormalizedOptions, RedocRawOptions, SearchStore, SpecStore, OpenAPIExternalDocumentation } from '../redoc-lib';
|
|
2
3
|
import { ProMenu } from './ProMenu';
|
|
3
4
|
import { SearchResultMeta } from './SearchStore';
|
|
@@ -137,9 +138,9 @@ export declare class ProStore {
|
|
|
137
138
|
activateSampleLanguage: import("lodash").DebouncedFunc<(language: string) => void>;
|
|
138
139
|
startLoader(): void;
|
|
139
140
|
stopLoader(): void;
|
|
140
|
-
dereferenceSpecForTryIt(idx: number, op: OperationModel): Promise<
|
|
141
|
+
dereferenceSpecForTryIt(idx: number, op: OperationModel): Promise<GenericObject>;
|
|
141
142
|
observeAllAndRemark(): void;
|
|
142
|
-
remark(change:
|
|
143
|
+
remark(change: IValueDidChange): void;
|
|
143
144
|
/**
|
|
144
145
|
* deserialize store
|
|
145
146
|
* **SUPER HACKY AND NOT OPTIMAL IMPLEMENTATION**
|
package/lib/services/ProStore.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),lodash_1=require("lodash"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),MultipleSpecsStore_1=require("./MultipleSpecsStore"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var r=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{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,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=r})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}exports.NestingGroup=NestingGroup;var ProStore=function(){function e(e,t,i,o){var r=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new redoc_lib_1.MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:store_types_1.LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dereferencedRawSpec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prevDerefKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activateSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:(0,lodash_1.debounce)((function(e){return r.setActiveSampleLanguage(e)}),500)}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(r.menu.items=[],r.menu.flatItems=r.menu.flatItems.slice(0,1),r.menu.renderItems=[])})));var n=Array.isArray(e),a=e&&Array.isArray(e.versions),s=this.options.disableSidebar?new history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,n||a):new history_1.ProHashHistoryService(this.options,n||a);this.definition=n?new MultipleSpecsStore_1.MultipleSpecsStore(e,this.options):a?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,s.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadSpecUrl&&(this.definition.info.downloadLink=i.downloadSpecUrl,this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(s.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,s),this.menu.initOnHistory(),this.options.disableSearch||this.options.disableSidebar||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return r.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.setGlobalStore)(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,r,n;e=deepClone(e),this.rawOptions=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(r=this.rawOptions.showChangeLayoutButton)||void 0===r||r,this.options.layout=this.rawOptions.layout||store_types_1.LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||"summary-only",this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(n=this.rawOptions)||void 0===n?void 0:n.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser";break;default:this.options.pagination="none",this.options.routingStrategy="hash"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&(0,utils_1.normalizePath)(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]}}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.DeepSearchStore(e),t&&setTimeout((function(){return i.search.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,r,n=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=n.versions[t.newValue]._searchIndexName;if(redoc_lib_1.IS_BROWSER&&a){var s=n.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(r=i.search)||void 0===r||r.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),redoc_lib_1.IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.fromStorage)("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,(0,utils_2.toStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.toLocalStorage)("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,(0,utils_2.toLocalStorage)("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i,o,r,n;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var a,s,l,p,u,c,d,h,b;return(0,tslib_1.__generator)(this,(function(f){switch(f.label){case 0:return(a=e+"/"+t.path+"/"+t.httpVerb)===this.prevDerefKey&&this.dereferencedRawSpec?[2,this.dereferencedRawSpec]:(this.dereferencedRawSpec=void 0,this.prevDerefKey=a,s=void 0!==e&&this.definition.specs?this.definition.specs[e].parser.definition:this.definition.parser.definition,l=JSON.parse(JSON.stringify(s)),p=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(l)),{components:l.components,paths:(h={},h[t.path]=(b={},b[t.httpVerb]=null===(o=null===(i=l.paths)||void 0===i?void 0:i[t.path])||void 0===o?void 0:o[t.httpVerb],b.parameters=null===(n=null===(r=l.paths)||void 0===r?void 0:r[t.path])||void 0===n?void 0:n.parameters,b),h)}),u=new openapi_core_1.Config({}),c=(0,redoc_lib_1.createParsedDocument)(p),d={config:u,doc:c,dereference:!0},[4,(0,openapi_core_1.bundle)(d)]);case 1:return f.sent(),this.dereferencedRawSpec=l,[2,l]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,r=i;o<r.length;o++){var n=r[o];if("operation"===n.type)for(var a=0,s=n.responses;a<s.length;a++){var l=s[a];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===n.type&&t(n.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.observe)(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i=new e(t.definition.data,t.definition.url,t.options,!1);(0,utils_2.setGlobalStore)(i),i.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,i.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&t.definition.activeVersionIdx&&(i.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var o=i.menu.flatItems[i.menu.activeItemIdx];if(o&&i.menu.activate(o,!1),!i.options.disableSearch){var r=new URL(window.location.href);r.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:r.pathname+(r.pathname.endsWith("/")?"":"/")+t.searchIndexPath,i.search.fromExternalJS(r.toString(),t.searchIndexExport)}return t.tryItOperationId&&(i.tryItOperation=i.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return i.observeAllAndRemark()}),0),i}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var e,t;return(0,tslib_1.__generator)(this,(function(i){switch(i.label){case 0:return t={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof MultipleSpecsStore_1.MultipleSpecsStore||this.definition instanceof VersionedSpecStore_1.VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return e=i.sent(),[3,3];case 2:e=void 0,i.label=3;case 3:return[2,(t.searchIndex=e,t.options=this.rawOptions,t.tryItOperationId=this.tryItOperation&&this.tryItOperation.id||void 0,t)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=Math.max(0,e),i=Math.min(this.menu.flatItems.length,t+5),o=[],r=t;r<i;r++){var n;(n=this.menu.getElementAt(r))&&(n&&o.push(n))}"item"===this.options.pagination&&(this.menu.flatItems[e]&&this.menu.flatItems[e].parent&&(n=this.menu.getElementAt(this.menu.flatItems[e].parent.absoluteIdx))&&o.push(n));this.marker.addOnly(o),this.marker.mark()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){var t,i,o;if("object"!=typeof e||null===e)return e;for(o in t=Array.isArray(e)?[]:{},e)i=e[o],t[o]=deepClone(i);return t}
|
|
1
|
+
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProStore=exports.NestingGroup=void 0;var tslib_1=require("tslib"),mobx_1=require("mobx"),openapi_core_1=require("@redocly/openapi-core"),lodash_1=require("lodash"),redoc_lib_1=require("../redoc-lib"),history_1=require("./history"),ProMenu_1=require("./ProMenu"),SearchStore_1=require("./SearchStore"),extendTheme_1=require("./extendTheme"),pluggable_1=require("../components/pluggable"),MultipleSpecsStore_1=require("./MultipleSpecsStore"),VersionedSpecStore_1=require("./VersionedSpecStore"),check_1=(0,tslib_1.__importDefault)(require("./check")),utils_1=require("./utils"),utils_2=require("../utils"),store_types_1=require("./store-types"),global="undefined"==typeof window?{__REDOCLY_SEARCH_URL:void 0}:window,NestingGroup=function(){function e(e,t,i,o){var r=this;Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"absoluteIdx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{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,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"linkable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"expanded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"depth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"level",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),(0,mobx_1.makeObservable)(this),this.id="section/"+e,this.type="nesting-group",this.name=i||"",this.level=1,this.depth=1,this.description="",this.parent=void 0,this.expanded=!1,this.items=t,this.linkable=!!o,t.forEach((function(e){return e.parent=r})),increaseDepthDeep(t)}return Object.defineProperty(e.prototype,"activate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!0}}),Object.defineProperty(e.prototype,"expand",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!0,this.parent&&this.parent.expand()}}),Object.defineProperty(e.prototype,"collapse",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.expanded=!1}}),Object.defineProperty(e.prototype,"deactivate",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.active=!1}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"active",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"expanded",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"activate",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"expand",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"collapse",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"deactivate",null),e}();function increaseDepthDeep(e){Array.isArray(e)&&e.forEach((function(e){e.depth++,e.parent&&"group"===e.parent.type&&(e.depth=e.parent.depth),increaseDepthDeep(e.items)}))}exports.NestingGroup=NestingGroup;var ProStore=function(){function e(e,t,i,o){var r=this;void 0===i&&(i={}),void 0===o&&(o=!0),Object.defineProperty(this,"rawOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menu",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"definition",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"marker",{enumerable:!0,configurable:!0,writable:!0,value:new redoc_lib_1.MarkerService}),Object.defineProperty(this,"scroll",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"search",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tryItOperation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showRightPanel",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"layout",{enumerable:!0,configurable:!0,writable:!0,value:store_types_1.LayoutVariant.THREE_PANEL}),Object.defineProperty(this,"activeSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dereferencedRawSpec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prevDerefKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"l",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activateSampleLanguage",{enumerable:!0,configurable:!0,writable:!0,value:(0,lodash_1.debounce)((function(e){return r.setActiveSampleLanguage(e)}),500)}),(0,mobx_1.makeObservable)(this),this.initProOptions(i),redoc_lib_1.IS_BROWSER&&(this.l=(0,check_1.default)(i.licenseKey),this.l.then((function(e){e.valid&&e.allowed&&!e.expired||e.local||(r.menu.items=[],r.menu.flatItems=r.menu.flatItems.slice(0,1),r.menu.renderItems=[])})));var n=Array.isArray(e),a=e&&Array.isArray(e.versions),s=this.options.disableSidebar?new history_1.FakeHistoryService(this.options):"browser"===this.options.routingStrategy?new history_1.PushStateHistoryService(this.options,n||a):new history_1.ProHashHistoryService(this.options,n||a);this.definition=n?new MultipleSpecsStore_1.MultipleSpecsStore(e,this.options):a?new VersionedSpecStore_1.VersionedSpecStore(e,this.options,s.currentId.split("/")[0]):new redoc_lib_1.SpecStore(e,t,this.options),i.downloadSpecUrl&&(this.definition.info.downloadLink=i.downloadSpecUrl,this.definition.info.downloadFileName=""),this.scroll=new redoc_lib_1.ScrollService(this.options),this.options.disableSidebar||ProMenu_1.ProMenu.updateOnHistory(s.currentId,this.scroll),this.menu=new ProMenu_1.ProMenu(this.definition,this.scroll,this.options,s),this.menu.initOnHistory(),this.options.disableSearch||this.options.disableSidebar||this.initSearch(this.options,o),this.disposer=(0,mobx_1.observe)(this.menu,"none"===this.options.pagination?"activeItemIdx":"activeRenderItemIdx",(function(e){setTimeout((function(){return r.updateMarkOnMenu(e.newValue)}))})),(0,utils_2.setGlobalStore)(this)}return Object.defineProperty(e.prototype,"initProOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,i,o,r,n;e=deepClone(e),this.rawOptions=(0,extendTheme_1.extendTheme)(e),this.options=new redoc_lib_1.RedocNormalizedOptions(this.rawOptions,DEFAULT_OPTIONS),this.options.showConsole=null===(t=this.rawOptions.showConsole)||void 0===t||t,this.options.hideRightPanel=null!==(i=this.rawOptions.hideRightPanel)&&void 0!==i&&i,this.showRightPanel=!this.options.hideRightPanel,this.options.showRightPanelToggle=null===(o=this.rawOptions.showRightPanelToggle)||void 0===o||o,this.options.showChangeLayoutButton=null===(r=this.rawOptions.showChangeLayoutButton)||void 0===r||r,this.options.layout=this.rawOptions.layout||store_types_1.LayoutVariant.THREE_PANEL,this.options.defaultSampleLanguage=this.rawOptions.defaultSampleLanguage||"",this.options.deepLinkSeparator=this.rawOptions.deepLinkSeparator||"/",this.options.deepLinkPrefix=this.rawOptions.deepLinkPrefix||"!",this.options.disableDeepLinks=this.rawOptions.disableDeepLinks||!1,this.options.sideNavStyle=this.rawOptions.sideNavStyle||"summary-only",this.options.whiteLabel=!!this.rawOptions.whiteLabel,this.options.hideLogo=!!this.rawOptions.hideLogo,this.options.hideInfoSection=!!this.rawOptions.hideInfoSection,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.oAuth2RedirectURI=this.rawOptions.oAuth2RedirectURI||null,this.options.events=this.rawOptions.events||{},this.options.corsProxyUrl=this.rawOptions.corsProxyUrl?addTrailingSlash(this.rawOptions.corsProxyUrl):null,this.options.authCorsProxyUrl=this.rawOptions.authCorsProxyUrl?addTrailingSlash(this.rawOptions.authCorsProxyUrl):null,this.options.theme.scrollYOffset=this.options.scrollYOffset,this.options.linkForId=this.rawOptions.linkForId||null,this.options.generateDeepLink=this.rawOptions.generateDeepLink||null,this.options.onDeepLinkClick=this.rawOptions.onDeepLinkClick||null,this.options.requestInterceptor=this.rawOptions.requestInterceptor||null,this.options.sidebarLinks=this.rawOptions.sidebarLinks||{};var a="object"==typeof this.rawOptions.layout?this.rawOptions.layout:null;if(this.options.pagination=this.rawOptions.pagination||"none",this.options.routingStrategy="none"===this.options.pagination?"hash":"browser",!(null===(n=this.rawOptions)||void 0===n?void 0:n.pagination)&&(null==a?void 0:a.scope))switch(console.warn('"layout.scope" and "routingStrategy" settings are deprecated. Please, use "pagination" instead.'),null==a?void 0:a.scope){case"all":this.options.pagination="none",this.options.routingStrategy="hash";break;case"section":this.options.pagination="section",this.options.routingStrategy="browser";break;case"item":this.options.pagination="item",this.options.routingStrategy="browser";break;default:this.options.pagination="none",this.options.routingStrategy="hash"}this.options.markdownItemsPagination="none",!1!==this.rawOptions.showNextButton&&(this.options.showNextButton=!0),this.options.disableSidebar=!!e.disableSidebar,this.options.disableSidebar&&(this.options.theme.sidebar.width="0px"),this.options.skipBundleAndConvert=!!e.skipBundleAndConvert,this.options.routingBasePath=e.routingBasePath&&(0,utils_1.normalizePath)(e.routingBasePath)||"",this.options.searchAutoExpand=!1!==e.searchAutoExpand,this.options.searchMode=e.searchMode||"default",this.options.ctrlFHijack=void 0===e.ctrlFHijack||e.ctrlFHijack,this.options.disablePaginationLoadingAnimation=!!e.disablePaginationLoadingAnimation||"none"===this.options.pagination,this.options.showConsole,this.options.generateCodeSamples=e.generateCodeSamples||{languages:[]}}}),Object.defineProperty(e.prototype,"initSearch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i=this;global.__REDOCLY_SEARCH_URL?this.search=new SearchStore_1.RemoteSearch(global.__REDOCLY_SEARCH_URL):this.search=new SearchStore_1.DeepSearchStore(e),t&&setTimeout((function(){var e;return null===(e=i.search)||void 0===e?void 0:e.indexItems(i.menu.items)}),50),this.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&(0,mobx_1.observe)(this.definition,"activeVersionIdx",(function(t){var o,r,n=i.definition;null===(o=i.search)||void 0===o||o.dispose(),i.search=new SearchStore_1.DeepSearchStore(e);var a=n.versions[t.newValue]._searchIndexName;if(redoc_lib_1.IS_BROWSER&&a){var s=n.versions[t.newValue]._searchIndexName,l=new URL(window.location.href);l.pathname=joinURLs(i.options.routingBasePath,s),null===(r=i.search)||void 0===r||r.fromExternalJS(l.toString(),__redoc_state.searchIndexExport),i.observeAllAndRemark()}else setTimeout((function(){var e;null===(e=i.search)||void 0===e||e.indexItems(i.menu.items)}),0)})),redoc_lib_1.IS_BROWSER&&this.observeAllAndRemark()}}),Object.defineProperty(e.prototype,"onDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.menu.updateOnHistory(),this.updateMarkOnMenu(this.menu.activeItemIdx),this.layout=(0,utils_2.fromLocalStorage)("layoutVariant")||this.options.layout||this.layout,this.activeSampleLanguage=(0,utils_2.fromLocalStorage)("activeSampleLanguage")||this.options.defaultSampleLanguage,this.options.showRightPanelToggle){var e=(0,utils_2.fromStorage)("showRightPanelToggleState");e&&(this.showRightPanel="true"===e)}}}),Object.defineProperty(e.prototype,"toggleRightPanel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.showRightPanel=null!=e?e:!this.showRightPanel,(0,utils_2.toStorage)("showRightPanelToggleState",JSON.stringify(this.showRightPanel))}}),Object.defineProperty(e.prototype,"toggleLayout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=store_types_1.LayoutVariant.THREE_PANEL),this.layout=e,(0,utils_2.toLocalStorage)("layoutVariant",e)}}),Object.defineProperty(e.prototype,"disableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!1}}),Object.defineProperty(e.prototype,"enableConsole",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.options.showConsole=!0}}),Object.defineProperty(e.prototype,"tryItOut",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.tryItOperation=e}}),Object.defineProperty(e.prototype,"setActiveSampleLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.activeSampleLanguage===e)return this.stopLoader();this.activeSampleLanguage=e,(0,utils_2.toLocalStorage)("activeSampleLanguage",e)}}),Object.defineProperty(e.prototype,"startLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading||(this.isLoading=!0)}}),Object.defineProperty(e.prototype,"stopLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isLoading&&(this.isLoading=!1)}}),Object.defineProperty(e.prototype,"dereferenceSpecForTryIt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var i,o,r,n;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var a,s,l,p,u,c,d,h,b;return(0,tslib_1.__generator)(this,(function(f){switch(f.label){case 0:return(a=e+"/"+t.path+"/"+t.httpVerb)===this.prevDerefKey&&this.dereferencedRawSpec?[2,this.dereferencedRawSpec]:(this.dereferencedRawSpec=void 0,this.prevDerefKey=a,s=void 0!==e&&this.definition.specs?this.definition.specs[e].parser.definition:this.definition.parser.definition,l=JSON.parse(JSON.stringify(s)),p=(0,tslib_1.__assign)((0,tslib_1.__assign)({},getSpecVersionObj(l)),{components:l.components,paths:(h={},h[t.path]=(b={},b[t.httpVerb]=null===(o=null===(i=l.paths)||void 0===i?void 0:i[t.path])||void 0===o?void 0:o[t.httpVerb],b.parameters=null===(n=null===(r=l.paths)||void 0===r?void 0:r[t.path])||void 0===n?void 0:n.parameters,b),h)}),u=new openapi_core_1.Config({}),c=(0,redoc_lib_1.createParsedDocument)(p),d={config:u,doc:c,dereference:!0},[4,(0,openapi_core_1.bundle)(d)]);case 1:return f.sent(),this.dereferencedRawSpec=l,[2,l]}}))}))}}),Object.defineProperty(e.prototype,"observeAllAndRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=function(i){for(var o=0,r=i;o<r.length;o++){var n=r[o];if("operation"===n.type)for(var a=0,s=n.responses;a<s.length;a++){var l=s[a];(0,mobx_1.observe)(l,"expanded",(function(t){return e.remark(t)}))}else"tag"===n.type&&t(n.items||[])}};t(this.menu.renderItems),"none"!==this.options.pagination&&(0,mobx_1.observe)(this.menu,"renderItems",(function(){return t(e.menu.renderItems)}))}}),Object.defineProperty(e.prototype,"remark",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.newValue&&setTimeout((function(){return t.marker.mark()}),0)}}),Object.defineProperty(e,"fromJS",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var i,o=new e(t.definition.data,t.definition.url,t.options,!1);(0,utils_2.setGlobalStore)(o),o.menu.activeItemIdx=void 0!==t.menu.activeItemIdx?t.menu.activeItemIdx:-1,o.definition instanceof VersionedSpecStore_1.VersionedSpecStore&&t.definition.activeVersionIdx&&(o.definition.activeVersionIdx=t.definition.activeVersionIdx||0);var r=o.menu.flatItems[o.menu.activeItemIdx];if(r&&o.menu.activate(r,!1),!o.options.disableSearch){var n=new URL(window.location.href);n.pathname=t.searchIndexPath&&t.searchIndexPath.startsWith("/")?t.searchIndexPath:n.pathname+(n.pathname.endsWith("/")?"":"/")+t.searchIndexPath,null===(i=o.search)||void 0===i||i.fromExternalJS(n.toString(),t.searchIndexExport)}return t.tryItOperationId&&(o.tryItOperation=o.menu.flatItems.find((function(e){return e.id===t.tryItOperationId}))),setTimeout((function(){return o.observeAllAndRemark()}),0),o}}),Object.defineProperty(e.prototype,"toJS",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return(0,tslib_1.__awaiter)(this,void 0,void 0,(function(){var t,i;return(0,tslib_1.__generator)(this,(function(o){switch(o.label){case 0:return i={menu:{activeItemIdx:this.menu.activeItemIdx},definition:this.definition instanceof MultipleSpecsStore_1.MultipleSpecsStore||this.definition instanceof VersionedSpecStore_1.VersionedSpecStore?{url:void 0,data:this.definition.toJS()}:{url:this.definition.parser.definitionUrl,data:this.definition.parser.definition}},this.search?[4,this.search.toJS()]:[3,2];case 1:return t=o.sent(),[3,3];case 2:t=void 0,o.label=3;case 3:return[2,(i.searchIndex=t,i.options=this.rawOptions,i.tryItOperationId=null===(e=this.tryItOperation)||void 0===e?void 0:e.id,i)]}}))}))}}),Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.scroll.dispose(),this.menu.dispose(),this.search&&this.search.dispose(),this.disposer()}}),Object.defineProperty(e.prototype,"updateMarkOnMenu",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,i=Math.max(0,e),o=Math.min(this.menu.flatItems.length,i+5),r=[],n=i;n<o;n++){var a;(a=this.menu.getElementAt(n))&&(a&&r.push(a))}"item"===this.options.pagination&&(this.menu.flatItems[e]&&this.menu.flatItems[e].parent&&(a=this.menu.getElementAt(null===(t=this.menu.flatItems[e].parent)||void 0===t?void 0:t.absoluteIdx))&&r.push(a));this.marker.addOnly(r),this.marker.mark()}}),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"search",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"tryItOperation",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"showRightPanel",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"layout",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"activeSampleLanguage",void 0),(0,tslib_1.__decorate)([mobx_1.observable],e.prototype,"isLoading",void 0),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"onDidMount",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleRightPanel",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"toggleLayout",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"disableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"enableConsole",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"tryItOut",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"setActiveSampleLanguage",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"startLoader",null),(0,tslib_1.__decorate)([mobx_1.action],e.prototype,"stopLoader",null),e}();exports.ProStore=ProStore;var DEFAULT_OPTIONS={ignoreNamedSchemas:["java.io.ObjectStreamField"],allowedMdComponents:(_a={RedocResponse:{component:pluggable_1.RedocResponse,propsSelector:function(e){return{store:e}}},PullRight:{component:pluggable_1.PullRight,propsSelector:function(){return{}}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_COMPONENT_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SECURITY_DEFINITIONS_JSX_NAME]={component:redoc_lib_1.SecurityDefs,propsSelector:function(e){return{securitySchemes:e.definition.securitySchemes}}},_a[redoc_lib_1.SCHEMA_DEFINITION_JSX_NAME]={component:redoc_lib_1.SchemaDefinition,propsSelector:function(e){return{parser:e.definition.parser,options:e.options,layout:e.layout,showRightPanel:e.showRightPanel}}},_a)};function joinURLs(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")&&(t=t.substring(1)),e+"/"+t}function addTrailingSlash(e){return e.endsWith("/")?e:e+"/"}function getSpecVersionObj(e){return e.openapi?{openapi:e.openapi}:e.swagger?{swagger:e.swagger}:void 0}function deepClone(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e){var o=e[i];t[i]=deepClone(o)}return t}
|
|
2
2
|
//# sourceMappingURL=ProStore.js.map
|
|
@@ -16,7 +16,7 @@ export declare function getCodeSample({ lang, operation, exampleName, pathParams
|
|
|
16
16
|
operation: OperationModel;
|
|
17
17
|
exampleName?: string;
|
|
18
18
|
pathParams?: GenericObject;
|
|
19
|
-
properties?:
|
|
19
|
+
properties?: GenericObject;
|
|
20
20
|
options?: GenericObject;
|
|
21
21
|
}): string;
|
|
22
22
|
export declare function isDefined<T>(arg?: T): arg is T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function getPreserveTransformer({ body, authorizationHeader, }: {
|
|
2
2
|
body?: boolean;
|
|
3
3
|
authorizationHeader?: boolean;
|
|
4
|
-
}): (input: any, prop:
|
|
4
|
+
}): (input: any, prop: string, originalResult: string) => string;
|
|
5
5
|
export declare function addIndentation(str: string, { level, indent, firstLine }?: {
|
|
6
6
|
level?: number | undefined;
|
|
7
7
|
indent?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function (obj:
|
|
1
|
+
export default function (obj: GenericObject, pair: GenericObject): GenericObject;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEmptyObject=exports.info=void 0;var tslib_1=require("tslib"),code_builder_1=require("../../helpers/code-builder"),__1=require("../.."),utils_1=require("../../../../utils"),generator_1=require("../../../generator"),constants_1=require("../../helpers/constants"),code_helpers_1=require("../../helpers/code-helpers"),printPathVariablesCodeLines=function(t,e){return Object.keys(t).forEach((function(a){var r=t[a]||"YOUR_"+a+"_PARAMETER";e.push(2,"String "+e.var(a,constants_1.VariableType.PATH)+' = "%s";',r)}))};function getUrl(t,e){var a=t.fullUrl,r=void 0===a?"":a,s=t.pathParameters,i=void 0===s?{}:s;return(0,code_helpers_1.parseUrlIntoOperands)(r,i).map((function(t){return"variable"===t.type?e.var(t.name,constants_1.VariableType.PATH):'"'+t.value+'"'})).join(" + ")}var handler=function(t,e,a){var r,s,i=a.target,n=a.client,p=Object.assign({indent:" ",withWrapper:!0},e),o=new code_builder_1.CodeBuilder({indentation:p.indent,variablesPrefix:p.variablesPrefix,capitalize:!0,lang:constants_1.Lang.JAVA8}),u=formatHttpMethod(t.method);if(p.withComments&&addComments(o),p.withImports&&addImports(o,t),p.withWrapper&&(o.push("public class App {"),o.push(1,"public static void main(String[] args ) throws java.io.IOException {"),o.push(2,"HttpClient httpClient = HttpClientBuilder.create().build();"),o.blank()),null===(r=t.securityOAuth2ExtraCalls)||void 0===r?void 0:r.length){var h=new __1.HTTPSnippet(null===(s=t.securityOAuth2ExtraCalls)||void 0===s?void 0:s[0]).convert(i,n,(0,tslib_1.__assign)((0,tslib_1.__assign)({},p),{withImports:!1,withWrapper:!1,withComments:!1,variablesPrefix:"oauth2"}));o.push(h),o.push(2,"JSONObject %s = new JSONObject(EntityUtils.toString(httpClient.execute(%s).getEntity()));","oauth2Response","oauth2Request"),o.push(2,'String accessToken = %s.getString("access_token");',"oauth2Response"),o.blank()}printPathVariablesCodeLines(t.pathParameters,o),o.push(2,"%s "+o.var("request")+" = new %s(%s);",u,u,getUrl(t,o));var l=Object.keys(t.allHeaders);if(!l.length||t.postData&&"multipart/form-data"==t.postData.mimeType||l.forEach((function(e){var a;o.push(2,'%s.setHeader("%s", %s);',o.var("request"),e,(null===(a=t.securityOAuth2ExtraCalls)||void 0===a?void 0:a.length)?'"Bearer " + accessToken':'"'+t.allHeaders[e]+'"')})),t.basicAuth&&(o.push(2,'String encodedString = Base64.getEncoder().encodeToString("<username>:<password>".getBytes());'),o.push(2,'%s.setHeader("%s", "%s"+encodedString);',o.var("request"),"Authorization","Basic ")),t.postData)switch((0,utils_1.normalizeMimeType)(t.postData.mimeType)){case"application/x-www-form-urlencoded":t.postData.params&&(o.blank(),o.push(2,"List<NameValuePair> params = new ArrayList<NameValuePair>();"),t.postData.params.forEach((function(t){o.push(2,'params.add(new BasicNameValuePair("%s", "%s"));',t.name,t.value)})),o.push(2,"%s.setEntity(new UrlEncodedFormEntity(params));",o.var("request")),o.blank());break;case"multipart/form-data":t.postData.params&&(o.push(2,"MultipartEntity reqEntity = new MultipartEntity();"),t.postData.params.forEach((function(t){o.push(2,'reqEntity.addPart("%s", %s);',t.name,isString(t.value)?'new StringBody("'+t.value+'")':t.value)})),o.push(2,"%s.setEntity(reqEntity);",o.var("request")));break;case"application/json":if(t.postData.jsonObj){o.push(2,"JSONObject payload = new JSONObject();");for(var c=0,d=Object.entries(t.postData.jsonObj);c<d.length;c++){var m=d[c],g=m[0],y=m[1];Array.isArray(y)?(o.push(2,'payload.put("%s", new JSONArray()',g),y.forEach((function(t){isObject(t)?(o.push(3,".put(new JSONObject()"),b(t,4),o.push(3,")")):o.push(3,".put(%s)",formatValue(t))})),o.push(2,");")):isObject(y)?(o.push(2,'payload.put("%s", new JSONObject()%s',g,isEmptyObject(y)?");":""),b(y,3),isEmptyObject(y)||o.push(2,");")):o.push(2,'payload.put("%s", %s);',g,formatValue(y))}o.push(2,"%s.setEntity(new StringEntity(payload.toString()));",o.var("request"))}break;case"application/xml":t.postData.text&&(o.push(2,'String payload = String.join("\\n"'),t.postData.text.trim().split("\n").forEach((function(t){var e=t.replace(/"/g,'\\"');o.push(3,', "'+e+'"')})),o.push(2,");"),o.push(2,"%s.setEntity(new StringEntity(payload));",o.var("request")))}return p.withWrapper&&(o.push(2,"String "+o.var("response")+" = EntityUtils.toString(httpClient.execute(request).getEntity());"),o.blank(),o.push(2,"System.out.println(response);"),o.push(1,"}"),o.push("}")),o.join();function b(t,e){for(var a=0,r=Object.entries(t);a<r.length;a++){var s=r[a],i=s[0],n=s[1];isObject(n)?(o.push(e,'.put("%s", new JSONObject()',i),b(n,e+1),o.push(e,")")):o.push(e,'.put("%s", %s)',i,formatValue(n))}}};function addComments(t){t.push("/**"),t.push(" * Requires JDK >= 8"),t.push(" *"),t.push(" * Requires Apache HttpComponents Client >= 4.3.5"),t.push(" * See here for installation details:"),t.push(" * https://search.maven.org/artifact/org.apache.httpcomponents/httpcomponents-client"),t.push(" *"),t.push(' * Requires package "junit4"'),t.push(" * See here for installation details:"),t.push(" * https://junit.org/junit4"),t.push(" *"),t.push(' * Requires package "org.json" >= 20180130'),t.push(" * See here for installation details:"),t.push(" * https://search.maven.org/artifact/org.json/json"),t.push(" */"),t.blank()}function addImports(t,e){var a;t.push("import org.apache.http.util.EntityUtils;"),t.push("import org.apache.http.NameValuePair;"),t.push("import org.apache.http.client.HttpClient;"),t.push("import org.apache.http.client.entity.UrlEncodedFormEntity;"),e.method&&addHttpMethodImport(t,e.method),(null===(a=e.securityOAuth2ExtraCalls)||void 0===a?void 0:a.length)&&e.securityOAuth2ExtraCalls[0].method.toLowerCase()!==e.method.toLowerCase()&&addHttpMethodImport(t,e.securityOAuth2ExtraCalls[0].method),t.push("import org.apache.http.impl.client.HttpClientBuilder;"),t.push("import org.apache.http.message.BasicNameValuePair;"),t.push("import org.apache.http.entity.StringEntity;"),t.push("import org.json.JSONObject;"),t.push("import org.json.JSONArray;"),t.push("import java.util.ArrayList;"),t.push("import java.util.List;"),t.push("import org.apache.http.entity.mime.MultipartEntity;"),t.push("import org.apache.http.entity.mime.content.StringBody;"),e.basicAuth&&t.push("import java.util.Base64;"),t.blank()}function addHttpMethodImport(t,e){var a=formatHttpMethod(e);t.push("import org.apache.http.client.methods."+a+";")}function formatHttpMethod(t){return"Http"+(0,generator_1.capitalizeFirst)(t.toLowerCase())}function isString(t){return"[object String]"===Object.prototype.toString.call(t)}function isObject(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function isEmptyObject(t){return!!t&&0===Object.keys(t).length}function formatValue(t){return isString(t)?JSON.stringify(t):null==t?"JSONObject.NULL":t}exports.info={key:"apachehttp",title:"Apache http",link:"https://hc.apache.org/httpcomponents-client-4.5.x/",description:"Apache HttpClient"},exports.default=handler,exports.isEmptyObject=isEmptyObject;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEmptyObject=exports.info=void 0;var tslib_1=require("tslib"),code_builder_1=require("../../helpers/code-builder"),__1=require("../.."),utils_1=require("../../../../utils"),generator_1=require("../../../generator"),constants_1=require("../../helpers/constants"),code_helpers_1=require("../../helpers/code-helpers"),printPathVariablesCodeLines=function(t,e){return Object.keys(t).forEach((function(a){var r=t[a]||"YOUR_"+a+"_PARAMETER";e.push(2,"String "+e.var(a,constants_1.VariableType.PATH)+' = "%s";',r)}))};function getUrl(t,e){var a=t.fullUrl,r=void 0===a?"":a,s=t.pathParameters,i=void 0===s?{}:s;return(0,code_helpers_1.parseUrlIntoOperands)(r,i).map((function(t){return"variable"===t.type?e.var(t.name,constants_1.VariableType.PATH):'"'+t.value+'"'})).join(" + ")}var handler=function(t,e,a){var r,s,i=a.target,n=a.client,p=Object.assign({indent:" ",withWrapper:!0},e),o=new code_builder_1.CodeBuilder({indentation:p.indent,variablesPrefix:p.variablesPrefix,capitalize:!0,lang:constants_1.Lang.JAVA8}),u=formatHttpMethod(t.method);if(p.withComments&&addComments(o),p.withImports&&addImports(o,t),p.withWrapper&&(o.push("public class App {"),o.push(1,"public static void main(String[] args ) throws java.io.IOException {"),o.push(2,"HttpClient httpClient = HttpClientBuilder.create().build();"),o.blank()),null===(r=t.securityOAuth2ExtraCalls)||void 0===r?void 0:r.length){var h=new __1.HTTPSnippet(null===(s=t.securityOAuth2ExtraCalls)||void 0===s?void 0:s[0]).convert(i,n,(0,tslib_1.__assign)((0,tslib_1.__assign)({},p),{withImports:!1,withWrapper:!1,withComments:!1,variablesPrefix:"oauth2"}));o.push(h),o.push(2,"JSONObject %s = new JSONObject(EntityUtils.toString(httpClient.execute(%s).getEntity()));","oauth2Response","oauth2Request"),o.push(2,'String accessToken = %s.getString("access_token");',"oauth2Response"),o.blank()}printPathVariablesCodeLines(t.pathParameters,o),o.push(2,"%s "+o.var("request")+" = new %s(%s);",u,u,getUrl(t,o));var l=Object.keys(t.allHeaders);if(!l.length||t.postData&&"multipart/form-data"==t.postData.mimeType||l.forEach((function(e){var a;o.push(2,'%s.setHeader("%s", %s);',o.var("request"),e,(null===(a=t.securityOAuth2ExtraCalls)||void 0===a?void 0:a.length)?'"Bearer " + accessToken':'"'+t.allHeaders[e]+'"')})),t.basicAuth&&(o.push(2,'String encodedString = Base64.getEncoder().encodeToString("<username>:<password>".getBytes());'),o.push(2,'%s.setHeader("%s", "%s"+encodedString);',o.var("request"),"Authorization","Basic ")),t.postData)switch((0,utils_1.normalizeMimeType)(t.postData.mimeType)){case"application/x-www-form-urlencoded":t.postData.params&&(o.blank(),o.push(2,"List<NameValuePair> params = new ArrayList<NameValuePair>();"),t.postData.params.forEach((function(t){o.push(2,'params.add(new BasicNameValuePair("%s", "%s"));',t.name,t.value)})),o.push(2,"%s.setEntity(new UrlEncodedFormEntity(params));",o.var("request")),o.blank());break;case"multipart/form-data":t.postData.params&&(o.push(2,"MultipartEntity reqEntity = new MultipartEntity();"),t.postData.params.forEach((function(t){o.push(2,'reqEntity.addPart("%s", %s);',t.name,isString(t.value)?'new StringBody("'+t.value+'")':t.value)})),o.push(2,"%s.setEntity(reqEntity);",o.var("request")));break;case"application/json":if(t.postData.jsonObj){o.push(2,"JSONObject payload = new JSONObject();");for(var c=0,d=Object.entries(t.postData.jsonObj);c<d.length;c++){var m=d[c],g=m[0],y=m[1];Array.isArray(y)?(o.push(2,'payload.put("%s", new JSONArray()',g),y.forEach((function(t){isObject(t)?(o.push(3,".put(new JSONObject()"),b(t,4),o.push(3,")")):o.push(3,".put(%s)",formatValue(t))})),o.push(2,");")):isObject(y)?(o.push(2,'payload.put("%s", new JSONObject()%s',g,isEmptyObject(y)?");":""),b(y,3),isEmptyObject(y)||o.push(2,");")):o.push(2,'payload.put("%s", %s);',g,formatValue(y))}o.push(2,"%s.setEntity(new StringEntity(payload.toString()));",o.var("request"))}break;case"application/xml":t.postData.text&&(o.push(2,'String payload = String.join("\\n"'),t.postData.text.trim().split("\n").forEach((function(t){var e=t.replace(/"/g,'\\"');o.push(3,', "'+e+'"')})),o.push(2,");"),o.push(2,"%s.setEntity(new StringEntity(payload));",o.var("request")))}return p.withWrapper&&(o.push(2,"String "+o.var("response")+" = EntityUtils.toString(httpClient.execute(request).getEntity());"),o.blank(),o.push(2,"System.out.println(response);"),o.push(1,"}"),o.push("}")),o.join();function b(t,e){for(var a=0,r=Object.entries(t);a<r.length;a++){var s=r[a],i=s[0],n=s[1];isObject(n)?(o.push(e,'.put("%s", new JSONObject()',i),b(n,e+1),o.push(e,")")):o.push(e,'.put("%s", %s)',i,formatValue(n))}}};function addComments(t){t.push("/**"),t.push(" * Requires JDK >= 8"),t.push(" *"),t.push(" * Requires Apache HttpComponents Client >= 4.3.5"),t.push(" * See here for installation details:"),t.push(" * https://search.maven.org/artifact/org.apache.httpcomponents/httpcomponents-client"),t.push(" *"),t.push(' * Requires package "junit4"'),t.push(" * See here for installation details:"),t.push(" * https://junit.org/junit4"),t.push(" *"),t.push(' * Requires package "org.json" >= 20180130'),t.push(" * See here for installation details:"),t.push(" * https://search.maven.org/artifact/org.json/json"),t.push(" */"),t.blank()}function addImports(t,e){var a,r,s;t.push("import org.apache.http.util.EntityUtils;"),t.push("import org.apache.http.NameValuePair;"),t.push("import org.apache.http.client.HttpClient;"),t.push("import org.apache.http.client.entity.UrlEncodedFormEntity;"),e.method&&addHttpMethodImport(t,e.method),(null===(a=e.securityOAuth2ExtraCalls)||void 0===a?void 0:a.length)&&(null===(r=e.securityOAuth2ExtraCalls)||void 0===r?void 0:r[0].method.toLowerCase())!==e.method.toLowerCase()&&addHttpMethodImport(t,null===(s=e.securityOAuth2ExtraCalls)||void 0===s?void 0:s[0].method),t.push("import org.apache.http.impl.client.HttpClientBuilder;"),t.push("import org.apache.http.message.BasicNameValuePair;"),t.push("import org.apache.http.entity.StringEntity;"),t.push("import org.json.JSONObject;"),t.push("import org.json.JSONArray;"),t.push("import java.util.ArrayList;"),t.push("import java.util.List;"),t.push("import org.apache.http.entity.mime.MultipartEntity;"),t.push("import org.apache.http.entity.mime.content.StringBody;"),e.basicAuth&&t.push("import java.util.Base64;"),t.blank()}function addHttpMethodImport(t,e){var a=formatHttpMethod(e);t.push("import org.apache.http.client.methods."+a+";")}function formatHttpMethod(t){return"Http"+(0,generator_1.capitalizeFirst)(t.toLowerCase())}function isString(t){return"[object String]"===Object.prototype.toString.call(t)}function isObject(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function isEmptyObject(t){return!!t&&0===Object.keys(t).length}function formatValue(t){return isString(t)?JSON.stringify(t):null==t?"JSONObject.NULL":t}exports.info={key:"apachehttp",title:"Apache http",link:"https://hc.apache.org/httpcomponents-client-4.5.x/",description:"Apache HttpClient"},exports.default=handler,exports.isEmptyObject=isEmptyObject;
|
|
2
2
|
//# sourceMappingURL=apachehttp.js.map
|
|
@@ -6,7 +6,7 @@ declare type objectToPhpArrayOptions = {
|
|
|
6
6
|
inlineCharacterLimit?: number;
|
|
7
7
|
transform?: (input: any, i: number | string, result: string) => string;
|
|
8
8
|
singleQuotes?: boolean;
|
|
9
|
-
filter?: (obj:
|
|
9
|
+
filter?: (obj: GenericObject, el: string) => boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare function objectToPhpArray(input: any, options: objectToPhpArrayOptions, pad?: string): string;
|
|
12
12
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.objectToPhpArray=void 0;var simpleTypes=["number","boolean","function","symbol"];function isRegexp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function isObject(e){var n=typeof e;return null!==e&&("object"===n||"function"===n)}function objectToPhpArray(e,n,r){void 0===r&&(r="");var t=[];return function e(n,r,i){void 0===r&&(r={}),void 0===i&&(i=""),r.indent=r.indent||"\t";var a={newLine:"\n",newLineOrSpace:"\n",pad:i,indent:i+r.indent},o=function(e){if(void 0===r.inlineCharacterLimit)return e;var n=e.replace(new RegExp(a.newLine,"g"),"").replace(new RegExp(a.newLineOrSpace,"g")," ").replace(new RegExp(a.pad+"|"+a.indent,"g"),"");return n.length<=r.inlineCharacterLimit?n:e.replace(new RegExp(a.newLine+"|"+a.newLineOrSpace,"g"),"\n").replace(new RegExp(a.pad,"g"),i).replace(new RegExp(a.indent,"g"),i+r.indent)};if(-1!==t.indexOf(n))return'"Circular"';if(null===n)return"NULL";if(void 0===n||simpleTypes.includes(typeof n)||isRegexp(n))return String(n);if(n instanceof Date)return"date('"+n.toISOString()+"')";if(Array.isArray(n)){if(0===n.length)return"array()";t.push(n);var p="array("+a.newLine+n.map((function(t,o){var p=n.length-1===o?a.newLine:","+a.newLineOrSpace,c=e(t,r,i+r.indent);return r.transform&&(c=r.transform(n,o,c)),a.indent+c+p})).join("")+a.pad+")";return t.pop(),o(p)}if(isObject(n)){var c=Object.keys(n);if(r.filter&&(c=c.filter((function(e){return r.filter(n,e)}))),0===c.length)return Array.isArray(n)?"array()":"(object)[]";t.push(n);p="array("+a.newLine+c.map((function(t,o){var p=c.length-1===o?a.newLine:","+a.newLineOrSpace,u="symbol"==typeof t,l=!u&&/^[a-z$_][a-z$_0-9]*$/i.test(t),f=u||l?t:e(t,r),s=e(n[t],r,i+r.indent);return r.transform&&(s=r.transform(n,t,s)),a.indent+'"'+String(f)+'" => '+s+p})).join("")+a.pad+")";return t.pop(),o(p)}return n=String(n).replace(/[\r\n]/g,(function(e){return"\n"===e?"\\n":"\\r"})),!1===r.singleQuotes?'"'+(n=n.replace(/"/g,'\\"'))+'"':'"'+(n=n.replace(/\\?'/g,"\\'"))+'"'}(e,n,r)}exports.objectToPhpArray=objectToPhpArray;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.objectToPhpArray=void 0;var simpleTypes=["number","boolean","function","symbol"];function isRegexp(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function isObject(e){var n=typeof e;return null!==e&&("object"===n||"function"===n)}function objectToPhpArray(e,n,r){void 0===r&&(r="");var t=[];return function e(n,r,i){void 0===r&&(r={}),void 0===i&&(i=""),r.indent=r.indent||"\t";var a={newLine:"\n",newLineOrSpace:"\n",pad:i,indent:i+r.indent},o=function(e){if(void 0===r.inlineCharacterLimit)return e;var n=e.replace(new RegExp(a.newLine,"g"),"").replace(new RegExp(a.newLineOrSpace,"g")," ").replace(new RegExp(a.pad+"|"+a.indent,"g"),"");return n.length<=r.inlineCharacterLimit?n:e.replace(new RegExp(a.newLine+"|"+a.newLineOrSpace,"g"),"\n").replace(new RegExp(a.pad,"g"),i).replace(new RegExp(a.indent,"g"),i+r.indent)};if(-1!==t.indexOf(n))return'"Circular"';if(null===n)return"NULL";if(void 0===n||simpleTypes.includes(typeof n)||isRegexp(n))return String(n);if(n instanceof Date)return"date('"+n.toISOString()+"')";if(Array.isArray(n)){if(0===n.length)return"array()";t.push(n);var p="array("+a.newLine+n.map((function(t,o){var p=n.length-1===o?a.newLine:","+a.newLineOrSpace,c=e(t,r,i+r.indent);return r.transform&&(c=r.transform(n,o,c)),a.indent+c+p})).join("")+a.pad+")";return t.pop(),o(p)}if(isObject(n)){var c=Object.keys(n);if(r.filter&&(c=c.filter((function(e){var t;return null===(t=r.filter)||void 0===t?void 0:t.call(r,n,e)}))),0===c.length)return Array.isArray(n)?"array()":"(object)[]";t.push(n);p="array("+a.newLine+c.map((function(t,o){var p=c.length-1===o?a.newLine:","+a.newLineOrSpace,u="symbol"==typeof t,l=!u&&/^[a-z$_][a-z$_0-9]*$/i.test(t),f=u||l?t:e(t,r),s=e(n[t],r,i+r.indent);return r.transform&&(s=r.transform(n,t,s)),a.indent+'"'+String(f)+'" => '+s+p})).join("")+a.pad+")";return t.pop(),o(p)}return n=String(n).replace(/[\r\n]/g,(function(e){return"\n"===e?"\\n":"\\r"})),!1===r.singleQuotes?'"'+(n=n.replace(/"/g,'\\"'))+'"':'"'+(n=n.replace(/\\?'/g,"\\'"))+'"'}(e,n,r)}exports.objectToPhpArray=objectToPhpArray;
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -4,7 +4,7 @@ export declare function extendTheme(options: RedocProRawOptions): RedocProRawOpt
|
|
|
4
4
|
interface Typography {
|
|
5
5
|
fontSize?: MediaValue;
|
|
6
6
|
fontWeight?: string | number;
|
|
7
|
-
fontFamily?: MediaValue | ((theme:
|
|
7
|
+
fontFamily?: MediaValue | ((theme: ProTheme) => string);
|
|
8
8
|
lineHeight?: MediaValue;
|
|
9
9
|
color?: string;
|
|
10
10
|
transform?: string;
|
|
@@ -56,9 +56,9 @@ export interface ThemeExtension {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
tryItOutButton?: {
|
|
59
|
-
backgroundColor?: string | ((theme:
|
|
60
|
-
textColor?: string | ((theme:
|
|
61
|
-
borderRadius?: string | ((theme:
|
|
59
|
+
backgroundColor?: string | ((theme: ProTheme) => string);
|
|
60
|
+
textColor?: string | ((theme: ProTheme) => string);
|
|
61
|
+
borderRadius?: string | ((theme: ProTheme) => string);
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
export declare type ProTheme = ResolvedThemeInterface & ThemeExtension;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendTheme=void 0;var tslib_1=require("tslib"),redoc_lib_1=require("../redoc-lib"),deepmerge_1=(0,tslib_1.__importDefault)(require("deepmerge"));function extendTheme(e){var t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.extendTheme=void 0;var tslib_1=require("tslib"),redoc_lib_1=require("../redoc-lib"),deepmerge_1=(0,tslib_1.__importDefault)(require("deepmerge"));function extendTheme(e){var o,t,n,r,a,l,i,d,c,p,m,h;return e.theme?(e.theme=(0,deepmerge_1.default)(defaultProTheme,e.theme),e.theme.extensionsHook=extensionsHook,(null===(o=e.theme)||void 0===o?void 0:o.menu)&&!(null===(t=e.theme)||void 0===t?void 0:t.sidebar)&&(console.warn('Theme setting "menu" is deprecated. Rename to "sidebar"'),e.theme.sidebar=e.theme.menu),(null===(n=e.theme)||void 0===n?void 0:n.codeSample)&&(console.warn('Theme setting "codeSample" is deprecated. Rename to "codeBlock"'),Object.assign(null===(r=e.theme)||void 0===r?void 0:r.codeBlock,e.theme.codeSample)),(null===(i=null===(l=null===(a=e.theme)||void 0===a?void 0:a.typography)||void 0===l?void 0:l.code)||void 0===i?void 0:i.tokens)&&(console.warn('Theme setting "typography.code.tokens" is deprecated. Move to "codeBlock.tokens"'),e.theme.codeBlock=(null===(d=e.theme)||void 0===d?void 0:d.codeBlock)||{},Object.assign(null===(p=null===(c=e.theme)||void 0===c?void 0:c.codeBlock)||void 0===p?void 0:p.tokens,(null===(h=null===(m=e.theme)||void 0===m?void 0:m.typography)||void 0===h?void 0:h.code).tokens)),e):(e.theme=defaultProTheme,e)}exports.extendTheme=extendTheme;var defaultProTheme={overrides:{DownloadButton:{custom:""},NextSectionButton:{custom:""}},codeBlock:{borderRadius:function(e){return e.components.panels.borderRadius},tokens:{}},schema:{constraints:{},examples:{}},rightPanel:{textColor:"#eeeeee"},typography:{heading1:{},heading2:{},heading3:{},rightPanelHeading:{}}};function optional(e,o){return o?e+": "+o+";":""}function typography(e){return e?(0,redoc_lib_1.css)(templateObject_1||(templateObject_1=(0,tslib_1.__makeTemplateObject)(["\n ","\n "],["\n ","\n "])),(0,redoc_lib_1.mediaCSS)({fontSize:e.fontSize||"",fontWeight:e.fontWeight||"",fontFamily:e.fontFamily||"",lineHeight:e.lineHeight||"",color:e.color||"",textTransform:e.transform||""})):""}function genTokens(e){if(!e)return"";for(var o="",t=0,n=Object.keys(e);t<n.length;t++){var r=n[t];"default"!==r&&(o+=".token."+r+" { color: "+e[r].color+"; }\n")}return e.default?(0,redoc_lib_1.css)(templateObject_2||(templateObject_2=(0,tslib_1.__makeTemplateObject)(["\n pre& {\n ","\n }\n ","\n "],["\n pre& {\n ","\n }\n ","\n "])),typography(e.default),o):o}var templateObject_1,templateObject_2,templateObject_3,templateObject_4,templateObject_5,templateObject_6,EXTENSIONS={DownloadButton:function(e){var o=e.theme;return void 0!==o.overrides&&o.overrides.DownloadButton&&o.overrides.DownloadButton.custom||""},H1:function(e){return typography(e.theme.typography.heading1)},H2:function(e){return typography(e.theme.typography.heading2)},H3:function(e){return typography(e.theme.typography.heading3)},RightPanelHeader:function(e){return typography(e.theme.typography.rightPanelHeading)},PropertyNameCell:function(e){var o=e.theme;return o.schema.breakFieldNames?(0,redoc_lib_1.css)(templateObject_3||(templateObject_3=(0,tslib_1.__makeTemplateObject)(["\n ","\n ","\n "],["\n ","\n ","\n "])),typography(o.typography.fieldName),"\n && span:last-child {\n white-space: normal;\n word-break: break-word;\n vertical-align: top;\n max-width: calc(100% - 21px);\n display: inline-block;\n }\n "):typography(o.typography.fieldName)},Markdown:function(e){var o,t,n,r,a=e.theme;return(0,redoc_lib_1.css)(templateObject_4||(templateObject_4=(0,tslib_1.__makeTemplateObject)(["\n h1 {\n ","\n clear: both;\n }\n h2 {\n ","\n clear: both;\n }\n h3 {\n ","\n clear: both;\n }\n\n pre {\n border-radius: ",";\n }\n\n code {\n ","\n }\n "],["\n h1 {\n ","\n clear: both;\n }\n h2 {\n ","\n clear: both;\n }\n h3 {\n ","\n clear: both;\n }\n\n pre {\n border-radius: ",";\n }\n\n code {\n ","\n }\n "])),typography(a.typography.heading1),typography(a.typography.heading2),typography(a.typography.heading3),null!==(t=null===(o=a.codeBlock)||void 0===o?void 0:o.borderRadius)&&void 0!==t?t:0,optional("word-break",null===(r=null===(n=a.typography)||void 0===n?void 0:n.code)||void 0===r?void 0:r.wordBreak))},ConstraintItem:function(e){var o,t,n,r,a=e.theme;return(0,redoc_lib_1.css)(templateObject_5||(templateObject_5=(0,tslib_1.__makeTemplateObject)(["\n ",";\n ",";\n ","\n ","\n "],["\n ",";\n ",";\n ","\n ","\n "])),typography(a.schema.constraints),optional("background-color",null===(o=a.schema.constraints)||void 0===o?void 0:o.backgroundColor),optional("border",null===(t=a.schema.constraints)||void 0===t?void 0:t.border),optional("word-break",null===(r=null===(n=a.typography)||void 0===n?void 0:n.code)||void 0===r?void 0:r.wordBreak))},ExampleValue:function(e){var o,t,n,r,a=e.theme;return(0,redoc_lib_1.css)(templateObject_6||(templateObject_6=(0,tslib_1.__makeTemplateObject)(["\n ",";\n ",";\n ","\n ","\n "],["\n ",";\n ",";\n ","\n ","\n "])),typography(a.schema.examples),optional("background-color",null===(o=a.schema.examples)||void 0===o?void 0:o.backgroundColor),optional("border",null===(t=a.schema.examples)||void 0===t?void 0:t.border),optional("word-break",null===(r=null===(n=a.typography)||void 0===n?void 0:n.code)||void 0===r?void 0:r.wordBreak))},Prism:function(e){var o,t,n,r=e.theme;return genTokens(null===(o=null==r?void 0:r.codeBlock)||void 0===o?void 0:o.tokens)+optional("word-break",null===(n=null===(t=r.typography)||void 0===t?void 0:t.code)||void 0===n?void 0:n.wordBreak)}};function extensionsHook(e,o){return EXTENSIONS[e]&&EXTENSIONS[e](o)}
|
|
2
2
|
//# sourceMappingURL=extendTheme.js.map
|
|
@@ -14,7 +14,7 @@ export declare class ProHashHistoryService implements Interface<HistoryService>
|
|
|
14
14
|
makeUrl(path: string, hash: string): string;
|
|
15
15
|
linkForId(id: string): string;
|
|
16
16
|
generateDeepLink(fieldFragment: string, operationLink?: string): string | undefined;
|
|
17
|
-
subscribe(cb:
|
|
17
|
+
subscribe(cb: (id: string) => void): () => void;
|
|
18
18
|
emit: () => void;
|
|
19
19
|
bind(): void;
|
|
20
20
|
dispose(): void;
|
|
@@ -12,7 +12,7 @@ export declare class PushStateHistoryService implements Interface<HistoryService
|
|
|
12
12
|
makeUrl(path: string, hash: string): string;
|
|
13
13
|
generateDeepLink(fieldFragment: string, operationLink?: string): string | null;
|
|
14
14
|
linkForId(id?: string): string;
|
|
15
|
-
subscribe(cb:
|
|
15
|
+
subscribe(cb: (id: string) => void): () => void;
|
|
16
16
|
emit: () => void;
|
|
17
17
|
bind(): void;
|
|
18
18
|
dispose(): void;
|
package/lib/services/utils.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export declare function isSameMime(a?: string, b?: string): boolean;
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function normalizeMimeType(mimeType?: string): string | undefined;
|
|
13
13
|
export declare function unescapeServerVariables(str: string): string;
|
|
14
|
-
export declare function arrayMerge(target:
|
|
14
|
+
export declare function arrayMerge<T>(target: T[], source: T[]): T[];
|
package/lib/standalone.d.ts
CHANGED
|
@@ -13,12 +13,13 @@ import 'core-js/es/string/starts-with';
|
|
|
13
13
|
import 'core-js/es/symbol';
|
|
14
14
|
import 'unfetch/polyfill/index';
|
|
15
15
|
import 'url-polyfill';
|
|
16
|
+
import { ProStoreState, RedocProRawOptions } from './services/ProStore';
|
|
16
17
|
import { LayoutVariant } from './services/store-types';
|
|
17
18
|
export { setSecurityDetails, setParameterValue, setSecurityDetailsVariants } from './utils';
|
|
18
19
|
export declare function toggleLayout(layout?: LayoutVariant): void;
|
|
19
20
|
export declare function toggleRightPanel(value?: boolean): void;
|
|
20
|
-
export declare function hydrate(state:
|
|
21
|
-
export declare function init(definitionOrDefinitionUrl: string | any, options?:
|
|
22
|
-
export declare function setPublicPath(path:
|
|
21
|
+
export declare function hydrate(state: ProStoreState, element?: Element | null): void;
|
|
22
|
+
export declare function init(definitionOrDefinitionUrl: string | any, options?: RedocProRawOptions, element?: Element | null, callback?: () => void): void;
|
|
23
|
+
export declare function setPublicPath(path: string): void;
|
|
23
24
|
export declare const version: string;
|
|
24
25
|
export declare const revision: string;
|
package/lib/standalone.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.revision=exports.version=exports.setPublicPath=exports.init=exports.hydrate=exports.toggleRightPanel=exports.toggleLayout=exports.setSecurityDetailsVariants=exports.setParameterValue=exports.setSecurityDetails=void 0;var tslib_1=require("tslib");require("core-js/es/array/find-index"),require("core-js/es/array/find"),require("core-js/es/array/includes"),require("core-js/es/map"),require("core-js/es/number/is-integer"),require("core-js/es/object/assign"),require("core-js/es/object/entries"),require("core-js/es/object/is"),require("core-js/es/object/values"),require("core-js/es/promise"),require("core-js/es/string/ends-with"),require("core-js/es/string/starts-with"),require("core-js/es/symbol"),require("unfetch/polyfill/index"),require("url-polyfill");var path_1=require("path"),React=(0,tslib_1.__importStar)(require("react")),react_dom_1=require("react-dom"),redoc_lib_1=require("./redoc-lib"),ProStore_1=require("./services/ProStore"),store_types_1=require("./services/store-types"),RedoclyReferenceDocs_1=require("./components/RedoclyReferenceDocs"),utils_1=require("./utils"),utils_2=require("./utils");function toggleLayout(e){var r=(0,utils_1.getGlobalStore)();r&&r.toggleLayout((null!=e?e:r.layout===store_types_1.LayoutVariant.STACKED)?store_types_1.LayoutVariant.THREE_PANEL:store_types_1.LayoutVariant.STACKED)}function toggleRightPanel(e){var r=(0,utils_1.getGlobalStore)();r&&r.toggleRightPanel(e)}Object.defineProperty(exports,"setSecurityDetails",{enumerable:!0,get:function(){return utils_2.setSecurityDetails}}),Object.defineProperty(exports,"setParameterValue",{enumerable:!0,get:function(){return utils_2.setParameterValue}}),Object.defineProperty(exports,"setSecurityDetailsVariants",{enumerable:!0,get:function(){return utils_2.setSecurityDetailsVariants}}),exports.toggleLayout=toggleLayout,exports.toggleRightPanel=toggleRightPanel;var url=getJsUrl(),__dirname=url?(0,path_1.dirname)(url)+"/":"";function attributesMap(e){for(var r={},t=e.attributes,i=0;i<t.length;i++){var o=t[i];r[o.name]=o.value}return r}function parseOptionsFromElement(e){var r=attributesMap(e),t={};for(var i in r){t[i.replace(/-(.)/g,(function(e,r){return r.toUpperCase()}))]=r[i]}return t}function hydrate(e,r){void 0===r&&(r=document.querySelector("redoc"));var t=ProStore_1.ProStore.fromJS(e);(0,react_dom_1.hydrate)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocs,{store:t}),r)}function init(e,r,t,i){if(void 0===r&&(r={}),void 0===t&&(t=(0,redoc_lib_1.querySelector)("redoc")),null===t)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');var o,s;Array.isArray(e)||e&&e.versions?(0,react_dom_1.render)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocsMultiStandalone,{definitions:e,options:(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),parseOptionsFromElement(t))},["Loading..."]),t,i):("string"==typeof e?o=e:"object"==typeof e&&(s=e),(0,react_dom_1.render)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocsStandalone,{definition:s,definitionUrl:o,options:(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),parseOptionsFromElement(t))},["Loading..."]),t,i))}function setPublicPath(e){__webpack_public_path__=e}function autoInit(){var e=(0,redoc_lib_1.querySelector)("redoc");if(e){var r=e.getAttribute("spec-url");r&&init(r,{},e)}}function getJsUrl(){if(!redoc_lib_1.IS_BROWSER)return"";var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.revision=exports.version=exports.setPublicPath=exports.init=exports.hydrate=exports.toggleRightPanel=exports.toggleLayout=exports.setSecurityDetailsVariants=exports.setParameterValue=exports.setSecurityDetails=void 0;var tslib_1=require("tslib");require("core-js/es/array/find-index"),require("core-js/es/array/find"),require("core-js/es/array/includes"),require("core-js/es/map"),require("core-js/es/number/is-integer"),require("core-js/es/object/assign"),require("core-js/es/object/entries"),require("core-js/es/object/is"),require("core-js/es/object/values"),require("core-js/es/promise"),require("core-js/es/string/ends-with"),require("core-js/es/string/starts-with"),require("core-js/es/symbol"),require("unfetch/polyfill/index"),require("url-polyfill");var path_1=require("path"),React=(0,tslib_1.__importStar)(require("react")),react_dom_1=require("react-dom"),redoc_lib_1=require("./redoc-lib"),ProStore_1=require("./services/ProStore"),store_types_1=require("./services/store-types"),RedoclyReferenceDocs_1=require("./components/RedoclyReferenceDocs"),utils_1=require("./utils"),utils_2=require("./utils");function toggleLayout(e){var r=(0,utils_1.getGlobalStore)();r&&r.toggleLayout((null!=e?e:r.layout===store_types_1.LayoutVariant.STACKED)?store_types_1.LayoutVariant.THREE_PANEL:store_types_1.LayoutVariant.STACKED)}function toggleRightPanel(e){var r=(0,utils_1.getGlobalStore)();r&&r.toggleRightPanel(e)}Object.defineProperty(exports,"setSecurityDetails",{enumerable:!0,get:function(){return utils_2.setSecurityDetails}}),Object.defineProperty(exports,"setParameterValue",{enumerable:!0,get:function(){return utils_2.setParameterValue}}),Object.defineProperty(exports,"setSecurityDetailsVariants",{enumerable:!0,get:function(){return utils_2.setSecurityDetailsVariants}}),exports.toggleLayout=toggleLayout,exports.toggleRightPanel=toggleRightPanel;var url=getJsUrl(),__dirname=url?(0,path_1.dirname)(url)+"/":"";function attributesMap(e){for(var r={},t=e.attributes,i=0;i<t.length;i++){var o=t[i];r[o.name]=o.value}return r}function parseOptionsFromElement(e){var r=attributesMap(e),t={};for(var i in r){t[i.replace(/-(.)/g,(function(e,r){return r.toUpperCase()}))]=r[i]}return t}function hydrate(e,r){void 0===r&&(r=document.querySelector("redoc"));var t=ProStore_1.ProStore.fromJS(e);(0,react_dom_1.hydrate)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocs,{store:t}),r)}function init(e,r,t,i){if(void 0===r&&(r={}),void 0===t&&(t=(0,redoc_lib_1.querySelector)("redoc")),null===t)throw new Error('"element" argument is not provided and <redoc> tag is not found on the page');var o,s;Array.isArray(e)||e&&e.versions?(0,react_dom_1.render)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocsMultiStandalone,{definitions:e,options:(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),parseOptionsFromElement(t))},["Loading..."]),t,i):("string"==typeof e?o=e:"object"==typeof e&&(s=e),(0,react_dom_1.render)(React.createElement(RedoclyReferenceDocs_1.RedoclyReferenceDocsStandalone,{definition:s,definitionUrl:o,options:(0,tslib_1.__assign)((0,tslib_1.__assign)({},r),parseOptionsFromElement(t))},["Loading..."]),t,i))}function setPublicPath(e){__webpack_public_path__=e}function autoInit(){var e=(0,redoc_lib_1.querySelector)("redoc");if(e){var r=e.getAttribute("spec-url");r&&init(r,{},e)}}function getJsUrl(){var e;if(!redoc_lib_1.IS_BROWSER)return"";var r=+new Date+Math.random();try{return document.currentScript&&(document.currentScript.async||document.currentScript.defer)||document.write('<script id="dummy'+r+'"><\/script>'),(null===(e=document.getElementById("dummy"+r))||void 0===e?void 0:e.previousSibling).src}catch(e){return""}}exports.hydrate=hydrate,exports.init=init,exports.setPublicPath=setPublicPath,exports.version=__REDOCLY_API_REFERENCE_VERSION__,exports.revision=__REDOCLY_API_REFERENCE_REVISION__,redoc_lib_1.IS_BROWSER&&setPublicPath(__dirname),autoInit();
|
|
2
2
|
//# sourceMappingURL=standalone.js.map
|
package/lib/utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const setGlobalStore: (store: ProStore) => ProStore;
|
|
|
4
4
|
export declare function debounce<T extends unknown>(fn: (...args: T[]) => void, threshold: number, leading?: boolean): (...args: T[]) => void;
|
|
5
5
|
export declare function toStorage(key: string, value: string): void;
|
|
6
6
|
export declare function fromStorage(key: string): string;
|
|
7
|
-
export declare function setParameterValue(_in: string, name: string, value:
|
|
7
|
+
export declare function setParameterValue(_in: string, name: string, value: GenericObject): void;
|
|
8
8
|
export declare function getParameterValue(_in: string, name: string): string | null;
|
|
9
9
|
export declare function toLocalStorage(key: string, value: string): void;
|
|
10
10
|
export declare function fromLocalStorage(key: string): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { OperationModel } from '../../redoc-lib/src/services';
|
|
3
3
|
export interface EndpointProps {
|
|
4
4
|
operation: OperationModel;
|
|
5
5
|
hideHostname?: boolean;
|
|
6
6
|
compact?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const Endpoint: ({ operation, hideHostname }: EndpointProps) =>
|
|
8
|
+
export declare const Endpoint: ({ operation, hideHostname }: EndpointProps) => ReactElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React,{useState}from"react";import{OptionsConsumer}from"../../redoc-lib/src/components/OptionsProvider";import{StoreConsumer,StoreContext}from"../../redoc-lib/src/components/StoreBuilder";import{Console}from"../console/ConsoleLazy";import{CodePanel}from"../Panel";import{ServerList}from"./ServerList";import{Summary}from"./Summary";import{useContext}from"react";import{AnalyticsEventType}from"../../services/store-types";export var Endpoint=function(e){var t=e.operation,o=e.hideHostname,r=useState(!1),n=r[0],a=r[1],i=useContext(StoreContext),l=function(){var e,o;a(!n),null===(o=null===(e=null==i?void 0:i.options.events)||void 0===e?void 0:e.tryItOpen)||void 0===o||o.call(e,{eventType:AnalyticsEventType.TryItOpen,resource:"Redocly_OperationTryIt",action:(null==i?void 0:i.options.unstable_tryItButtonOverride)?"NavigatedOverrideLink":"Opened",operationId:t.operationId,operationPath:t.path,operationHttpVerb:t.httpVerb,operationSummary:t.description})};return React.createElement(React.Fragment,null,n?React.createElement(StoreConsumer,null,(function(e){return React.createElement(Console,{store:e,operation:t,onClose:l})})):React.createElement(CodePanel,{header:function(e){var o=e.toggle,r=e.expanded;return React.createElement(Summary,{operation:t,expanded:r,toggle:o,showConsole:!!(null==i?void 0:i.options.showConsole),onToggleConsole:l,tryItOverride:null==i?void 0:i.options.unstable_tryItButtonOverride})},collapsed:!0},React.createElement(OptionsConsumer,null,(function(e){return React.createElement(ServerList,{operation:t,expandVariables:e.expandDefaultServerVariables,hideHostname:o||e.hideHostname})}))))};
|
|
2
2
|
//# sourceMappingURL=Endpoint.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { OperationModel } from '../../redoc-lib/src/services';
|
|
3
3
|
export interface ServerListProps {
|
|
4
4
|
operation: OperationModel;
|
|
5
5
|
expandVariables: boolean;
|
|
6
6
|
hideHostname: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const ServerList: ({ operation, expandVariables, hideHostname }: ServerListProps) =>
|
|
8
|
+
export declare const ServerList: ({ operation, expandVariables, hideHostname, }: ServerListProps) => ReactElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from"react";import{expandDefaultServerVariables,getBasePath}from"../../redoc-lib/src/utils";import{Markdown}from"../../redoc-lib/src/components/Markdown/Markdown";import{CopyButton,SelectOnClick}from"../shared";import{ServerItem}from"./ServerItem";import{ServerUrl}from"./ServerUrl";import{CopyLink}from"./CopyLink";export var ServerList=function(e){var r=e.operation,t=e.expandVariables,a=e.hideHostname;return React.createElement(React.Fragment,null,r.servers.map((function(e){var o=t?expandDefaultServerVariables(e.url,e.variables):e.url,n=getBasePath(o),l=(a?"/"===n?"":n:o)+r.path;return React.createElement(ServerItem,{key:o},React.createElement(Markdown,{source:e.description||"",compact:!0}),React.createElement(CopyLink,null,React.createElement(SelectOnClick,null,React.createElement(ServerUrl,null,l)),React.createElement(CopyButton,{text:l})))})))};
|
|
2
2
|
//# sourceMappingURL=ServerList.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
2
|
import { OperationModel } from '../../redoc-lib';
|
|
3
3
|
import { PanelHeaderProps } from '../Panel';
|
|
4
4
|
export declare type EndpointSummaryProps = PanelHeaderProps & {
|
|
@@ -11,4 +11,4 @@ export declare type EndpointSummaryProps = PanelHeaderProps & {
|
|
|
11
11
|
onClick?: () => void;
|
|
12
12
|
} | null;
|
|
13
13
|
};
|
|
14
|
-
export declare const Summary: ({ operation, expanded, toggle, onToggleConsole, tryItOverride, showConsole, }: EndpointSummaryProps) =>
|
|
14
|
+
export declare const Summary: ({ operation, expanded, toggle, onToggleConsole, tryItOverride, showConsole, }: EndpointSummaryProps) => ReactElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import React from"react";import{ShelfIcon}from"../../redoc-lib/src/common-elements/icons";import styled from"../../redoc-lib/src/styled-components";import{Header}from"../Panel";import{HttpVerb,Button}from"../shared";import{Path,PathWrapper}from"./Path";var templateObject_1,templateObject_2,TryItButton=styled(Button)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n width: ",";\n"],["\n width: ",";\n"])),(function(t){return t.theme.components.tryItButton.fullWidth?"100%":"auto"})),TryItHeader=styled(Header)(templateObject_2||(templateObject_2=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),(function(t){return t.theme.components.tryItButton.fullWidth?"\n flex-direction: column;\n align-items: flex-start;":""}));export var Summary=function(t){var e=t.operation,n=t.expanded,o=t.toggle,r=t.onToggleConsole,l=t.tryItOverride,a=t.showConsole,c=(null==l?void 0:l.label)||"Try it",i=(null==l?void 0:l.link)?TryItButton.withComponent("a"):TryItButton;return React.createElement(TryItHeader,{onClick:o,isExpanded:n},React.createElement(PathWrapper,null,React.createElement(HttpVerb,{type:e.httpVerb},e.httpVerb),React.createElement(Path,null,e.path),React.createElement(ShelfIcon,{color:"#9AA5B1",direction:n?"down":"right"})),!e.isWebhook&&!e.isCallback&&a&&React.createElement(i,{color:"primary",onClick:l?function(t){var e;null===(e=null==l?void 0:l.onClick)||void 0===e||e.call(l),t.stopPropagation()}:r,"data-cy":"try-it",href:null==l?void 0:l.link},c)||null)};
|
|
2
2
|
//# sourceMappingURL=Summary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import*as React from"react";import{styled,IS_BROWSER}from"../redoc-lib";import{Button}from"./shared/Button";import{NextSectionButtonWrap}from"./styled.elements";export var NextSectionButton=styled(Button)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n font-size: 14px;\n margin-left: auto;\n\n ",";\n"],["\n font-size: 14px;\n margin-left: auto;\n\n ",";\n"])),(function(t){var e,n,o,r=t.theme;return r.overrides&&(null===(e=r.overrides)||void 0===e?void 0:e.NextSectionButton)&&(null===(o=null===(n=r.overrides)||void 0===n?void 0:n.NextSectionButton)||void 0===o?void 0:o.custom)||""}));export var ContinueButton=function(t){var e=t.pagination,n=t.menu;if(!e||"none"===e)return null;var o=getNext(e,n.renderItems,n.flatItems),r=o.nextItem,
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import*as React from"react";import{styled,IS_BROWSER}from"../redoc-lib";import{Button}from"./shared/Button";import{NextSectionButtonWrap}from"./styled.elements";export var NextSectionButton=styled(Button)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n font-size: 14px;\n margin-left: auto;\n\n ",";\n"],["\n font-size: 14px;\n margin-left: auto;\n\n ",";\n"])),(function(t){var e,n,o,r=t.theme;return r.overrides&&(null===(e=r.overrides)||void 0===e?void 0:e.NextSectionButton)&&(null===(o=null===(n=r.overrides)||void 0===n?void 0:n.NextSectionButton)||void 0===o?void 0:o.custom)||""}));export var ContinueButton=function(t){var e=t.pagination,n=t.menu;if(!e||"none"===e)return null;var o=getNext(e,n.renderItems,n.flatItems),r=o.nextItem,i=o.nextLabel;return r?React.createElement(NextSectionButtonWrap,null,React.createElement(NextSectionButton,{color:"secondary",onClick:function(){return t=r,IS_BROWSER&&window.scrollTo(0,0),n.activateAndScroll(t),void setTimeout((function(){return n.activateAndScroll(t)}));var t}},"➔ Next to ",React.createElement("strong",null,i))):null};function getNext(t,e,n){var o,r,i,l=void 0;if(!e.length)return"group"===(l=n[0]).type&&(l=l.items[0]),{nextItem:l,nextLabel:i=l.name};if("section"===t)return(l=nextItemOfDepth(e[e.length-1],n))?{nextItem:l,nextLabel:i=null==l?void 0:l.name}:{};if("item"===t){switch(e[0].type){case"tag":i=null==(l=nextOperationOrTagItem(e[0],n))?void 0:l.name;break;case"section":i=null==(l=nextItemOfDepth(e[e.length-1],n))?void 0:l.name;break;case"operation":i=null==(l=getNextForOperation(e[0],n))?void 0:l.name;break;default:return{}}return"tag"===(null==l?void 0:l.type)&&!(null==l?void 0:l.description)&&(null==l?void 0:l.items.length)&&(i=(null===(o=null==(l=null==l?void 0:l.items[0])?void 0:l.parent)||void 0===o?void 0:o.name)+" / "+(null==l?void 0:l.name)),l&&l.parent&&0===l.parent.items.indexOf(l)&&(i=(null===(r=l.parent)||void 0===r?void 0:r.name)+" / "+l.name),{nextItem:l,nextLabel:i}}return{}}function nextItemOfDepth(t,e){for(var n,o=(null!==(n=null==t?void 0:t.absoluteIdx)&&void 0!==n?n:0)+1;o<e.length;o++)if(e[o].depth===t.depth)return e[o]}function nextOperationOrTagItem(t,e){for(var n,o=(null!==(n=null==t?void 0:t.absoluteIdx)&&void 0!==n?n:0)+1;o<e.length;o++)if("operation"===e[o].type||"tag"===e[o].type)return e[o]}function getNextForOperation(t,e){for(var n,o,r=(null!==(n=null==t?void 0:t.absoluteIdx)&&void 0!==n?n:0)+1;r<e.length;r++)if("tag"===(o=e[r]).type||"operation"===o.type||"section"===o.type)return o}var templateObject_1;
|
|
2
2
|
//# sourceMappingURL=NextSectionButton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator,__makeTemplateObject}from"tslib";import*as React from"react";import{styled}from"../redoc-lib";var INVALID_KEY="Invalid license key",INVALID_KEY_MISSING=INVALID_KEY+": missing key",EXPIRED="Invalid license key: expired",TRIAL_EXPIRED=EXPIRED,INVALID_HOST="Invalid license key: host not allowed";export var Overlay=function(e){var n=e.l,t=React.useState(null),a=t[0],i=t[1],l=React.useState(-1),r=l[0],o=l[1],c=React.useState(!1),d=c[0],s=c[1];return React.useEffect((function(){__awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(
|
|
1
|
+
import{__awaiter,__generator,__makeTemplateObject}from"tslib";import*as React from"react";import{styled}from"../redoc-lib";var INVALID_KEY="Invalid license key",INVALID_KEY_MISSING=INVALID_KEY+": missing key",EXPIRED="Invalid license key: expired",TRIAL_EXPIRED=EXPIRED,INVALID_HOST="Invalid license key: host not allowed";export var Overlay=function(e){var n=e.l,t=React.useState(null),a=t[0],i=t[1],l=React.useState(-1),r=l[0],o=l[1],c=React.useState(!1),d=c[0],s=c[1];return React.useEffect((function(){__awaiter(void 0,void 0,void 0,(function(){var e,t;return __generator(this,(function(a){switch(a.label){case 0:return[4,n];case 1:return(e=a.sent()).local?(s(!0),[2]):(e.valid?e.allowed?e.expired&&i(e.t?EXPIRED:TRIAL_EXPIRED):i(INVALID_HOST):i(!1===e.valid?INVALID_KEY+(e.cryptoMissing?": works only with https":""):INVALID_KEY_MISSING),e.t&&o(Math.ceil(((null!==(t=null==e?void 0:e.e)&&void 0!==t?t:0)-Date.now()/1e3)/60/60/24)),[2])}}))}))}),[n]),d?React.createElement(TrialWrap,null,React.createElement("a",{href:"https://redoc.ly"},"Redocly API reference docs")," preview"):!a&&r>-1?React.createElement(TrialWrap,null," Trial version: ",r," days remaining "):a?React.createElement(Flash,null,React.createElement("span",null,a," ",React.createElement("br",null),React.createElement("small",null,"Please contact ",React.createElement("a",{href:"mailto:team@redoc.ly"},"team@redoc.ly")," to remedy the problem."," "))):null};var templateObject_1,templateObject_2,TrialWrap=styled.div(templateObject_1||(templateObject_1=__makeTemplateObject(["\n padding: 10px 40px;\n position: fixed;\n text-align: right;\n width: 100%;\n box-sizing: border-box;\n color: orange;\n z-index: 10;\n opacity: 0.6;\n\n > a,\n a:visited {\n color: orange;\n }\n"],["\n padding: 10px 40px;\n position: fixed;\n text-align: right;\n width: 100%;\n box-sizing: border-box;\n color: orange;\n z-index: 10;\n opacity: 0.6;\n\n > a,\n a:visited {\n color: orange;\n }\n"]))),Flash=styled.div(templateObject_2||(templateObject_2=__makeTemplateObject(["\n font-size: 1.5em;\n position: fixed;\n z-index: 100;\n background: rgba(38, 50, 56, 0.93);\n margin: 0;\n padding: 1em;\n width: 100%;\n color: white;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n\n text-align: center;\n box-sizing: border-box;\n\n > span {\n display: inline-block;\n line-height: 1.5;\n }\n\n a,\n a:hover,\n a:visited {\n color: white;\n }\n"],["\n font-size: 1.5em;\n position: fixed;\n z-index: 100;\n background: rgba(38, 50, 56, 0.93);\n margin: 0;\n padding: 1em;\n width: 100%;\n color: white;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n\n text-align: center;\n box-sizing: border-box;\n\n > span {\n display: inline-block;\n line-height: 1.5;\n }\n\n a,\n a:hover,\n a:visited {\n color: white;\n }\n"])));
|
|
2
2
|
//# sourceMappingURL=Overlay.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as React from"react";import{useState}from"react";export var Accordion=function(e){var t=e.initialActiveIdx,n=e.children,c=useState(t),a=c[0],r=c[1],i=React.useState(!1),l=i[0],o=i[1];React.useEffect((function(){setTimeout((function(){o(!0)}),500)}),[]),React.useEffect((function(){l||r(t)}),[t,
|
|
1
|
+
import*as React from"react";import{useState}from"react";export var Accordion=function(e){var t=e.initialActiveIdx,n=e.children,c=useState(t),a=c[0],r=c[1],i=React.useState(!1),l=i[0],o=i[1];React.useEffect((function(){setTimeout((function(){o(!0)}),500)}),[]),React.useEffect((function(){l||r(t)}),[t,l]);var u=React.useCallback((function(e){r(e)}),[r]),f=React.Children.toArray(n).filter(React.isValidElement);return React.createElement(React.Fragment,null,React.Children.map(f,(function(e,t){return React.cloneElement(e,{key:t,collapsed:t!==a,onToggle:function(){return u(t)}})||null}))||null)};
|
|
2
2
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import styled,{keyframes,css}from"../../redoc-lib/src/styled-components";var templateObject_1,templateObject_2,templateObject_3,showPanel=keyframes(templateObject_1||(templateObject_1=__makeTemplateObject(["\n 0% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n"],["\n 0% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n"]))),showPanelAnimation=css(templateObject_2||(templateObject_2=__makeTemplateObject(["\n animation: "," 0.2s;\n"],["\n animation: "," 0.2s;\n"])),showPanel);export var PanelBody=styled.div(templateObject_3||(templateObject_3=__makeTemplateObject(["\n ",";\n ",";\n\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n background-color: #fff;\n"],["\n ",";\n ",";\n\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n background-color: #fff;\n"])),(function(e){return e.
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import styled,{keyframes,css}from"../../redoc-lib/src/styled-components";var templateObject_1,templateObject_2,templateObject_3,showPanel=keyframes(templateObject_1||(templateObject_1=__makeTemplateObject(["\n 0% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n"],["\n 0% {\n transform: translateY(-10px);\n }\n 100% {\n transform: translateY(0);\n }\n"]))),showPanelAnimation=css(templateObject_2||(templateObject_2=__makeTemplateObject(["\n animation: "," 0.2s;\n"],["\n animation: "," 0.2s;\n"])),showPanel);export var PanelBody=styled.div(templateObject_3||(templateObject_3=__makeTemplateObject(["\n ",";\n ",";\n\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n background-color: #fff;\n"],["\n ",";\n ",";\n\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom-left-radius: ",";\n background-color: #fff;\n"])),(function(e){return e.animate&&showPanelAnimation}),(function(e){return e.hidden&&"visibility: hidden"}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius}),(function(e){return e.theme.components.panels.borderRadius}));
|
|
2
2
|
//# sourceMappingURL=PanelBody.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
export interface PanelHeaderProps {
|
|
3
3
|
expanded?: boolean;
|
|
4
4
|
toggle: (e: React.BaseSyntheticEvent) => void;
|
|
@@ -9,7 +9,6 @@ export interface PanelComponentProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
'data-cy'?: string;
|
|
11
11
|
header?: React.ReactNode | ((props: PanelHeaderProps) => React.ReactNode);
|
|
12
|
-
children?: React.ReactNode;
|
|
13
12
|
onToggle?: (expanded: boolean) => void;
|
|
14
13
|
}
|
|
15
|
-
export declare function PanelComponent({ collapsed, renderChildrenHidden, header, className, children, onToggle, }: PanelComponentProps): JSX.Element;
|
|
14
|
+
export declare function PanelComponent({ collapsed, renderChildrenHidden, header, className, children, onToggle, }: PropsWithChildren<PanelComponentProps>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React,{useEffect,useState}from"react";import{ShelfIcon}from"../../redoc-lib/src/common-elements";import{Header}from"./Header";import{Trigger}from"./Trigger";import{Title}from"./Title";import{PanelBody}from"./PanelBody";export function PanelComponent(e){var t=e.collapsed,n=void 0!==t&&t,r=e.renderChildrenHidden,o=void 0!==r&&r,a=e.header,c=e.className,l=e.children,i=e.onToggle,m=useState(!n),d=m[0],f=m[1],s=useState(!1),u=s[0],g=s[1],p=function(e){e.target instanceof HTMLAnchorElement||(g(!0),f(!d),null==i||i(!d))};return useEffect((function(){return f(!n)}),[n]),React.createElement("div",{className:c},a&&("function"==typeof a?a({expanded:d,toggle:p}):React.createElement(Header,{onClick:p,isExpanded:d},React.createElement(Trigger,null,React.createElement(Title,null,a),React.createElement(ShelfIcon,{direction:d?"down":"right"})))),(d||o)&&React.createElement(PanelBody,{hidden:!d,animate:u},l))}
|
|
2
2
|
//# sourceMappingURL=PanelComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject}from"tslib";import styled from"../../redoc-lib/src/styled-components";import{FieldsGroupHeader,ShelfIcon}from"../../redoc-lib/src/common-elements";import{Panel}from"./Panel";import{Header}from"./Header";import{Trigger}from"./Trigger";import{Title}from"./Title";export var ResponsePanel=styled(Panel)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n border: 1px solid ",";\n background-color: ",";\n\n > "," {\n padding: 10px 20px;\n font-size: 14px;\n line-height: 20px;\n\n "," {\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n color: ",";\n\n span + span {\n margin-left: 4px;\n }\n }\n\n "," {\n flex: 1;\n max-width: 100%;\n justify-content: space-between;\n }\n\n "," {\n fill: ",";\n }\n }\n\n "," {\n &:first-child {\n margin-top: 0;\n }\n }\n"],["\n border: 1px solid ",";\n background-color: ",";\n\n > "," {\n padding: 10px 20px;\n font-size: 14px;\n line-height: 20px;\n\n "," {\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n color: ",";\n\n span + span {\n margin-left: 4px;\n }\n }\n\n "," {\n flex: 1;\n max-width: 100%;\n justify-content: space-between;\n }\n\n "," {\n fill: ",";\n }\n }\n\n "," {\n &:first-child {\n margin-top: 0;\n }\n }\n"])),(function(n){var e=n.theme,r=n.type;return e.colors.responses[r].borderColor}),(function(n){var e=n.theme,r=n.type;return e.colors.responses[r].backgroundColor}),Header,Title,(function(n){
|
|
1
|
+
import{__makeTemplateObject}from"tslib";import styled from"../../redoc-lib/src/styled-components";import{FieldsGroupHeader,ShelfIcon}from"../../redoc-lib/src/common-elements";import{Panel}from"./Panel";import{Header}from"./Header";import{Trigger}from"./Trigger";import{Title}from"./Title";export var ResponsePanel=styled(Panel)(templateObject_1||(templateObject_1=__makeTemplateObject(["\n border: 1px solid ",";\n background-color: ",";\n\n > "," {\n padding: 10px 20px;\n font-size: 14px;\n line-height: 20px;\n\n "," {\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n color: ",";\n\n span + span {\n margin-left: 4px;\n }\n }\n\n "," {\n flex: 1;\n max-width: 100%;\n justify-content: space-between;\n }\n\n "," {\n fill: ",";\n }\n }\n\n "," {\n &:first-child {\n margin-top: 0;\n }\n }\n"],["\n border: 1px solid ",";\n background-color: ",";\n\n > "," {\n padding: 10px 20px;\n font-size: 14px;\n line-height: 20px;\n\n "," {\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n line-height: normal;\n color: ",";\n\n span + span {\n margin-left: 4px;\n }\n }\n\n "," {\n flex: 1;\n max-width: 100%;\n justify-content: space-between;\n }\n\n "," {\n fill: ",";\n }\n }\n\n "," {\n &:first-child {\n margin-top: 0;\n }\n }\n"])),(function(n){var e=n.theme,r=n.type;return e.colors.responses[r].borderColor}),(function(n){var e=n.theme,r=n.type;return e.colors.responses[r].backgroundColor}),Header,Title,(function(n){var e=n.theme,r=n.type;return e.colors.responses[r].color||e.colors.text.primary}),Trigger,ShelfIcon,(function(n){return n.theme.colors.text.primary}),FieldsGroupHeader);var templateObject_1;
|
|
2
2
|
//# sourceMappingURL=ResponsePanel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as React from"react";import{ThemeProvider,OptionsProvider,StoreProvider}from"../redoc-lib";export var ProProviders=function(e){var r=e.store,t=e.children
|
|
1
|
+
import*as React from"react";import{ThemeProvider,OptionsProvider,StoreProvider}from"../redoc-lib";export var ProProviders=function(e){var r=e.store,t=e.children;return React.createElement(ThemeProvider,{theme:r.options.theme},React.createElement(OptionsProvider,{value:r.options},React.createElement(StoreProvider,{value:r},t)))};
|
|
2
2
|
//# sourceMappingURL=ProProviders.js.map
|