Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
// 'remove' commands have no response body and thus do not need display properties.
if (NewCommandClass.actionDefinition.commandName !== 'remove') {
const defaultProperties = (resource && resource.defaultOutputProperties) || [];
cmdFlags.properties = flags.string({
// Camel-cased, CSV of the provided property list. Or just the SID.
default: defaultProperties.map(prop => camelCase(prop)).join(',') || 'sid',
description: 'The properties you would like to display (JSON output always shows all properties).'
});
}
// 'list' commands get limit flags for specifying the result set size.
if (NewCommandClass.actionDefinition.commandName === 'list') {
cmdFlags = Object.assign(cmdFlags, TwilioClientCommand.limitFlags);
}
// Class statics
NewCommandClass.id = commandId;
NewCommandClass.args = [];
NewCommandClass.flags = Object.assign(cmdFlags, TwilioApiCommand.flags);
NewCommandClass.description = getActionDescription(NewCommandClass.actionDefinition);
NewCommandClass.load = () => NewCommandClass;
return NewCommandClass;
};