Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4,069 changes: 2,309 additions & 1,760 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/commands/content-type/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class AuditCommand extends Command {
const output = buildOutput(audit.logs, users)
this.printOutput(output, 'Audit Logs', flags['content-type'], stack.name)
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
4 changes: 2 additions & 2 deletions src/commands/content-type/compare-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class CompareRemoteCommand extends Command {
const remoteStackApi = flags['remote-stack'] as string

if (originStackApi === remoteStackApi) {
this.warn('Comparing the same Stack does not produce useful results.')
this.warn('You cannot compare the same stack. Please choose different stacks to compare.')
}

const spinner = cliux.loaderV2(Command.RequestDataMessage)
Expand All @@ -75,7 +75,7 @@ export default class CompareRemoteCommand extends Command {
const output = await buildOutput(flags['content-type'], originContentTypeResp, remoteContentTypeResp)
this.printOutput(output, 'changes', flags['content-type'], `${originStackResp.name} <-> ${remoteStackResp.name}`)
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
4 changes: 2 additions & 2 deletions src/commands/content-type/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ export default class CompareCommand extends Command {
this.printOutput(output, 'changes', flags['content-type'], stack.name)

if (flags.left && flags.left === flags.right) {
this.warn('Comparing the same version does not produce useful results.')
this.warn('You cannot compare the same version. Please select different versions to compare.')
}
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
2 changes: 1 addition & 1 deletion src/commands/content-type/details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class DetailsCommand extends Command {
})
this.printOutput(output, 'details', flags['content-type'], stack.name)
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
2 changes: 1 addition & 1 deletion src/commands/content-type/diagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class DiagramCommand extends Command {
const output = await createDiagram(diagramOptions)
this.log(`Created Graph: ${output.outputPath}`)
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
2 changes: 1 addition & 1 deletion src/commands/content-type/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class ListCommand extends Command {
const output = buildOutput(contentTypes, flags.order)
this.printOutput(output, 'Content Types', null, stack.name)
} catch (error: any) {
this.error(error, { exit: 1, suggestions: error.suggestions })
this.error(error?.message || 'An error occurred.', { exit: 1, suggestions: error.suggestions })
}
}
}
6 changes: 3 additions & 3 deletions src/core/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class ContentTypeCommand extends Command {
setup(flags: any) {
const authToken = configHandler.get('authtoken')
if (!authToken) {
this.error('You need to login, first. See: auth:login --help', {
this.error('You\'re not logged in. Run auth:login to sign in. Use auth:login --help for more details.', {
exit: 2,
suggestions: ['https://www.contentstack.com/docs/developers/cli/authentication/']
})
Expand All @@ -24,7 +24,7 @@ export default class ContentTypeCommand extends Command {
const mTokenAlias = flags['token-alias'] || flags.alias

if (!mTokenAlias && !stackAPIKey) {
cliux.print('Error: You must provide either a token alias or a Stack UID.', { color: 'red' })
cliux.print('Error: You must provide either a token alias or a stack UID.', { color: 'red' })
process.exit(1)
}

Expand All @@ -33,7 +33,7 @@ export default class ContentTypeCommand extends Command {

if (token.type !== 'management') {
cliux.print(
'Possibly using a delivery token. You may not be able to connect to your Stack. Please use a management token.',
'Connection failed. You might be using a delivery token. Use a management token to connect to your stack.',
{ color: 'yellow' }
)
}
Expand Down