{"_id":"@antklim/api-to-cloud","_rev":"3-8d6ff7610207f60de6f65b537f062fec","name":"@antklim/api-to-cloud","description":"This tool injects cloud specific integration points to API definition in Swagger.","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@antklim/api-to-cloud","version":"0.1.0","description":"This tool injects cloud specific integration points to API definition in Swagger.","main":"index.js","bin":{"api-to-cloud":"cli.js"},"scripts":{"lint":"eslint .","test":"cross-env NODE_ENV=test nyc ava","coverage:report:html":"nyc report --reporter=html","coverage:report:codacy":"cat ./coverage/lcov.info | ./node_modules/.bin/codacy-coverage","watch:test":"cross-env NODE_ENV=test ava --watch"},"author":{"name":"Anton Klimenko","email":"antklim@gmail.com"},"license":"MIT","engines":{"node":">=7.6.0"},"dependencies":{"clone":"^2.1.1","commander":"^2.11.0","js-yaml":"^3.10.0","object-path":"^0.11.4","pkginfo":"^0.4.1"},"devDependencies":{"ava":"^0.23.0","codacy-coverage":"^2.0.3","cross-env":"^5.1.0","eslint":"^4.9.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-ava":"^4.2.2","eslint-plugin-import":"^2.7.0","nyc":"^11.2.1","testdouble":"^3.2.6"},"ava":{"files":["test/**.test.js"],"source":["lib/*.js"],"failFast":true},"nyc":{"check-coverage":true,"per-file":true,"lines":80,"statements":80,"functions":80,"branches":80,"watermarks":{"lines":[80,95],"functions":[80,95],"branches":[80,95],"statements":[80,95]},"reporter":["lcovonly","text"]},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/antklim/api-to-cloud.git"},"keywords":["api","swagger","cloud","integration"],"bugs":{"url":"https://github.com/antklim/api-to-cloud/issues"},"homepage":"https://github.com/antklim/api-to-cloud#readme","gitHead":"194a92e14cf759344f6898aa46157ee8304c8637","_id":"@antklim/api-to-cloud@0.1.0","_npmVersion":"5.5.1","_nodeVersion":"7.9.0","_npmUser":{"name":"antklim","email":"antklim@gmail.com"},"dist":{"integrity":"sha512-bVVLqq/DoCkxM/zuIoBPg3TXhzBhMg2lzMjJfErwhaTHwtPzW7NIr/vsJmB0Gfev7UReuFW3v4ES2bnYEvO0cA==","shasum":"cde6399a28992ca89bbc06d35bee30c9aedb20c3","tarball":"https://registry.npmjs.org/@antklim/api-to-cloud/-/api-to-cloud-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFelFXh7DL+kPz8s+FRg/T2ghBkbQZ3D8xWklfjFNDyJAiAavkTqaPR8dFGcsyORv3fYcTzN+zJyVl3xI09F1RoN7g=="}]},"maintainers":[{"name":"antklim","email":"antklim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-to-cloud-0.1.0.tgz_1509617812376_0.6962013221345842"}},"0.1.1":{"name":"@antklim/api-to-cloud","version":"0.1.1","description":"This tool injects cloud specific integration points to API definition in Swagger.","main":"index.js","bin":{"api-to-cloud":"cli.js"},"scripts":{"lint":"eslint .","test":"cross-env NODE_ENV=test nyc --all ava","coverage:report:html":"nyc report --reporter=html","coverage:report:codacy":"cat ./coverage/lcov.info | ./node_modules/.bin/codacy-coverage","watch:test":"cross-env NODE_ENV=test ava --watch"},"author":{"name":"Anton Klimenko","email":"antklim@gmail.com"},"license":"MIT","engines":{"node":">=7.6.0"},"dependencies":{"clone":"^2.1.1","commander":"^2.11.0","js-yaml":"^3.10.0","object-path":"^0.11.4","pkginfo":"^0.4.1"},"devDependencies":{"ava":"^0.23.0","codacy-coverage":"^2.0.3","command-line-test":"^1.0.10","cross-env":"^5.1.0","eslint":"^4.9.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-ava":"^4.2.2","eslint-plugin-import":"^2.7.0","nyc":"^11.2.1","testdouble":"^3.2.6"},"ava":{"files":["test/**.test.js"],"source":["lib/*.js"],"failFast":true},"nyc":{"check-coverage":true,"per-file":true,"lines":80,"statements":80,"functions":80,"branches":80,"watermarks":{"lines":[80,95],"functions":[80,95],"branches":[80,95],"statements":[80,95]},"exclude":["index.js","cli.js","test/**","coverage/**"],"reporter":["lcovonly","text"]},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/antklim/api-to-cloud.git"},"keywords":["api","swagger","cloud","integration"],"bugs":{"url":"https://github.com/antklim/api-to-cloud/issues"},"homepage":"https://github.com/antklim/api-to-cloud#readme","gitHead":"d4ae2b52024f445c0d2e76087196c1b95d6207aa","_id":"@antklim/api-to-cloud@0.1.1","_npmVersion":"5.5.1","_nodeVersion":"7.9.0","_npmUser":{"name":"antklim","email":"antklim@gmail.com"},"dist":{"integrity":"sha512-NKK0wpJj8XKSd3qPwDV0Aq1I8lG/w9hc/8iBKJjld6wUQrzfFWV0S0osYi2m1tIpoOHdtSuX0KQAnKuhOIIDUg==","shasum":"ca373dea4e7bdb67c99ef1ada1b984c2cc7d5196","tarball":"https://registry.npmjs.org/@antklim/api-to-cloud/-/api-to-cloud-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0T+I2PekXQnP28WFzmuztibyX+lIBxtFz6fmzjhb/qAIgNqFdfqOjjLfo/+H6usioEHmR/c75kFmCpQtLqtx1SdM="}]},"maintainers":[{"name":"antklim","email":"antklim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-to-cloud-0.1.1.tgz_1509688302250_0.8690082393586636"}},"0.2.0":{"name":"@antklim/api-to-cloud","version":"0.2.0","description":"This tool injects cloud specific integration points to API definition in Swagger.","main":"index.js","bin":{"api-to-cloud":"cli.js"},"scripts":{"lint":"eslint .","test":"cross-env NODE_ENV=test nyc --all ava","coverage:report:html":"nyc report --reporter=html","coverage:report:codacy":"cat ./coverage/lcov.info | ./node_modules/.bin/codacy-coverage","watch:test":"cross-env NODE_ENV=test ava --watch"},"author":{"name":"Anton Klimenko","email":"antklim@gmail.com"},"license":"MIT","engines":{"node":">=7.6.0"},"dependencies":{"clone":"^2.1.1","commander":"^2.11.0","js-yaml":"^3.10.0","object-path":"^0.11.4","pkginfo":"^0.4.1","traverse":"^0.6.6"},"devDependencies":{"ava":"^0.23.0","codacy-coverage":"^2.0.3","command-line-test":"^1.0.10","cross-env":"^5.1.0","eslint":"^4.9.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-ava":"^4.2.2","eslint-plugin-import":"^2.7.0","nyc":"^11.2.1","testdouble":"^3.2.6"},"ava":{"files":["test/**.test.js"],"source":["lib/*.js"],"failFast":true},"nyc":{"check-coverage":true,"per-file":true,"lines":80,"statements":80,"functions":80,"branches":80,"watermarks":{"lines":[80,95],"functions":[80,95],"branches":[80,95],"statements":[80,95]},"exclude":["index.js","cli.js","test/**","coverage/**"],"reporter":["lcovonly","text"]},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/antklim/api-to-cloud.git"},"keywords":["api","swagger","cloud","integration"],"bugs":{"url":"https://github.com/antklim/api-to-cloud/issues"},"homepage":"https://github.com/antklim/api-to-cloud#readme","gitHead":"d5a9151d8ef7e064c11e388aec982227c4848982","_id":"@antklim/api-to-cloud@0.2.0","_npmVersion":"5.5.1","_nodeVersion":"7.9.0","_npmUser":{"name":"antklim","email":"antklim@gmail.com"},"dist":{"integrity":"sha512-VzRLd91PLkYgGOgv4gI1eB5z0wI0LK/0flZ7NqtnD9VXv8s5MeQvimKsdXdMCoLpz9gCU7LI4tpPMLvZrLZo1w==","shasum":"efc71168aca95dd3c302296bc9387c009155fa91","tarball":"https://registry.npmjs.org/@antklim/api-to-cloud/-/api-to-cloud-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjguVjUT03ljbGzeJub3RboaMrTp0ZrmVsfbHZdoKSXgIhAJXoBiMwNCXW99W3pkXGy/NyQC66kY9MTngNUBsosKZs"}]},"maintainers":[{"name":"antklim","email":"antklim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-to-cloud-0.2.0.tgz_1509788499145_0.6481664325110614"}}},"readme":"# API to Cloud\n[![Build Status](https://travis-ci.org/antklim/api-to-cloud.svg?branch=master)](https://travis-ci.org/antklim/api-to-cloud)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/51abe20086ae49f6948eb99d3e574d0b)](https://www.codacy.com/app/anton-klimenko/api-to-cloud?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=antklim/api-to-cloud&amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/51abe20086ae49f6948eb99d3e574d0b)](https://www.codacy.com/app/anton-klimenko/api-to-cloud?utm_source=github.com&utm_medium=referral&utm_content=antklim/api-to-cloud&utm_campaign=Badge_Coverage)\n\nThis tool injects cloud specific integration points to API definition in Swagger.\n\n## Installing\nThis is a NodeJS module available through the [npm](https://www.npmjs.com/) register.\n\nInstallation is done using the `npm install` command:\n\n```\n$ npm install @antklim/api-to-cloud\n```\n\n## Usage\nAfter installation `api-to-cloud` CLI will be available in `node_modules/.bin`.\n```\nUsage: api-to-cloud [options]\n\n\n  Options:\n\n    -V, --version             output the version number\n    -a, --api <path>          API definition file path\n    -i, --integration <path>  API integration file path\n    -o, --output <path>       path to output extended API file\n    -c, --cloud [cloud]       cloud provider [AWS], default 'AWS'\n    -f, --format [format]     output file format [yaml|yml|json], default 'yaml'\n    -h, --help                output usage information\n```\n\nRun the following command to produce swagger file with AWS specific integration points:\n```\n$ node_modules/.bin/api-to-cloud --api test-api.yaml \\\n                                 --integration test-integration.yaml \\\n                                 --output aws.yaml\n```\n\n## Programmatic API\n### parser\nThe `parser` module provides utilities for parsing of API and integration point descriptions. Currently supported two formats: YAML and JSON. It can be accessed using:\n```javascript\nconst {parser} = require('@antklim/api-to-cloud')\n```\n\n### parser.parse(file)\n* `file` String - path to the file to parse\n* Returns: Promise - resolves with the file data parsed into object\n\nExample:\n```javascript\nparser.parse('input.yaml')\n  .then(data => console.log(JSON.stringify(data, null, 2)))\n  .catch(err => console.error(err))\n```\n\n### parser.for(format)\n* `format` String - file format to parse\n* Returns: Function - parser function or null\n\n### encoder\nThe `encoder` module provides utilities for formatting and storing of API definition. Currently supported two formats: YAML and JSON. It can be accessed using:\n```javascript\nconst {encoder} = require('@antklim/api-to-cloud')\n```\n\n### encoder.save(data, file, format)\n* `data` Object - data to write to file\n* `file` String - path to file to write\n* `format` String - format to save payload in\n* Returns: Promise - resolves when payload written into the file\n\nExample:\n```javascript\nencoder.save({'foo': 'bar'}, 'example.yaml', 'yaml')\n  .then(() => console.log('Payload written into \\'example.yaml\\''))\n  .catch(err => console.error(err))\n```\n\n### encoder.for(format)\n* `format` String - file format to encode to\n* Returns: Function - encoder function or null\n\n### integrator\nThe `integrator` module provides utilities for merging pure API description in `Swagger` format with cloud specific integration points. It can be accessed using:\n```javascript\nconst {integrator} = require('@antklim/api-to-cloud')\n```\n\n### integrator.extend(api, integrationPaths, cloud)\n* `api` Object - Swagger API definition\n* `integrationPaths` Object - cloud integration points to add to API\n* `cloud` String - target cloud provider, [AWS]\n* Returns: Object - extended Swagger API (API + integrations)\n\nFormat of the integration points object:\n```yaml\npath:\n  method:\n    integrationPoint: ...\n```\n\nExample of integration object:\n```yaml\n/pets:\n  get:\n    x-amazon-apigateway-integration:\n      responses:\n        default:\n          statusCode: \"200\"\n      requestTemplates:\n        application/json: \"{\\\"statusCode\\\": 200}\"\n      passthroughBehavior: \"when_no_match\"\n      type: \"mock\"\n  post:\n    x-amazon-apigateway-integration:\n      responses:\n        default:\n          statusCode: \"200\"\n      requestTemplates:\n        application/json: \"{\\\"statusCode\\\": 200}\"\n      passthroughBehavior: \"when_no_match\"\n      type: \"mock\"\n/pets/{petId}:\n  get:\n    x-amazon-apigateway-integration:\n      responses:\n        default:\n          statusCode: \"200\"\n      requestTemplates:\n        application/json: \"{\\\"statusCode\\\": 200}\"\n      passthroughBehavior: \"when_no_match\"\n      type: \"mock\"\n```\n\n### integrator.cleanApi(api, removables)\n* `api` Object - Swagger API definition\n* `removables` Array - the list of paths to remove from the API description\n* Returns: Object - API definition cleaned from removables\n\n## Built With\n* [js-yaml](https://github.com/nodeca/js-yaml) - YAML parser/encoder for JavaScript\n* [ava](https://github.com/avajs/ava) - Futuristic test runner\n* [ESLint](https://eslint.org/) - JavaScript linting utility\n* [testdouble](https://github.com/testdouble/testdouble.js) - JavaScript test mocking library\n\n## Authors\n* [Anton Klimenko](https://github.com/antklim)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/antklim/api-to-cloud/blob/master/LICENSE) file for details\n","maintainers":[{"name":"antklim","email":"antklim@gmail.com"}],"time":{"modified":"2022-04-04T14:22:27.796Z","created":"2017-11-02T10:16:52.499Z","0.1.0":"2017-11-02T10:16:52.499Z","0.1.1":"2017-11-03T05:51:42.513Z","0.2.0":"2017-11-04T09:41:39.315Z"},"homepage":"https://github.com/antklim/api-to-cloud#readme","keywords":["api","swagger","cloud","integration"],"repository":{"type":"git","url":"git+https://github.com/antklim/api-to-cloud.git"},"author":{"name":"Anton Klimenko","email":"antklim@gmail.com"},"bugs":{"url":"https://github.com/antklim/api-to-cloud/issues"},"license":"MIT","readmeFilename":"README.md"}