@@ -8,14 +8,7 @@ import { bold } from "colorette";
88
99const Table = require ( "cli-table" ) ;
1010const COLUMN_LENGTH = 20 ;
11- const TABLE_HEAD = [
12- "Backend Id" ,
13- "Repository Name" ,
14- "Location" ,
15- "URL" ,
16- "Created Date" ,
17- "Updated Date" ,
18- ] ;
11+ const TABLE_HEAD = [ "Backend Id" , "Repository" , "Location" , "URL" , "Created Date" , "Updated Date" ] ;
1912export const command = new Command ( "backends:list" )
2013 . description ( "List backends of a Firebase project." )
2114 . option ( "-l, --location <location>" , "App Backend location" , "-" )
@@ -27,11 +20,11 @@ export const command = new Command("backends:list")
2720 style : { head : [ "green" ] } ,
2821 } ) ;
2922 table . colWidths = COLUMN_LENGTH ;
30- const backendsList : gcp . ListBackendsResponse [ ] = [ ] ;
23+ const backendsList : gcp . Backend [ ] = [ ] ;
3124 try {
3225 const backendsPerRegion = await gcp . listBackends ( projectId , location ) ;
33- backendsList . push ( backendsPerRegion ) ;
34- populateTable ( backendsPerRegion , location , table ) ;
26+ backendsList . push ( ... backendsPerRegion . backends ) ;
27+ populateTable ( backendsList , table ) ;
3528
3629 logger . info ( ) ;
3730 logger . info ( `Backends for project ${ bold ( projectId ) } ` ) ;
@@ -47,8 +40,8 @@ export const command = new Command("backends:list")
4740 return backendsList ;
4841 } ) ;
4942
50- function populateTable ( backendsLists : gcp . ListBackendsResponse , location : string , table : any ) {
51- for ( const backend of backendsLists . backends ) {
43+ function populateTable ( backends : gcp . Backend [ ] , table : any ) {
44+ for ( const backend of backends ) {
5245 const [ location , , backendId ] = backend . name . split ( "/" ) . slice ( 3 , 6 ) ;
5346 const entry = [
5447 backendId ,
0 commit comments