File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createSelector } from "reselect"
2+ import { isOAS3 as isOAS3Helper } from "../helpers"
3+
4+
5+ // Helpers
6+
7+ function onlyOAS3 ( selector ) {
8+ return ( ori , system ) => ( ...args ) => {
9+ const spec = system . getSystem ( ) . specSelectors . specJson ( )
10+ if ( isOAS3Helper ( spec ) ) {
11+ return selector ( ...args )
12+ } else {
13+ return ori ( ...args )
14+ }
15+ }
16+ }
17+
18+ const nullSelector = createSelector ( ( ) => null )
19+
20+ const OAS3NullSelector = onlyOAS3 ( nullSelector )
21+
22+ // Hasta la vista, authentication!
23+ export const shownDefinitions = OAS3NullSelector
24+ export const definitionsToAuthorize = OAS3NullSelector
25+ export const getDefinitionsByNames = OAS3NullSelector
26+ export const authorized = OAS3NullSelector
27+ export const isAuthorized = OAS3NullSelector
28+ 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