UNPKG

@aws-amplify/cli-internal

Version:
70 lines 3.61 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.run = void 0; const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core"); const amplify_prompts_1 = require("@aws-amplify/amplify-prompts"); const amplify_category_api_1 = require("@aws-amplify/amplify-category-api"); const run = async (context) => { var _a, _b, _c, _d, _e, _f, _g, _h, _j; const cliParams = { cliCommand: (_a = context === null || context === void 0 ? void 0 : context.input) === null || _a === void 0 ? void 0 : _a.command, cliSubcommands: (_b = context === null || context === void 0 ? void 0 : context.input) === null || _b === void 0 ? void 0 : _b.subCommands, cliOptions: (_d = (_c = context === null || context === void 0 ? void 0 : context.input) === null || _c === void 0 ? void 0 : _c.options) !== null && _d !== void 0 ? _d : {}, }; const view = new amplify_cli_core_1.ViewResourceTableParams(cliParams); if ((_f = (_e = context === null || context === void 0 ? void 0 : context.input) === null || _e === void 0 ? void 0 : _e.subCommands) === null || _f === void 0 ? void 0 : _f.includes('help')) { amplify_prompts_1.printer.info(view.getStyledHelp()); } else if (((_g = cliParams.cliOptions) === null || _g === void 0 ? void 0 : _g.api) && ((_h = cliParams.cliOptions) === null || _h === void 0 ? void 0 : _h.acm)) { try { if (typeof ((_j = cliParams.cliOptions) === null || _j === void 0 ? void 0 : _j.acm) !== 'string') { amplify_prompts_1.printer.error('You must pass in a model name for the acm option.'); return; } await (0, amplify_category_api_1.showApiAuthAcm)(context, cliParams.cliOptions.acm); } catch (err) { amplify_prompts_1.printer.error(err === null || err === void 0 ? void 0 : err.message); } } else { await context.amplify.showStatusTable(view); await context.amplify.showHelpfulProviderLinks(context); await showAmplifyConsoleHostingStatus(context); } }; exports.run = run; const showAmplifyConsoleHostingStatus = async (context) => { var _a; const pluginInfo = context.amplify.getCategoryPluginInfo(context, 'hosting', 'amplifyhosting'); if (pluginInfo && pluginInfo.packageLocation) { const { status } = await (_a = pluginInfo.packageLocation, Promise.resolve().then(() => __importStar(require(_a)))); if (status) { await status(context); } } }; //# sourceMappingURL=status.js.map