({ auth, options, versionFramework })
| 16 | import path from 'path' |
| 17 | |
| 18 | const commandSupport = async ({ auth, options, versionFramework }) => { |
| 19 | const { mode, help } = extractParams({ options }) |
| 20 | const logger = log.get('core:support') |
| 21 | const progressMain = progress.get('main') |
| 22 | |
| 23 | /** |
| 24 | * Show the help message if the user is using the default support or help command |
| 25 | */ |
| 26 | logger.logoSupport() |
| 27 | logger.aside( |
| 28 | 'This generates a report from your last Serverless Framework command (including any errors) to use for Github Issues, debugging w/ AI, or creating a support ticket w/ Serverless Inc.', |
| 29 | ) |
| 30 | |
| 31 | /** |
| 32 | * If the user is using the "summary" mode, show this message at the beginning |
| 33 | */ |
| 34 | if (mode === 'summary' || mode === 'ai' || mode === 'github') { |
| 35 | logger.notice('Summary Report -----------------') |
| 36 | } else if (mode === 'all') { |
| 37 | logger.notice('Comprehensive Report -----------------') |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Render help and return if the user has specified the `--help` flag. |
| 42 | */ |
| 43 | if (help) { |
| 44 | logger.aside('Usage') |
| 45 | logger.notice('serverless support <options>') |
| 46 | logger.notice('sls support <options>') |
| 47 | logger.aside('Options') |
| 48 | logger.notice( |
| 49 | '--help / -h Get help for the Serverless support command', |
| 50 | ) |
| 51 | logger.notice( |
| 52 | '--summary Produce a summary report for sharing with your team, etc.', |
| 53 | ) |
| 54 | logger.notice( |
| 55 | '--ai Produce a summary report optimized for pasting into AI (e.g. ChatGPT)', |
| 56 | ) |
| 57 | logger.notice( |
| 58 | '--github Produce a summary report optimized for pasting into a Github Issue', |
| 59 | ) |
| 60 | logger.notice( |
| 61 | '--all Produce a comprehensive report with all available data.', |
| 62 | ) |
| 63 | logger.notice( |
| 64 | '--support Get help from the Serverless support team.', |
| 65 | ) |
| 66 | return |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Open the ~/.serverless/meta.json file which contains the Meta object from |
| 71 | * the last deployment. |
| 72 | */ |
| 73 | let metaObjects = [] |
| 74 | let metaFound = false |
| 75 | const dotServerlessPath = getDotServerlessLocalPath() |
no test coverage detected
searching dependent graphs…