JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 98
  • Score
    100M100P100Q53315F
  • License MIT

Export apigateway docs.

Package Exports

  • apigateway-export-tool

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (apigateway-export-tool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

apigateway-export-tool

Usage CLI

Usage: apigateway-export-tool [command]

Options:
  -V, --version     output the version number
  -h, --help        output usage information

Commands:
  docs [options]    Download docs file for a given restApiId.
  list [options]    List all restApis.
  stages [options]  Get stages for a given restApiId.
  sdk [options]     Download sdk for a given restApiId.
npx apigateway-export-tool list
npx apigateway-export-tool docs -h
npx apigateway-export-tool docs -i 123123 -stageName prod

Usage Nodejs

// checkout examples https://github.com/niradler/apigateway-export-tool/blob/master/test.js
const { getExportAndSave,
  getExport,
  setAwsConfig,
  getRestApis,
  getSdk,
  getSdkAndSave,
  getStages,
  importDocumentation
  } = require("apigateway-export-tool");
setAwsConfig({ region: "us-east-1" });

(async function() {
  const params = {
    exportType, // String ("oas30", "swagger")
    restApiId, // String
    stageName, // String
    parameters: {
      extensions // String ("postman", "integrations", "integrations", "authorizers")
    }
  };
  const filePath = "./";
  const apis = await getRestApis();
  const apis = await getStages(params);
  const apis = await importDocumentation(params);
  const file = await getExportAndSave(params, filePath); //save the file in path.
  const file = await getExport(params); // just returning the file.
})();

AWS credentials

if you have aws cli configure on your machine you dont need to worry about that, if not you can setup the credentials using one of this two options:

  • Loaded from the shared credentials file (~/.aws/credentials)
  • Loaded from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)