Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 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
9ba66e2
Merge pull request #2234 from contentstack/v2-beta-dev
harshithad0703 Nov 13, 2025
28fd30d
Merge pull request #2236 from contentstack/v2-beta-dev
harshithad0703 Nov 13, 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
5d4b8b6
Merge pull request #2262 from contentstack/development
harshithad0703 Dec 5, 2025
6f41c23
Fixed entry update in bulk publish
sunil-lakshman Dec 8, 2025
dcdc88c
Fixed issue for groups and blocks
sunil-lakshman Dec 8, 2025
d046a1d
Fixed duplicate logs
sunil-lakshman Dec 9, 2025
f919c2c
Merge pull request #2269 from contentstack/fix/dx-3802
sunil-lakshman Dec 9, 2025
9de6910
updated UI text composable studio to studio
shafeeqd959 Dec 9, 2025
f8ad118
resolve version bump
harshithad0703 Dec 9, 2025
175b924
Merge branch 'staging' into fix/version_bump
harshithad0703 Dec 9, 2025
619b507
Merge pull request #2273 from contentstack/fix/version_bump
harshithad0703 Dec 9, 2025
db773a4
Merge pull request #2274 from contentstack/development
harshithad0703 Dec 9, 2025
b7b36e8
Merge pull request #2267 from contentstack/staging
harshithad0703 Dec 9, 2025
393d6cb
updated messages
shafeeqd959 Dec 11, 2025
75e0992
Merge branch 'development' of github.com:contentstack/cli into fix/co…
shafeeqd959 Dec 11, 2025
ff0282f
Merge pull request #2272 from contentstack/fix/composable-studio
shafeeqd959 Dec 11, 2025
411c4d0
bumped version
shafeeqd959 Dec 11, 2025
81b4f26
Merge branch 'development' of github.com:contentstack/cli into fix/co…
shafeeqd959 Dec 11, 2025
715d519
Merge pull request #2277 from contentstack/fix/composable-studio
harshithad0703 Dec 11, 2025
b2a1715
Merge branch 'staging' into fix/back-merge1
harshithad0703 Dec 11, 2025
07d6f96
Merge branch 'main' into fix/back-merge1
harshithad0703 Dec 11, 2025
1502509
Merge pull request #2279 from contentstack/fix/back-merge1
harshithad0703 Dec 11, 2025
2d2c22c
Merge pull request #2276 from contentstack/development
harshithad0703 Dec 11, 2025
a8d538f
Merge pull request #2280 from contentstack/staging
harshithad0703 Dec 15, 2025
8a6564d
Merge remote-tracking branch 'origin/v2-beta' into fix/v2-merge
harshithad0703 Jan 2, 2026
9cb92a0
Merge pull request #2257 from contentstack/fix/DX-3458-error-msg-improve
reeshika-h Dec 5, 2025
6e37e72
improve error msgs
harshithad0703 Jan 2, 2026
ee19898
Merge pull request #2224 from contentstack/feat/DX-3585
naman-contentstack Nov 11, 2025
1e22d73
Merge pull request #2230 from contentstack/feat/DX-3337
naman-contentstack Nov 11, 2025
5479f6c
Merge pull request #2231 from contentstack/feat/DX-3586
naman-contentstack Nov 12, 2025
d05dac4
Merge pull request #2241 from contentstack/fix/DR-1
cs-raj Nov 18, 2025
fa17076
Merge pull request #2246 from contentstack/export-import/composable-s…
shafeeqd959 Nov 26, 2025
46ca99b
Merge pull request #2255 from contentstack/fix/DX-3792
harshithad0703 Jan 2, 2026
9f9679e
make email field optional in context interface
harshithad0703 Jan 2, 2026
2aed3e0
Merge pull request #2244 from contentstack/feat/DX-3700
naman-contentstack Dec 2, 2025
d04c6aa
Merge pull request #2258 from contentstack/export-import/composable-s…
shafeeqd959 Dec 4, 2025
d18f9fc
Merge pull request #2242 from contentstack/feat/DX-3646
harshithad0703 Jan 2, 2026
6036068
Merge pull request #2269 from contentstack/fix/dx-3802
sunil-lakshman Dec 9, 2025
fd8b340
Merge pull request #2272 from contentstack/fix/composable-studio
shafeeqd959 Dec 11, 2025
014e9a1
update migration document
harshithad0703 Jan 2, 2026
739f76a
Merge branch 'main' into fix/v2-merge
harshithad0703 Jan 2, 2026
f57401a
refactor: remove redundant comments in getLoggerInstance method
harshithad0703 Jan 2, 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
25 changes: 25 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,31 @@ csdx cm:stacks:migration -k b*******9ca0 --file-path "../contentstack-migration/

**Migration Action:** use the import/export commands instead.

### 5. 🔌 HTML RTE to JSON RTE Migration (Separate Plugin)

**What Changed:**
- HTML RTE to JSON RTE migration has been extracted into a separate plugin
- Now requires separate installation as `@contentstack/cli-cm-migrate-rte`

**Installation:**

```bash
npm install -g @contentstack/cli-cm-migrate-rte
```

**Commands:**

```bash
# Migrate HTML RTE to JSON RTE
csdx cm:entries:migrate-html-rte --config-path path/to/config.json

# Or using alias
csdx cm:migrate-rte --config-path path/to/config.json
```

**Migration Action:**
- Install `@contentstack/cli-cm-migrate-rte` separately if you use RTE migration

## Troubleshooting

### Common Issues
Expand Down
833 changes: 424 additions & 409 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
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