@@ -33,7 +33,7 @@ const COLUMNS: Record<string, ColumnDef<SandboxCloneGetModel>> = {
3333 } ,
3434 progressPercentage : {
3535 header : 'Progress %' ,
36- get : ( c ) => ( c . progressPercentage !== undefined ? `${ c . progressPercentage } %` : '-' ) ,
36+ get : ( c ) => ( c . progressPercentage === undefined ? '-' : `${ c . progressPercentage } %` ) ,
3737 } ,
3838 createdAt : {
3939 header : 'Created At' ,
@@ -49,7 +49,7 @@ const COLUMNS: Record<string, ColumnDef<SandboxCloneGetModel>> = {
4949 } ,
5050 elapsedTimeInSec : {
5151 header : 'Elapsed Time (sec)' ,
52- get : ( c ) => ( c . elapsedTimeInSec !== undefined ? c . elapsedTimeInSec . toString ( ) : '-' ) ,
52+ get : ( c ) => ( c . elapsedTimeInSec === undefined ? '-' : c . elapsedTimeInSec . toString ( ) ) ,
5353 } ,
5454 realm : {
5555 header : 'Realm' ,
@@ -63,6 +63,13 @@ const DEFAULT_COLUMNS = ['cloneId', 'status', 'sourceInstance', 'targetInstance'
6363 * Command to list sandbox clones for a specific sandbox.
6464 */
6565export default class CloneList extends OdsCommand < typeof CloneList > {
66+ static args = {
67+ sandboxId : Args . string ( {
68+ description : 'Sandbox ID (UUID or friendly format like realm-instance)' ,
69+ required : true ,
70+ } ) ,
71+ } ;
72+
6673 static description = t ( 'commands.clone.list.description' , 'List all clones for a specific sandbox' ) ;
6774
6875 static enableJsonFlag = true ;
@@ -74,13 +81,6 @@ export default class CloneList extends OdsCommand<typeof CloneList> {
7481 '<%= config.bin %> <%= command.id %> <sandboxId> --extended' ,
7582 ] ;
7683
77- static args = {
78- sandboxId : Args . string ( {
79- description : 'Sandbox ID (UUID or friendly format like realm-instance)' ,
80- required : true ,
81- } ) ,
82- } ;
83-
8484 static flags = {
8585 from : Flags . string ( {
8686 description : 'Filter clones created on or after this date (ISO 8601 date format, e.g., 2024-01-01)' ,
@@ -108,11 +108,7 @@ export default class CloneList extends OdsCommand<typeof CloneList> {
108108
109109 async run ( ) : Promise < { data ?: SandboxCloneGetModel [ ] } > {
110110 const { sandboxId : rawSandboxId } = this . args ;
111- const {
112- from : fromDate ,
113- to : toDate ,
114- status,
115- } = this . flags ;
111+ const { from : fromDate , to : toDate , status} = this . flags ;
116112
117113 // Resolve sandbox ID (handles both UUID and friendly format)
118114 const sandboxId = await this . resolveSandboxId ( rawSandboxId ) ;
@@ -125,16 +121,14 @@ export default class CloneList extends OdsCommand<typeof CloneList> {
125121 query : {
126122 fromDate,
127123 toDate,
128- status : status as 'Pending ' | 'InProgress ' | 'Failed ' | 'Completed ' | undefined ,
124+ status : status as 'Completed ' | 'Failed ' | 'InProgress ' | 'Pending ' | undefined ,
129125 } ,
130126 } ,
131127 } ) ;
132128
133129 if ( ! result . data ) {
134130 const message = getApiErrorMessage ( result . error , result . response ) ;
135- this . error (
136- t ( 'commands.clone.list.error' , 'Failed to list sandbox clones: {{message}}' , { message} ) ,
137- ) ;
131+ this . error ( t ( 'commands.clone.list.error' , 'Failed to list sandbox clones: {{message}}' , { message} ) ) ;
138132 }
139133
140134 if ( this . jsonEnabled ( ) ) {
@@ -151,9 +145,7 @@ export default class CloneList extends OdsCommand<typeof CloneList> {
151145 const tableRenderer = new TableRenderer ( COLUMNS ) ;
152146 tableRenderer . render ( clones , columns ) ;
153147
154- this . log (
155- t ( 'commands.clone.list.total' , '\nTotal: {{total}} clone(s)' , { total : clones . length } ) ,
156- ) ;
148+ this . log ( t ( 'commands.clone.list.total' , '\nTotal: {{total}} clone(s)' , { total : clones . length } ) ) ;
157149
158150 return { data : clones } ;
159151 }
0 commit comments