@@ -4,6 +4,7 @@ import { camelCase, kebabCase, pascalCase } from 'change-case'
44
55export interface RouteLayoutContext {
66 className : string
7+ isUndocumented : boolean
78 endpoints : EndpointLayoutContext [ ]
89 subroutes : SubrouteLayoutContext [ ]
910 skipClientSessionImport : boolean
@@ -30,6 +31,7 @@ export interface EndpointLayoutContext {
3031 returnsActionAttempt : boolean
3132 returnsVoid : boolean
3233 isOptionalParamsOk : boolean
34+ isUndocumented : boolean
3335}
3436
3537export interface SubrouteLayoutContext {
@@ -44,15 +46,13 @@ export const setRouteLayoutContext = (
4446 nodes : Array < Route | Namespace > ,
4547) : void => {
4648 file . className = getClassName ( node ?. path ?? null )
49+ file . isUndocumented = node ?. isUndocumented ?? false
4750 file . skipClientSessionImport =
4851 node == null || node ?. path === '/client_sessions'
4952
5053 file . endpoints = [ ]
5154 if ( node != null && 'endpoints' in node ) {
52- const endpoints = node . endpoints . filter (
53- ( { isUndocumented } ) => ! isUndocumented ,
54- )
55- file . endpoints = endpoints . map ( ( endpoint ) =>
55+ file . endpoints = node . endpoints . map ( ( endpoint ) =>
5656 getEndpointLayoutContext ( endpoint , node ) ,
5757 )
5858 }
@@ -64,7 +64,7 @@ export const setRouteLayoutContext = (
6464}
6565
6666const getSubrouteLayoutContext = (
67- route : Pick < Route , 'path' | 'name' > ,
67+ route : Pick < Route , 'path' | 'name' | 'isUndocumented' > ,
6868) : SubrouteLayoutContext => {
6969 return {
7070 fileName : `${ kebabCase ( route . name ) } /index.js` ,
@@ -116,6 +116,7 @@ export const getEndpointLayoutContext = (
116116 // UPSTREAM: Needs support in blueprint, fallback to true for now.
117117 // https://github.com/seamapi/blueprint/issues/205
118118 isOptionalParamsOk : true ,
119+ isUndocumented : endpoint . isUndocumented ,
119120 ...getResponseContext ( endpoint ) ,
120121 }
121122}
0 commit comments