UNPKG

1.91 kBJavaScriptView Raw
1const featureName = 'api';
2module.exports = {
3 name: featureName,
4 run: async (context) => {
5 if (/^win/.test(process.platform)) {
6 try {
7 const { run } = require(`./${featureName}/${context.parameters.first}`);
8 return run(context);
9 }
10 catch (e) {
11 context.print.error('Command not found');
12 }
13 }
14 const header = `amplify ${featureName} <subcommands>`;
15 const commands = [
16 {
17 name: 'add',
18 description: `Takes you through a CLI flow to add a ${featureName} resource to your local backend`,
19 },
20 {
21 name: 'push',
22 description: `Provisions ${featureName} cloud resources and its dependencies with the latest local developments`,
23 },
24 {
25 name: 'remove',
26 description: `Removes ${featureName} resource from your local backend which would be removed from the cloud on the next push command`,
27 },
28 {
29 name: 'update',
30 description: `Takes you through steps in the CLI to update an ${featureName} resource`,
31 },
32 {
33 name: 'gql-compile',
34 description: 'Compiles your GraphQL schema and generates a corresponding cloudformation template',
35 },
36 {
37 name: 'add-graphql-datasource',
38 description: 'Provisions the AppSync resources and its dependencies for the provided Aurora Serverless data source',
39 },
40 {
41 name: 'console',
42 description: 'Opens the web console for the selected api service',
43 },
44 ];
45 context.amplify.showHelp(header, commands);
46 context.print.info('');
47 },
48};
49//# sourceMappingURL=api.js.map
\No newline at end of file