@@ -8,14 +8,7 @@ import { bold } from "colorette";
8
8
9
9
const Table = require ( "cli-table" ) ;
10
10
const 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" ] ;
19
12
export const command = new Command ( "backends:list" )
20
13
. description ( "List backends of a Firebase project." )
21
14
. option ( "-l, --location <location>" , "App Backend location" , "-" )
@@ -27,11 +20,11 @@ export const command = new Command("backends:list")
27
20
style : { head : [ "green" ] } ,
28
21
} ) ;
29
22
table . colWidths = COLUMN_LENGTH ;
30
- const backendsList : gcp . ListBackendsResponse [ ] = [ ] ;
23
+ const backendsList : gcp . Backend [ ] = [ ] ;
31
24
try {
32
25
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 ) ;
35
28
36
29
logger . info ( ) ;
37
30
logger . info ( `Backends for project ${ bold ( projectId ) } ` ) ;
@@ -47,8 +40,8 @@ export const command = new Command("backends:list")
47
40
return backendsList ;
48
41
} ) ;
49
42
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 ) {
52
45
const [ location , , backendId ] = backend . name . split ( "/" ) . slice ( 3 , 6 ) ;
53
46
const entry = [
54
47
backendId ,
0 commit comments