@@ -82,11 +82,11 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
8282 'auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]' ;
8383
8484 async run ( ) : Promise < any > {
85- log . debug ( 'TokensAddCommand run method started' , this . contextDetails ) ;
85+ log . debug ( 'TokensAddCommand run method started. ' , this . contextDetails ) ;
8686 this . contextDetails . module = 'tokens-add' ;
8787
8888 const { flags : addTokenFlags } = await this . parse ( TokensAddCommand ) ;
89- log . debug ( 'Token add flags parsed' , { ...this . contextDetails , flags : addTokenFlags } ) ;
89+ log . debug ( 'Token add flags parsed. ' , { ...this . contextDetails , flags : addTokenFlags } ) ;
9090
9191 let isAliasExist = false ;
9292 const skipAliasReplaceConfirmation = addTokenFlags . force || addTokenFlags . yes ;
@@ -141,7 +141,7 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
141141
142142 if ( ! shouldAliasReplace ) {
143143 log . debug ( 'User declined alias replacement, exiting' , this . contextDetails ) ;
144- log . info ( 'Exiting from the process of replacing the token ' , this . contextDetails ) ;
144+ log . info ( 'Exiting the token replacement process. ' , this . contextDetails ) ;
145145 cliux . print ( 'CLI_AUTH_EXIT_PROCESS' ) ;
146146 return ;
147147 }
@@ -150,13 +150,13 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
150150 if ( ! apiKey ) {
151151 log . debug ( 'No API key provided, requesting user input' , this . contextDetails ) ;
152152 apiKey = await cliux . inquire ( { type : 'input' , message : 'CLI_AUTH_TOKENS_ADD_ENTER_API_KEY' , name : 'apiKey' } ) ;
153- log . debug ( 'API key obtained' , { ...this . contextDetails , hasApiKey : ! ! apiKey } ) ;
153+ log . debug ( 'API key obtained. ' , { ...this . contextDetails , hasApiKey : ! ! apiKey } ) ;
154154 }
155155
156156 if ( ! token ) {
157157 log . debug ( 'No token provided, requesting user input' , this . contextDetails ) ;
158158 token = await cliux . inquire ( { type : 'input' , message : 'CLI_AUTH_TOKENS_ADD_ENTER_TOKEN' , name : 'token' } ) ;
159- log . debug ( 'Token obtained' , { ...this . contextDetails , hasToken : ! ! token } ) ;
159+ log . debug ( 'Token obtained. ' , { ...this . contextDetails , hasToken : ! ! token } ) ;
160160 }
161161
162162 if ( isDelivery && ! environment ) {
@@ -183,12 +183,12 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
183183 // FIXME - Once the SDK refresh token issue is resolved, need to revert this back to SDK call
184184 const httpClient = new HttpClient ( { headers : { api_key : apiKey , authorization : token } } ) ;
185185
186- log . debug ( 'Making management token validation API call' , this . contextDetails ) ;
186+ log . debug ( 'Making management token validation API call. ' , this . contextDetails ) ;
187187 const response = ( await httpClient . get ( `https://${ this . cmaHost } /v3/environments?limit=1` ) ) . data ;
188- log . debug ( 'Management token validation response received' , { ...this . contextDetails , response } ) ;
188+ log . debug ( 'Management token validation response received. ' , { ...this . contextDetails , response } ) ;
189189
190190 if ( response ?. error_code === 105 ) {
191- log . debug ( 'Management token validation failed - invalid token' , this . contextDetails ) ;
191+ log . debug ( 'Management token validation failed: invalid token. ' , this . contextDetails ) ;
192192 throw new Error ( messageHandler . parse ( 'CLI_AUTH_TOKENS_VALIDATION_INVALID_MANAGEMENT_TOKEN' ) ) ;
193193 } else if ( response ?. error_message ) {
194194 log . debug ( 'Management token validation failed with error message' , {
@@ -197,7 +197,7 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
197197 } ) ;
198198 throw new Error ( response . error_message ) ;
199199 }
200- log . debug ( 'Management token validation successful' , this . contextDetails ) ;
200+ log . debug ( 'Management token validation successful. ' , this . contextDetails ) ;
201201 }
202202
203203 log . debug ( 'Saving token to configuration' , {
@@ -208,23 +208,23 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
208208 } ) ;
209209 if ( isManagement ) {
210210 configHandler . set ( `${ configKeyTokens } .${ alias } ` , { token, apiKey, type } ) ;
211- log . debug ( 'Management token saved to configuration' , this . contextDetails ) ;
211+ log . debug ( 'Management token saved to configuration. ' , this . contextDetails ) ;
212212 } else {
213213 configHandler . set ( `${ configKeyTokens } .${ alias } ` , { token, apiKey, environment, type } ) ;
214- log . debug ( 'Delivery token saved to configuration' , this . contextDetails ) ;
214+ log . debug ( 'Delivery token saved to configuration. ' , this . contextDetails ) ;
215215 }
216216
217217 if ( isAliasExist ) {
218- log . debug ( 'Token replaced successfully' , this . contextDetails ) ;
218+ log . debug ( 'Token replaced successfully. ' , this . contextDetails ) ;
219219 cliux . success ( 'CLI_AUTH_TOKENS_ADD_REPLACE_SUCCESS' ) ;
220220 } else {
221- log . debug ( 'Token added successfully' , this . contextDetails ) ;
221+ log . debug ( 'Token added successfully. ' , this . contextDetails ) ;
222222 cliux . success ( 'CLI_AUTH_TOKENS_ADD_SUCCESS' ) ;
223223 }
224224
225- log . debug ( 'Token add process completed successfully' , this . contextDetails ) ;
225+ log . debug ( 'Token addition process completed successfully. ' , this . contextDetails ) ;
226226 } catch ( error ) {
227- log . debug ( 'Token add process failed' , { ...this . contextDetails , error } ) ;
227+ log . debug ( 'Token addition process failed. ' , { ...this . contextDetails , error } ) ;
228228 cliux . print ( 'CLI_AUTH_TOKENS_ADD_FAILED' , { color : 'yellow' } ) ;
229229 handleAndLogError ( error , { ...this . contextDetails } ) ;
230230 }
0 commit comments