@@ -16,7 +16,7 @@ import logSymbols from 'log-symbols';
16
16
import title from 'title' ;
17
17
import size from 'window-size' ;
18
18
import { ListConfig } from '../config/list' ;
19
- import { shouldPrettyPrint } from './utils' ;
19
+ import { redactPartOfString , shouldPrettyPrint } from './utils' ;
20
20
21
21
type KeyMaps = {
22
22
[ key in ListOptions ] : string [ ] ;
@@ -102,7 +102,7 @@ const extendedKeys: KeyMaps = {
102
102
} ;
103
103
104
104
function formatDate ( dateStr : string ) {
105
- return new Date ( dateStr ) . toString ( ) ;
105
+ return new Date ( dateStr ) . toString ( ) . slice ( 4 , 33 ) ;
106
106
}
107
107
108
108
function sortByAccess ( resA : CommonType , resB : CommonType ) {
@@ -283,7 +283,7 @@ function prettyPrintSection<T extends ListOptions>(
283
283
content = prettyPrintFunctionsOrAssets ( data ) ;
284
284
}
285
285
const output = stripIndent `
286
- ${ sectionHeader } \n\n${ content } \n\n${ chalk . dim ( LONG_LINE ) } \n
286
+ ${ sectionHeader } \n\n${ content } \n\n\n
287
287
` ;
288
288
return output ;
289
289
}
@@ -292,8 +292,26 @@ function printListResultTerminal(result: ListResult, config: ListConfig): void {
292
292
const sections = Object . keys ( result ) as ListOptions [ ] ;
293
293
const output = sections
294
294
. map ( section => prettyPrintSection ( section , result [ section ] ) )
295
- . join ( ' \n\n' ) ;
295
+ . join ( ` \n\n${ chalk . dim ( LONG_LINE ) } \n\n` ) ;
296
296
297
+ let metaInfo = stripIndent ( chalk `
298
+ {cyan.bold Account} ${ config . accountSid }
299
+ {cyan.bold Token} ${ redactPartOfString ( config . authToken ) }
300
+ ` ) ;
301
+
302
+ if ( config . serviceSid || config . serviceName ) {
303
+ metaInfo += chalk `\n{cyan.bold Service} ${ config . serviceSid ||
304
+ config . serviceName } `;
305
+ }
306
+
307
+ if ( config . environment ) {
308
+ metaInfo += chalk `\n{cyan.bold Environment} ${ config . environment } ` ;
309
+ }
310
+
311
+ if ( config . environment ) {
312
+ }
313
+
314
+ process . stderr . write ( metaInfo + '\n\n' ) ;
297
315
console . log ( output ) ;
298
316
}
299
317
0 commit comments