Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
72fc441
improved error messages: 500 lines
reeshika-h Oct 15, 2025
b71d59e
Merge branch 'development' into fix/DX-3458-error-msg-improve
reeshika-h Oct 15, 2025
e71f266
chore: fixed testcase assertions
reeshika-h Oct 15, 2025
1641516
chore: update package-lock
reeshika-h Oct 15, 2025
c061f77
testing config test cases
reeshika-h Oct 15, 2025
8c7a765
chore: add test cases for label, and marketplace modules
Nov 10, 2025
e6c525b
Merge branch 'development' into feat/DX-3585
Nov 11, 2025
85cb7ec
Merge pull request #2224 from contentstack/feat/DX-3585
naman-contentstack Nov 11, 2025
05ce74c
chore: add test case for personalize module
Nov 11, 2025
f37b10b
Merge pull request #2230 from contentstack/feat/DX-3337
naman-contentstack Nov 11, 2025
4f58dae
chore: add test case for entries module
Nov 12, 2025
60aebb9
Merge pull request #2231 from contentstack/feat/DX-3586
naman-contentstack Nov 12, 2025
1ad38d9
added delay after create entries
shafeeqd959 Nov 17, 2025
323bcc7
Fix: Updated File Names of Generated reports
cs-raj Nov 17, 2025
8cb3aa1
Merge branch 'development' into fix/DR-1
cs-raj Nov 17, 2025
892f3d8
Lock File update
cs-raj Nov 17, 2025
3ce1ba2
feat: session based logs with date hierarchy
Nov 17, 2025
192ba55
resolved comments
Nov 18, 2025
349f207
feat: add v2 logger in clone
Nov 18, 2025
2798552
Merge pull request #2241 from contentstack/fix/DR-1
cs-raj Nov 18, 2025
e35c2e9
updated debug logs
Nov 19, 2025
9c0c100
Merge branch 'feat/DX-3646' into feat/DX-3700
Nov 19, 2025
fac8313
updated talisman
Nov 19, 2025
42828b5
resolved comments
Nov 19, 2025
014f0ee
added export and import support for composable studio project
shafeeqd959 Nov 20, 2025
83d017e
restricted authentication to basiz auth
shafeeqd959 Nov 21, 2025
77cdc90
updated test cases
shafeeqd959 Nov 24, 2025
c1de49f
updated talismanrc
shafeeqd959 Nov 24, 2025
0a79eb0
updated talismanrc
shafeeqd959 Nov 24, 2025
e315e30
updated error handling
shafeeqd959 Nov 26, 2025
11d559f
Merge pull request #2246 from contentstack/export-import/composable-s…
shafeeqd959 Nov 26, 2025
0a5136c
integrate centralized logger in import setup
sunil-lakshman Nov 26, 2025
cbdaf4b
Fixed PR comments
sunil-lakshman Nov 27, 2025
9786c8d
chore: update package-lock.json and improve error messages across mul…
reeshika-h Nov 27, 2025
c317289
merged development changes
reeshika-h Nov 27, 2025
afb21a2
chore: update package-lock.json to upgrade AWS SDK and TypeScript dep…
reeshika-h Nov 27, 2025
cefa2b7
fix: Taxonomy Export Fails When Localization Not in Plan
aman19K Nov 27, 2025
1f9ddd5
fix: test cases
aman19K Nov 27, 2025
ab5b003
Merge pull request #2255 from contentstack/fix/DX-3792
aman19K Nov 28, 2025
3e6fda5
Merge branch 'development' into enh/dx-3701
sunil-lakshman Nov 28, 2025
bf89d5f
Merge pull request #2254 from contentstack/enh/dx-3701
sunil-lakshman Dec 1, 2025
619161b
refactor: enhance logging messages for clarity across multiple import…
reeshika-h Dec 1, 2025
72cbe46
refactor: improve error and logging messages for consistency and clar…
reeshika-h Dec 2, 2025
4263ac4
merged devlopment changes
reeshika-h Dec 2, 2025
570714c
Merge branch 'development' into feat/DX-3646
Dec 2, 2025
6d46d49
updated package-lock
Dec 2, 2025
6918642
Merge branch 'feat/DX-3646' into feat/DX-3700
Dec 2, 2025
f003dba
resolved comments
Dec 2, 2025
077cd8f
Merge pull request #2244 from contentstack/feat/DX-3700
naman-contentstack Dec 2, 2025
30bdd5a
refactor: enhance error handling and logging messages for improved cl…
reeshika-h Dec 3, 2025
6990c54
added multi region support
shafeeqd959 Dec 3, 2025
3eb3080
refactor: remove unnecessary logging and clean up test file configura…
reeshika-h Dec 4, 2025
1014392
fixed test cases and added import support
shafeeqd959 Dec 4, 2025
8bf0657
fixed test cases and added import support
shafeeqd959 Dec 4, 2025
0f3c9b8
fixed test cases and added import support
shafeeqd959 Dec 4, 2025
34ae653
fixed test cases and added import support
shafeeqd959 Dec 4, 2025
7405477
Merge pull request #2258 from contentstack/export-import/composable-s…
shafeeqd959 Dec 4, 2025
622afc9
merged changes
shafeeqd959 Dec 4, 2025
ddb6d37
bumped versions
shafeeqd959 Dec 4, 2025
97cd57e
Merge pull request #2242 from contentstack/feat/DX-3646
naman-contentstack Dec 4, 2025
125055e
refactor: add error logging for current region in RegionGetCommand
reeshika-h Dec 4, 2025
88ec7c2
Merge branch development into fix/DX-3458-error-msg-improve
reeshika-h Dec 4, 2025
d6de898
fixed the base path
shafeeqd959 Dec 4, 2025
edc4f22
fixed the base path
shafeeqd959 Dec 4, 2025
77b5110
chore: update package-lock.json and pnpm-lock.yaml to reflect depende…
reeshika-h Dec 5, 2025
349ecba
Merge pull request #2257 from contentstack/fix/DX-3458-error-msg-improve
reeshika-h Dec 5, 2025
eab5965
version bump
harshithad0703 Dec 5, 2025
dcc72fc
Merge branch 'main' into fix/version-bump-1.53.0
harshithad0703 Dec 5, 2025
693fd36
Merge pull request #2263 from contentstack/fix/version-bump-1.53.0
harshithad0703 Dec 5, 2025
8563ce3
updated auth unit test workflow script
shafeeqd959 Dec 5, 2025
ed1c1ca
merged latest changes
shafeeqd959 Dec 5, 2025
c6c3d22
Merge pull request #2259 from contentstack/feat/composable-studio-sup…
harshithad0703 Dec 5, 2025
241c5e3
resolve version bump
harshithad0703 Dec 5, 2025
e5da630
Merge pull request #2266 from contentstack/fix/version-bumps
harshithad0703 Dec 5, 2025
37dbb6d
Merged development branch changes to v2 beta dev
sunil-lakshman Dec 5, 2025
05cd0bb
Merged development branch changes to v2 beta dev
sunil-lakshman Dec 5, 2025
a772c50
Workflow file added
sunil-lakshman Dec 5, 2025
fd72578
Fixed failed unit tests
sunil-lakshman Dec 8, 2025
f71d666
Fixed failed unit tests
sunil-lakshman Dec 8, 2025
b54ebb7
Fixed testcases
sunil-lakshman Dec 16, 2025
68d6890
Updated test command in contentstack-config
sunil-lakshman Dec 16, 2025
b8d499a
Fixed unit testcases in contentstack-config
sunil-lakshman Dec 16, 2025
97cfed7
Fixed failed tests in contentstack export csv
sunil-lakshman Dec 16, 2025
1581f16
Fixed failed tests in export CSV
sunil-lakshman Dec 16, 2025
db1087e
Fix failed tests
sunil-lakshman Dec 16, 2025
da5c7f6
Fixed testcases
sunil-lakshman Dec 16, 2025
0bad02c
Fixed testcases
sunil-lakshman Dec 16, 2025
e6b5d7e
Fixed merge conflits
sunil-lakshman Dec 18, 2025
3f79b83
Run the auth plugin tests in prepack mode
sunil-lakshman Dec 18, 2025
506c475
Fixed merge conflits
sunil-lakshman Jan 7, 2026
f283978
merge conflits
sunil-lakshman Jan 7, 2026
803bdce
Fixed Test flow
cs-raj Jan 7, 2026
b0fd28c
Fixed Messagehandler import
cs-raj Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,37 @@ jobs:
working-directory: ./packages/contentstack-command
run: npm run test:unit

# - name: Run tests for Contentstack Import Plugin
# working-directory: ./packages/contentstack-import
# run: npm run test:unit
- name: Run tests for Contentstack Import Plugin
working-directory: ./packages/contentstack-import
run: npm run test:unit

# - name: Run tests for Contentstack Export Plugin
# working-directory: ./packages/contentstack-export
# run: npm run test:unit
- name: Run tests for Contentstack Export Plugin
working-directory: ./packages/contentstack-export
run: npm run test:unit

- name: Run tests for Audit plugin
working-directory: ./packages/contentstack-audit
run: npm run test:unit

- name: Run tests for Contentstack Config
working-directory: ./packages/contentstack-config
run: npm run test
run: npm run test:unit

- name: Run tests for Contentstack Migration
working-directory: ./packages/contentstack-migration
run: npm run test

- name: Run tests for Contentstack Export To CSV
working-directory: ./packages/contentstack-export-to-csv
run: npm run test:unit
run: NODE_ENV=PREPACK_MODE npm run test:unit

- name: Run tests for Contentstack Bootstrap
working-directory: ./packages/contentstack-bootstrap
run: npm run test

- name: Run tests for Contentstack Auth
working-directory: ./packages/contentstack-auth
run: npm run test
run: NODE_ENV=PREPACK_MODE npm run test

# - name: Run tests for Contentstack Import Setup
# working-directory: ./packages/contentstack-import-setup
Expand Down Expand Up @@ -104,4 +104,4 @@ jobs:
# else
# echo "contentstack-audit has not changed. Skipping tests."
# fi
# done
# done
2,866 changes: 1,720 additions & 1,146 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/contentstack-audit/src/audit-base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ export abstract class AuditBaseCommand extends BaseCommand<typeof AuditBaseComma
missingMultipleFields = missingEntry.missingMultipleFields ?? {};
await this.prepareReport(module, missingEntryRefs);

await this.prepareReport(`Entries_Select_feild`, missingSelectFeild);
await this.prepareReport(`Entries_Select_field`, missingSelectFeild);

await this.prepareReport('Entries_Mandatory_feild', missingMandatoryFields);
await this.prepareReport('Entries_Mandatory_field', missingMandatoryFields);

await this.prepareReport('Entries_Title_feild', missingTitleFields);
await this.prepareReport('Entries_Title_field', missingTitleFields);

await this.prepareReport('Entry_Missing_Locale_and_Env_in_Publish_Details', missingEnvLocalesInEntries);

Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack-audit/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ const config = {
"Passed",
],
ReportTitleForEntries: {
Entries_Select_feild: 'Entries_Select_feild',
Entries_Mandatory_feild: 'Entries_Mandatory_feild',
Entries_Title_feild: 'Entries_Title_feild',
Entries_Select_field: 'Entries_Select_field',
Entries_Mandatory_field: 'Entries_Mandatory_field',
Entries_Title_field: 'Entries_Title_field',
Entry_Missing_Locale_and_Env: 'Entry_Missing_Locale_and_Env',
Entry_Missing_Locale_and_Env_in_Publish_Details: 'Entry_Missing_Locale_and_Env_in_Publish_Details',
Entry_Multiple_Fields:"Entry_Multiple_Fields"
},
feild_level_modules: [
'Entries_Title_feild',
'Entries_Mandatory_feild',
'Entries_Select_feild',
'Entries_Title_field',
'Entries_Mandatory_field',
'Entries_Select_field',
'Entry_Missing_Locale_and_Env_in_Publish_Details',
'field-rules',
'Entry_Multiple_Fields',
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ FLAGS
-e, --environment=<value> Environment name for delivery token
-k, --stack-api-key=<value> Stack API Key
-m, --management Set this flag to save management token
-t, --token=<value> Add the token name
-t, --token=<value> [env: TOKEN] Add the token name
-y, --yes Use this flag to skip confirmation

DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-command": "~1.7.0",
"@contentstack/cli-utilities": "~1.15.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
Expand Down
22 changes: 11 additions & 11 deletions packages/contentstack-auth/src/commands/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ export default class LoginCommand extends BaseCommand<typeof LoginCommand> {
log.debug('LoginCommand run method started', this.contextDetails);

try {
log.debug('Initializing management API client', this.contextDetails);
log.debug('Initializing the Management API client.', this.contextDetails);
const managementAPIClient = await managementSDKClient({ host: this.cmaHost, skipTokenValidity: true });
log.debug('Management API client initialized successfully', this.contextDetails);
log.debug('Management API client initialized successfully.', this.contextDetails);

const { flags: loginFlags } = await this.parse(LoginCommand);
log.debug('Token add flags parsed', { ...this.contextDetails, flags: loginFlags });
log.debug('Token add flags parsed.', { ...this.contextDetails, flags: loginFlags });

authHandler.client = managementAPIClient;
log.debug('Auth handler client set', this.contextDetails);
Expand All @@ -86,7 +86,7 @@ export default class LoginCommand extends BaseCommand<typeof LoginCommand> {
await this.login(username, password);
}
} catch (error) {
log.debug('Login command failed', {
log.debug('Login failed.', {
...this.contextDetails,
error,
});
Expand Down Expand Up @@ -116,26 +116,26 @@ export default class LoginCommand extends BaseCommand<typeof LoginCommand> {
}

const user: User = await authHandler.login(username, password, tfaToken);
log.debug('Auth handler login completed', {
log.debug('Auth handler login completed.', {
...this.contextDetails,
hasUser: !!user,
hasAuthToken: !!user?.authtoken,
userEmail: user?.email,
});

if (typeof user !== 'object' || !user.authtoken || !user.email) {
log.debug('Login failed - invalid user response', { ...this.contextDetails, user });
throw new CLIError('Failed to login - invalid response');
log.debug('Login failed: Invalid user response', { ...this.contextDetails, user });
throw new CLIError('Login failed: Invalid response.');
}

log.debug('Setting config data for basic auth', this.contextDetails);
log.debug('Setting configuration data for basic authentication.', this.contextDetails);
await oauthHandler.setConfigData('basicAuth', user);
log.debug('Config data set successfully', this.contextDetails);
log.debug('Configuration data set successfully.', this.contextDetails);

log.success(messageHandler.parse('CLI_AUTH_LOGIN_SUCCESS'), this.contextDetails);
log.debug('Login process completed successfully', this.contextDetails);
log.debug('Login completed successfully.', this.contextDetails);
} catch (error) {
log.debug('Login process failed', { ...this.contextDetails, error });
log.debug('Login failed.', { ...this.contextDetails, error });
throw error;
}
}
Expand Down
14 changes: 7 additions & 7 deletions packages/contentstack-auth/src/commands/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {
}

try {
log.debug('Initializing management API client for logout', this.contextDetails);
log.debug('Initializing the Management API client for logout.', this.contextDetails);
const managementAPIClient = await managementSDKClient({ host: this.cmaHost, skipTokenValidity: true });
log.debug('Management API client initialized successfully', this.contextDetails);

Expand All @@ -75,9 +75,9 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {
if (await oauthHandler.isAuthorisationTypeBasic()) {
log.debug('Using basic authentication for logout', this.contextDetails);
const authToken = configHandler.get('authtoken');
log.debug('Retrieved auth token for logout', { ...this.contextDetails, hasAuthToken: !!authToken });
log.debug('Authentication token retrieved for logout.', { ...this.contextDetails, hasAuthToken: !!authToken });
await authHandler.logout(authToken);
log.debug('Basic auth logout completed', this.contextDetails);
log.debug('Basic authentication logout completed.', this.contextDetails);
} else if (await oauthHandler.isAuthorisationTypeOAuth()) {
log.debug('Using OAuth authentication for logout', this.contextDetails);
await oauthHandler.oauthLogout();
Expand All @@ -86,7 +86,7 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {

cliux.loader('');
log.success(messageHandler.parse('CLI_AUTH_LOGOUT_SUCCESS'), this.contextDetails);
log.debug('Logout process completed successfully', this.contextDetails);
log.debug('Logout completed successfully.', this.contextDetails);
} else {
log.debug('User not confirmed or not authenticated, skipping logout', {
...this.contextDetails,
Expand All @@ -96,14 +96,14 @@ export default class LogoutCommand extends BaseCommand<typeof LogoutCommand> {
log.success(messageHandler.parse('CLI_AUTH_LOGOUT_ALREADY'), this.contextDetails);
}
} catch (error) {
log.debug('Logout command failed', { ...this.contextDetails, error: error.message });
log.debug('Logout failed.', { ...this.contextDetails, error: error.message });
cliux.print('CLI_AUTH_LOGOUT_FAILED', { color: 'yellow' });
handleAndLogError(error, { ...this.contextDetails });
} finally {
if (confirm === true) {
log.debug('Setting config data for logout', this.contextDetails);
log.debug('Setting configuration data for logout.', this.contextDetails);
await oauthHandler.setConfigData('logout');
log.debug('Config data set for logout', this.contextDetails);
log.debug('Configuration data set for logout.', this.contextDetails);
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions packages/contentstack-auth/src/commands/auth/tokens/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
'auth:tokens:add [-a <value>] [--delivery] [--management] [-e <value>] [-k <value>] [-y] [--token <value>]';

async run(): Promise<any> {
log.debug('TokensAddCommand run method started', this.contextDetails);
log.debug('TokensAddCommand run method started.', this.contextDetails);
this.contextDetails.module = 'tokens-add';

const { flags: addTokenFlags } = await this.parse(TokensAddCommand);
log.debug('Token add flags parsed', { ...this.contextDetails, flags: addTokenFlags });
log.debug('Token add flags parsed.', { ...this.contextDetails, flags: addTokenFlags });

let isAliasExist = false;
const skipAliasReplaceConfirmation = addTokenFlags.force || addTokenFlags.yes;
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman

if (!shouldAliasReplace) {
log.debug('User declined alias replacement, exiting', this.contextDetails);
log.info('Exiting from the process of replacing the token', this.contextDetails);
log.info('Exiting the token replacement process.', this.contextDetails);
cliux.print('CLI_AUTH_EXIT_PROCESS');
return;
}
Expand All @@ -150,13 +150,13 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
if (!apiKey) {
log.debug('No API key provided, requesting user input', this.contextDetails);
apiKey = await cliux.inquire({ type: 'input', message: 'CLI_AUTH_TOKENS_ADD_ENTER_API_KEY', name: 'apiKey' });
log.debug('API key obtained', { ...this.contextDetails, hasApiKey: !!apiKey });
log.debug('API key obtained.', { ...this.contextDetails, hasApiKey: !!apiKey });
}

if (!token) {
log.debug('No token provided, requesting user input', this.contextDetails);
token = await cliux.inquire({ type: 'input', message: 'CLI_AUTH_TOKENS_ADD_ENTER_TOKEN', name: 'token' });
log.debug('Token obtained', { ...this.contextDetails, hasToken: !!token });
log.debug('Token obtained.', { ...this.contextDetails, hasToken: !!token });
}

if (isDelivery && !environment) {
Expand All @@ -183,12 +183,12 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
// FIXME - Once the SDK refresh token issue is resolved, need to revert this back to SDK call
const httpClient = new HttpClient({ headers: { api_key: apiKey, authorization: token } });

log.debug('Making management token validation API call', this.contextDetails);
log.debug('Making management token validation API call.', this.contextDetails);
const response = (await httpClient.get(`https://${this.cmaHost}/v3/environments?limit=1`)).data;
log.debug('Management token validation response received', { ...this.contextDetails, response });
log.debug('Management token validation response received.', { ...this.contextDetails, response });

if (response?.error_code === 105) {
log.debug('Management token validation failed - invalid token', this.contextDetails);
log.debug('Management token validation failed: invalid token.', this.contextDetails);
throw new Error(messageHandler.parse('CLI_AUTH_TOKENS_VALIDATION_INVALID_MANAGEMENT_TOKEN'));
} else if (response?.error_message) {
log.debug('Management token validation failed with error message', {
Expand All @@ -197,7 +197,7 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
});
throw new Error(response.error_message);
}
log.debug('Management token validation successful', this.contextDetails);
log.debug('Management token validation successful.', this.contextDetails);
}

log.debug('Saving token to configuration', {
Expand All @@ -208,23 +208,23 @@ export default class TokensAddCommand extends BaseCommand<typeof TokensAddComman
});
if (isManagement) {
configHandler.set(`${configKeyTokens}.${alias}`, { token, apiKey, type });
log.debug('Management token saved to configuration', this.contextDetails);
log.debug('Management token saved to configuration.', this.contextDetails);
} else {
configHandler.set(`${configKeyTokens}.${alias}`, { token, apiKey, environment, type });
log.debug('Delivery token saved to configuration', this.contextDetails);
log.debug('Delivery token saved to configuration.', this.contextDetails);
}

if (isAliasExist) {
log.debug('Token replaced successfully', this.contextDetails);
log.debug('Token replaced successfully.', this.contextDetails);
cliux.success('CLI_AUTH_TOKENS_ADD_REPLACE_SUCCESS');
} else {
log.debug('Token added successfully', this.contextDetails);
log.debug('Token added successfully.', this.contextDetails);
cliux.success('CLI_AUTH_TOKENS_ADD_SUCCESS');
}

log.debug('Token add process completed successfully', this.contextDetails);
log.debug('Token addition process completed successfully.', this.contextDetails);
} catch (error) {
log.debug('Token add process failed', { ...this.contextDetails, error });
log.debug('Token addition process failed.', { ...this.contextDetails, error });
cliux.print('CLI_AUTH_TOKENS_ADD_FAILED', { color: 'yellow' });
handleAndLogError(error, { ...this.contextDetails });
}
Expand Down
20 changes: 10 additions & 10 deletions packages/contentstack-auth/src/commands/auth/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export default class TokensListCommand extends BaseCommand<typeof TokensListComm
]); // use the cli table flags as it displays tokens in table

async run(): Promise<any> {
log.debug('TokensListCommand run method started', this.contextDetails);
log.debug('TokensListCommand run method started.', this.contextDetails);
this.contextDetails.module = 'tokens-list';

try {
log.debug('Retrieving tokens from configuration', this.contextDetails);
log.debug('Retrieving tokens from configuration.', this.contextDetails);
const managementTokens = configHandler.get('tokens');
log.debug('Tokens retrieved from configuration', {...this.contextDetails, tokenCount: managementTokens ? Object.keys(managementTokens).length : 0 });
log.debug('Tokens retrieved from configuration.', {...this.contextDetails, tokenCount: managementTokens ? Object.keys(managementTokens).length : 0 });

const tokens: Record<string, unknown>[] = [];
if (managementTokens && Object.keys(managementTokens).length > 0) {
log.debug('Processing tokens for display', this.contextDetails);
log.debug('Processing tokens for display.', this.contextDetails);
Object.keys(managementTokens).forEach(function (item) {
tokens.push({
alias: item,
Expand All @@ -46,7 +46,7 @@ export default class TokensListCommand extends BaseCommand<typeof TokensListComm
});

const { flags } = await this.parse(TokensListCommand);
log.debug('Tokens list flags parsed', {...this.contextDetails, flags });
log.debug('Token list flags parsed.', {...this.contextDetails, flags });

const headers = [
{
Expand All @@ -66,17 +66,17 @@ export default class TokensListCommand extends BaseCommand<typeof TokensListComm
},
];

log.debug('Displaying tokens table', {...this.contextDetails, tokenCount: tokens.length });
log.debug('Displaying token table.', {...this.contextDetails, tokenCount: tokens.length });
cliux.table(headers, tokens, flags as TableFlags);
log.debug('Tokens table displayed successfully', this.contextDetails);
log.debug('Token table displayed successfully.', this.contextDetails);
} else {
log.debug('No tokens found in configuration', this.contextDetails);
log.debug('No tokens found in configuration.', this.contextDetails);
cliux.print('CLI_AUTH_TOKENS_LIST_NO_TOKENS');
}

log.debug('Tokens list command completed successfully', this.contextDetails);
log.debug('Token list command completed successfully.', this.contextDetails);
} catch (error) {
log.debug('Tokens list command failed', {...this.contextDetails, error });
log.debug('Token list command failed.', {...this.contextDetails, error });
cliux.print('CLI_AUTH_TOKENS_LIST_FAILED', { color: 'yellow' });
handleAndLogError(error, { ...this.contextDetails });
}
Expand Down
Loading
Loading