File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createSelector } from "reselect"
2+ import { Map } from "immutable"
3+ import { isOAS3 as isOAS3Helper , isSwagger2 as isSwagger2Helper } from "../helpers"
4+
5+
6+ // Helpers
7+
8+ function onlyOAS3 ( selector ) {
9+ return ( ori , system ) => ( ...args ) => {
10+ const spec = system . getSystem ( ) . specSelectors . specJson ( )
11+ if ( isOAS3Helper ( spec ) ) {
12+ return selector ( ...args )
13+ } else {
14+ return ori ( ...args )
15+ }
16+ }
17+ }
18+
19+ const state = state => {
20+ return state || Map ( )
21+ }
22+
23+ const nullSelector = createSelector ( ( ) => null )
24+
25+ const OAS3NullSelector = onlyOAS3 ( nullSelector )
26+
27+ // Hasta la vista, authentication!
28+ export const shownDefinitions = OAS3NullSelector
29+ export const definitionsToAuthorize = OAS3NullSelector
30+ export const getDefinitionsByNames = OAS3NullSelector
31+ export const authorized = OAS3NullSelector
32+ export const isAuthorized = OAS3NullSelector
33+ export const getConfigs = OAS3NullSelector
Original file line number Diff line number Diff line change 11// import reducers from "./reducers"
22// import * as actions from "./actions"
33import * as specWrapSelectors from "./spec-extensions/wrap-selectors"
4+ import * as authWrapSelectors from "./auth-extensions/wrap-selectors"
45import * as specSelectors from "./spec-extensions/selectors"
56import components from "./components"
67import wrapComponents from "./wrap-components"
@@ -17,6 +18,9 @@ export default function() {
1718 wrapSelectors : specWrapSelectors ,
1819 selectors : specSelectors
1920 } ,
21+ auth : {
22+ wrapSelectors : authWrapSelectors
23+ } ,
2024 oas3 : {
2125 actions : oas3Actions ,
2226 reducers : oas3Reducers ,
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export const basePath = OAS3NullSelector
5353export const consumes = OAS3NullSelector
5454export const produces = OAS3NullSelector
5555export const schemes = OAS3NullSelector
56+ export const securityDefinitions = OAS3NullSelector
5657
5758// New selectors
5859
You can’t perform that action at this time.
0 commit comments