File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export default function (repository: Repository) {
106
106
) ;
107
107
} else {
108
108
const state = req . query [ 'state' ] || '' ;
109
+ const meta = req . query [ 'meta' ] === 'true' && res . conf . discovery . ui ;
109
110
let list = componentResults ;
110
111
if ( ! res . conf . discovery . experimental ) {
111
112
list = list . filter (
@@ -118,9 +119,20 @@ export default function (repository: Repository) {
118
119
119
120
res . status ( 200 ) . json (
120
121
Object . assign ( baseResponse , {
121
- components : list . map ( ( component ) =>
122
- urlBuilder . component ( component . name , res . conf . baseUrl )
123
- )
122
+ components : list . map ( ( component ) => {
123
+ const href = urlBuilder . component ( component . name , res . conf . baseUrl ) ;
124
+
125
+ return meta
126
+ ? {
127
+ href,
128
+ name : component . name ,
129
+ version : component . version ,
130
+ description : component . description ,
131
+ state : component . oc . state ,
132
+ publishDate : new Date ( component . oc . date ) . toISOString ( )
133
+ }
134
+ : href ;
135
+ } )
124
136
} )
125
137
) ;
126
138
}
You can’t perform that action at this time.
0 commit comments