diff --git a/.nvmrc b/.nvmrc index c29440a..bce43c2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v7.4.0 +v12.13.0 diff --git a/.travis.yml b/.travis.yml index a2ae1bc..ae559ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,12 @@ language: node_js -node_js: 7.4 cache: yarn: true directories: - node_modules env: - - TEST_TARGET=lint - - TEST_TARGET=unit - - TEST_TARGET=e2e - - TEST_TARGET=cov + - TEST_CMD=lint + - TEST_CMD=test + - TEST_CMD=test-e2e + - TEST_CMD=coverage script: - - make test + - yarn run ${TEST_CMD} diff --git a/LICENSE b/LICENSE index 7bda4b7..9b4201a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Paw Inc. +Copyright (c) 2015-2018 Paw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Makefile b/Makefile index 0f15fd8..e4db441 100644 --- a/Makefile +++ b/Makefile @@ -25,13 +25,5 @@ transfer: clean importers generators pack: clean importers generators sh "$(SCRIPTS)/pack.sh" $(BASE) $(TARGET) -lint: - sh "$(SCRIPTS)/lint.sh" $(BASE) - -test: - sh "$(SCRIPTS)/test.sh" $(BASE) $(TEST_TARGET) - -validate: lint test - watch: sh "$(SCRIPTS)/watch.sh" $(BASE) $(COMMAND) diff --git a/README.md b/README.md index 4e0b4f2..ed7146c 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,26 @@ [![Build Status](https://travis-ci.org/luckymarmot/API-Flow.svg?branch=master)](https://travis-ci.org/luckymarmot/API-Flow) -# API-Flow +# API Flow -A flow written in ES6 using Immutable to convert between API description formats (Swagger, etc.) and other programs such as cURL command lines. +A library written in ES6 using [Immutable.js](https://facebook.github.io/immutable-js/docs/) to convert between API description formats (including Swagger and RAML) and applications (including Paw and Postman). ## What formats are supported and what will be in the future + We currently support: -- `Swagger v2.0 (in/out)` -- `RAML v1.0 (in/out)` -- `Postman Collection v2.0 (in/out)` -- `Paw v3.1 (in/out)` + +- Swagger v2.0 (in/out) +- RAML v1.0 (in/out) +- Postman Collection v2.0 (in/out) +- Paw v3.1 (in/out) We intend to support: -- `Swagger v3.0` -- `RAML v0.8` -- `Postman Collection v1.0` -- `Postman Dump v1.0` -- `Insomnia v3.0` -- `Api-Blueprint` + +- Swagger v3.0 +- RAML v0.8 +- Postman Collection v1.0 +- Postman Dump v1.0 +- Insomnia v3.0 +- API Blueprint - and many more. ## Installation @@ -28,32 +31,50 @@ just run ```sh git clone https://github.com/luckymarmot/API-Flow.git cd API-Flow -make install +yarn install # or npm install ``` This will install the node module dependencies ## Building the different libraries -### node, web, and webworker -run the following command to build API-Flow for the different environments that you need +### As a Library + +Run the following command to build API Flow for the different environments that you need: ```sh -# use TARGET="node" if you only want the node library -make runners TARGET="node web webworker" +# use TARGET=node if you only want the node library +TARGET="node web webworker" make runners ``` -### Paw +Possible target environments are: + +| Target | Description | +| ----------- | ---------------------------------- | +| `node` | Node library | +| `web` | Web browser library | +| `webworker` | Web library to run in a web worker | + +### A a Paw Extension You can use the following command to add the different extensions to Paw ```sh -# use TARGET="swagger" if you only want the swagger bindings -make transfer TARGET="swagger raml1 postman2" +# use TARGET=swagger if you only want the swagger bindings +TARGET="swagger raml1 postman2" make transfer ``` -## Using the npm module -### as a standard library +Possible targets are: + +| Target | Description | +| ----------- | ------------------------------------------------ | +| `swagger` | Swagger 2.0 importer and generator | +| `raml1` | RAML 1.0 importer and generator | +| `postman2` | Postman Collection 2.0 importer and generator | + +## Using the node module + +### As a library ```js const ApiFlow = require('api-flow'); // if from npm @@ -80,27 +101,58 @@ promise.then((data) => { }) ``` -### Using as a CLI (coming soon) +### As a CLI +```sh +./node_modules/.bin/babel-node ./bin/api-flow.js some_swagger.json --from swagger --to raml > converted.yml +``` + +## User Interface + +API Flow is one of the main components of [Console.REST](https://github.com/luckymarmot/console-rest). If you're an API user, you can easily use [https://console.rest/](https://console.rest/) to convert API description files. If you're an API provider, you can add a button to your API docs to let your users open and play with your API in client apps including Paw or Postman. + +## Formats + +| Name | Format | Version | +| ---- | ------ | ------- | +| [Swagger/OAS](https://swagger.io/) | `swagger` | `v2.0` | +| [RAML](https://raml.org/) | `raml` | `v1.0` | +| [Paw](https://paw.cloud) | `paw` | `v3.0` | +| [Postman Collection](https://github.com/postmanlabs/postman-collection) | `postman-collection` | `v2.0` | +| Internal API Flow Data | `internal` | `v1.0` | + +## Development + +### Testing + ```sh -node ./bin/api-flow.js some_swagger.json -f swagger -t raml > converted.yml +yarn run test # unit tests +yarn run test-e2e # integration (end-to-end) tests ``` -### User Interface +### Linting -API-Flow is one of the main components of [Console.REST](https://github.com/luckymarmot/console-rest). If you're an API user, you can easily use [https://console.rest/](https://console.rest/) to convert API description files. If you're an API provider, you can add a button to your API docs to let your users open and play with your API in client apps including Paw or Postman. +```sh +yarn run lint +``` + +### Code coverage + +```sh +yarn run coverage +``` ## Contributing PRs are welcomed! -Our sole requirement is that organizations that want to extend API-Flow to support their format write both a parser and a serializer, and not simply a serializer. +Our sole requirement is that organizations that want to extend API Flow to support their format write both a parser and a serializer, and not simply a serializer. ## Documentation -You can find more information about the internal structure of API-Flow in [src](https://github.com/luckymarmot/API-Flow/tree/develop/src). We've also created a set of templates to help speed up the extension process: [loader](https://github.com/luckymarmot/API-Flow/tree/develop/src/loaders/template/v1.0), [parser](https://github.com/luckymarmot/API-Flow/tree/develop/src/parsers/template/v1.0/), and [environment](https://github.com/luckymarmot/API-Flow/tree/develop/src/environments/template) +You can find more information about the internal structure of API Flow in [src](https://github.com/luckymarmot/API-Flow/tree/develop/src). We've also created a set of templates to help speed up the extension process: [loader](https://github.com/luckymarmot/API-Flow/tree/develop/src/loaders/template/v1.0), [parser](https://github.com/luckymarmot/API-Flow/tree/develop/src/parsers/template/v1.0/), and [environment](https://github.com/luckymarmot/API-Flow/tree/develop/src/environments/template) ## License This repository is released under the [MIT License](LICENSE). Feel free to fork, and modify! -Copyright © 2016 Paw Inc. +Copyright © 2015-2018 Paw. ## Contributors diff --git a/bin/api-flow.js b/bin/api-flow.js index 4c074b0..ec15a9f 100755 --- a/bin/api-flow.js +++ b/bin/api-flow.js @@ -1,10 +1,91 @@ -#! /usr/bin/env node -/* eslint-disable */ -var FlowCLI = require('../dist/node/api-flow.js').default; - -var cli = new FlowCLI(process.argv); -var parser = cli._createParser(); -cli.processArguments(parser); -cli.run().then((data) => { - console.log(data) -}); +import { resolve } from 'path' +import { existsSync } from 'fs' +import minimist from 'minimist' +import chalk from 'chalk' +import ApiFlow from '../src/api-flow' + +// chalk +const success = chalk.bold.green +const error = chalk.bold.red + +// formats +const formats = { + swagger: { + format: 'swagger', + version: 'v2.0', + }, + raml: { + format: 'raml', + version: 'v1.0', + }, + paw: { + format: 'paw', + version: 'v3.0', + }, + postman: { + format: 'postman-collection', + version: 'v2.0', + }, + internal: { + format: 'internal', + version: 'v1.0', + }, +} + +// parse CLI +const args = minimist(process.argv.slice(2), { + string: [ 'from', 'to' ], + default: { + to: 'internal' + }, +}) +const params = args['_'] + +if (params.length > 1) { + console.log(error('too many parameters')) + process.exit(1) +} +if (params.length === 0) { + console.log(error('missing input parameter')) + process.exit(1) +} +if (!formats[args.from]) { + console.log(error(`unknown format ${args.from}`)) + process.exit(1) +} +if (!formats[args.to]) { + console.log(error(`unknown format ${args.to}`)) + process.exit(1) +} + +const input = resolve(params[0]) + +if (!existsSync(input)) { + console.log(error(`file does not exist: ${input}`)) + process.exit(1) +} + +const options = ApiFlow.setup({ + options: { + source: { + format: formats[args.from].format, + version: formats[args.from].version, + }, + target: { + format: formats[args.to].format, + version: formats[args.to].version, + }, + } +}) + +ApiFlow + .transform({ + options, + uri: `file:///${input}`, + }) + .then(serialized => { + console.log(serialized) + }) + .catch(e => { + console.error('got err:\n', e.stack) + }) diff --git a/configs/node/api-flow-config.js b/configs/node/api-flow-config.js index f6cad0f..0408666 100644 --- a/configs/node/api-flow-config.js +++ b/configs/node/api-flow-config.js @@ -6,7 +6,7 @@ import PostmanV2Loader from '../../src/loaders/postman/v2.0/Loader' import SwaggerV2Parser from '../../src/parsers/swagger/v2.0/Parser' import RAMLV1Parser from '../../src/parsers/raml/v1.0/Parser' -import PostmanV2Parser from '../../src/loaders/postman/v2.0/Parser' +import PostmanV2Parser from '../../src/parsers/postman/v2.0/Parser' import SwaggerV2Serializer from '../../src/serializers/swagger/v2.0/Serializer' import RAMLV1Serializer from '../../src/serializers/raml/v1.0/Serializer' diff --git a/package.json b/package.json index 2070b35..67f926c 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,12 @@ "babel-plugin-transform-flow-strip-types": "6.3.15", "babel-polyfill": "6.3.14", "babel-runtime": "6.3.19", + "chalk": "^2.4.1", "drafter.js": "^2.6.6", "immutable": "^3.8.1", "js-yaml": "3.5.5", "json-schema-faker": "^0.3.7", + "minimist": "^1.2.0", "raml-1-parser": "^1.1.14", "raml-parser": "0.8.16", "request": "^2.72.0", @@ -70,13 +72,15 @@ "extends": "./linting/prod.yaml" }, "scripts": { - "compile": "./node_modules/babel-cli/bin/babel.js --ignore='**/__tests__/' -d lib/ src/", + "flow": "babel-node ./bin/api-flow.js", + "compile": "babel --ignore='**/__tests__/' -d lib/ src/", "compile-node": "TARGET=node ./node_modules/webpack/bin/webpack.js", "compile-web": "TARGET=web ./node_modules/webpack/bin/webpack.js", "compile-worker": "TARGET=webworker ./node_modules/webpack/bin/webpack.js", "test": "$npm_package_options_mocha \"src/**/__tests__/*.spec.js\"", - "validate": "node validate.js", - "lint": "./node_modules/eslint/bin/eslint.js -c linting/prod.yaml src/" + "test-e2e": "$npm_package_options_mocha --require \"testing/test-require-patch.js\" \"testing/**/*.spec.js\"", + "lint": "eslint -c linting/prod.yaml src/", + "coverage": "NODE_ENV=test node \"./node_modules/.bin/nyc\" \"./node_modules/.bin/mocha\" \"src/**/__tests__/*.spec.js\"" }, "options": { "mocha": "./node_modules/.bin/mocha --require mocha --compilers js:babel-register --reporter spec" diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100644 index e25edba..0000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh -base=$1 -node "$base/node_modules/eslint/bin/eslint.js" -c "$base/linting/prod.yaml" "$base/src/" diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100644 index e9fabf8..0000000 --- a/scripts/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -base=$1 -if [ "$2" = "lint" ] -then - node "$base/node_modules/eslint/bin/eslint.js" -c "$base/linting/prod.yaml" "$base/src/" -elif [ "$2" = "unit" ] -then - node "$base/node_modules/.bin/mocha" --require mocha --compilers js:babel-register --reporter spec "$base/src/**/__tests__/*.spec.js" -elif [ "$2" = "e2e" ] -then - node "$base/node_modules/.bin/mocha" --require mocha --compilers js:babel-register --require "$base/testing/test-require-patch.js" --reporter spec "$base/testing/**/*.spec.js" -elif [ "$2" = "cov" ] -then - NODE_ENV=test node "$base/node_modules/.bin/nyc" "$base/node_modules/.bin/mocha" "$base/src/**/__tests__/*.spec.js" -else - echo "invalid TEST_TARGET: $2" -fi diff --git a/src/parsers/paw/Parser.js b/src/parsers/paw/Parser.js index 321e05b..1eee349 100644 --- a/src/parsers/paw/Parser.js +++ b/src/parsers/paw/Parser.js @@ -590,7 +590,7 @@ methods.convertBaseComponentsIntoVariable = (context, defaultHost, baseComponent return new Variable({ name: defaultHost, - values: OrderedMap(variableValues) + values: new OrderedMap(variableValues) }) } @@ -668,7 +668,7 @@ methods.convertComponentEntryIntoStringOrParam = (request, { key, value }) => { } const { value: param } = methods.convertRequestVariableDVIntoParameter( - request, 'path', List(), value, key) + request, 'path', new List(), value, key) return param } @@ -758,7 +758,7 @@ methods.createPathEndpoint = (sequence) => { in: 'path', type: 'string', superType: 'sequence', - value: List(sequence) + value: new List(sequence) }) }) @@ -811,7 +811,7 @@ methods.extractResourceFromPawRequest = (context, reference, { request, pathComp value: new Resource({ name: (request.parent || {}).name || null, description: (request.parent || {}).description || null, - endpoints: OrderedMap(endpoints), + endpoints: new OrderedMap(endpoints), path: path, methods: methods.extractRequestMapFromPawRequest(context, request, endpoints) }) @@ -868,7 +868,7 @@ methods.createDefaultHostEndpoint = (defaultHost, hostEntries) => { url: defaultUrl }) - const protocols = Set(hostEntries.map(({ urlObject }) => urlObject.protocol)).toList() + const protocols = new Set(hostEntries.map(({ urlObject }) => urlObject.protocol)).toList() endpointValue = endpointValue.set('protocol', protocols) return { key: defaultHost, value: endpointValue } @@ -962,7 +962,7 @@ methods.isRequestVariableDynamicValue = (component) => { * @returns {boolean} true if it only holds a request variable, false otherwise */ methods.isRequestVariableDS = (ds) => { - return ds.length === 1 && methods.isRequestVariableDynamicValue(ds.components[0]) + return ds && ds.length === 1 && methods.isRequestVariableDynamicValue(ds.components[0]) } /** @@ -1004,7 +1004,7 @@ methods.convertRequestVariableDVIntoParameter = ( description: description || null, required: required || false, default: defaultValue, - constraints: List([ + constraints: new List([ new Constraint.JSONSchema(schema) ]), applicableContexts: contexts @@ -1040,7 +1040,7 @@ methods.convertRequestVariableDSIntoParameter = ( * @returns {Parameter} the corresponding parameter */ methods.convertStandardDSIntoParameter = (location, contexts, paramDS, paramName) => { - const value = paramDS.getEvaluatedString() + const value = paramDS ? paramDS.getEvaluatedString() : '' const param = new Parameter({ in: location, key: paramName, @@ -1100,13 +1100,13 @@ methods.isRequestBodyMultipart = (request) => { * @returns {Array} the corresponding applicable contexts */ methods.getContentTypeContexts = (contentType) => { - return List([ + return new List([ new Parameter({ key: 'Content-Type', name: 'Content-Type', in: 'headers', type: 'string', - constraints: List([ + constraints: new List([ new Constraint.Enum([ contentType ]) ]) }) @@ -1144,7 +1144,7 @@ methods.createDefaultArrayParameter = (contexts, name) => { * @returns {OrderedMap} the corresponding OrderedMap of body Parameters */ methods.createUrlEncodedOrMultipartBodyParameters = (dsMap, contexts, request) => { - const bodyParams = OrderedMap(dsMap) + const bodyParams = new OrderedMap(dsMap) .map((value, name) => { if (Array.isArray(value)) { return methods.createDefaultArrayParameter(contexts, name) @@ -1156,7 +1156,7 @@ methods.createUrlEncodedOrMultipartBodyParameters = (dsMap, contexts, request) = }) .reduce(convertEntryListInMap, {}) - return OrderedMap(bodyParams) + return new OrderedMap(bodyParams) } /** @@ -1192,15 +1192,15 @@ methods.createStandardBodyParameters = (request) => { const bodyDS = request.getBody(true) if (!bodyDS) { - return OrderedMap() + return new OrderedMap() } const { key, value } = methods.convertParameterDynamicStringIntoParameter( - request, 'body', List(), bodyDS, null + request, 'body', new List(), bodyDS, null ) const body = { [key]: value } - return OrderedMap(body) + return new OrderedMap(body) } /** @@ -1227,15 +1227,16 @@ methods.getBodyParameters = (request) => { */ methods.getHeadersMapFromRequest = (request) => { const extractHeaders = currify( - methods.convertParameterDynamicStringIntoParameter, request, 'headers', List() + // request, location, contexts, paramDS, paramName + methods.convertParameterDynamicStringIntoParameter, request, 'headers', new List() ) - const headers = OrderedMap(request.getHeaders(true)) + const headers = new OrderedMap(request.getHeaders(true)) .filter((_, name) => name !== 'Authorization') .map(extractHeaders) .reduce(convertEntryListInMap, {}) - return OrderedMap(headers) + return new OrderedMap(headers) } /** @@ -1245,14 +1246,14 @@ methods.getHeadersMapFromRequest = (request) => { */ methods.getQueriesMapFromRequest = (request) => { const extractUrlParams = currify( - methods.convertParameterDynamicStringIntoParameter, request, 'queries', List() + methods.convertParameterDynamicStringIntoParameter, request, 'queries', new List() ) - const queryParams = OrderedMap(request.getUrlParameters(true)) + const queryParams = new OrderedMap(request.getUrlParameters(true)) .map(extractUrlParams) .reduce(convertEntryListInMap, {}) - return OrderedMap(queryParams) + return new OrderedMap(queryParams) } /** @@ -1387,12 +1388,12 @@ methods.getAuthNameFromAuth = (context, request, authDS) => { methods.extractAuthReferencesFromRequest = (context, request) => { const auth = request.getHeaderByName('Authorization', true) if (!auth) { - return List() + return new List() } const authName = methods.getAuthNameFromAuth(context, request, auth) - return List([ + return new List([ new Reference({ type: 'auth', uuid: authName @@ -1414,7 +1415,7 @@ methods.extractRequestMapFromPawRequest = (context, pawReq, endpoints) => { const request = new Request({ id: pawReq.id, - endpoints: OrderedMap(endpoints), + endpoints: new OrderedMap(endpoints), name: pawReq.name, description: pawReq.description, method, @@ -1422,7 +1423,7 @@ methods.extractRequestMapFromPawRequest = (context, pawReq, endpoints) => { auths }) - return OrderedMap({ [method]: request }) + return new OrderedMap({ [method]: request }) } /** @@ -1595,7 +1596,7 @@ methods.extractResources = (context, reqs) => { { resources: [], variables: [], endpoints: [] } ) - const resourceMap = OrderedMap(resources.reduce(convertEntryListInMap, {})) + const resourceMap = new OrderedMap(resources.reduce(convertEntryListInMap, {})) return { resources: resourceMap, variables, endpoints } } @@ -1614,9 +1615,9 @@ methods.extractStore = (context, variables, endpoints, reqs) => { .map((request) => methods.extractAuthsFromRequest(context, request)) .filter(({ key }) => !!key) - const variableStore = OrderedMap(variables.reduce(convertEntryListInMap, {})) - const endpointStore = OrderedMap(endpoints.reduce(convertEntryListInMap, {})) - const authStore = OrderedMap(auths.reduce(convertEntryListInMap, {})) + const variableStore = new OrderedMap(variables.reduce(convertEntryListInMap, {})) + const endpointStore = new OrderedMap(endpoints.reduce(convertEntryListInMap, {})) + const authStore = new OrderedMap(auths.reduce(convertEntryListInMap, {})) const store = new Store({ variable: variableStore, diff --git a/src/parsers/paw/__tests__/Parser.spec.js b/src/parsers/paw/__tests__/Parser.spec.js index a56da6f..8d9ce99 100644 --- a/src/parsers/paw/__tests__/Parser.spec.js +++ b/src/parsers/paw/__tests__/Parser.spec.js @@ -1513,6 +1513,17 @@ describe('parsers/paw/Parser.js', () => { request, location, contexts, input, paramName) expect(actual).toEqual(expected) }) + + it('should work with undefined value', () => { + const request = {} + const location = 123 + const contexts = 234 + const paramName = 'someParam' + const actual = __internals__.convertParameterDynamicStringIntoParameter( + request, location, contexts, request.__undefined__, paramName) + expect(actual.key).toEqual(paramName) + expect(actual.value).toBeAn(Parameter) + }) /* eslint-enable max-statements */ }) diff --git a/src/serializers/paw/Serializer.js b/src/serializers/paw/Serializer.js index 52032d2..810df1e 100644 --- a/src/serializers/paw/Serializer.js +++ b/src/serializers/paw/Serializer.js @@ -208,6 +208,9 @@ methods.addConstraintsToDomain = (domain, environment, api) => { * @returns {string} the trimmed string */ methods.removeDotsFromProtocol = (protocol) => { + if (!protocol) { + return null + } if (protocol[protocol.length - 1] === ':') { return protocol.slice(0, protocol.length - 1) } diff --git a/src/serializers/paw/__tests__/Serializer.spec.js b/src/serializers/paw/__tests__/Serializer.spec.js index 2f12552..eb5cacf 100644 --- a/src/serializers/paw/__tests__/Serializer.spec.js +++ b/src/serializers/paw/__tests__/Serializer.spec.js @@ -364,6 +364,13 @@ describe('serializers/paw/Serializer.js', () => { expect(actual).toEqual(expected) }) + + it('should work with undefined', () => { + const expected = null + const actual = __internals__.removeDotsFromProtocol(null) + + expect(actual).toEqual(expected) + }) }) describe('@convertProtocolIntoRecordParameter', () => { diff --git a/src/serializers/raml/v1.0/Serializer.js b/src/serializers/raml/v1.0/Serializer.js index abe9acd..f3fe9d5 100644 --- a/src/serializers/raml/v1.0/Serializer.js +++ b/src/serializers/raml/v1.0/Serializer.js @@ -872,6 +872,7 @@ methods.extractProtocolsFromApi = (api) => { } const validProtocols = protocols + .filter(protocol => (!!protocol)) .filter(protocol => protocol.match(/https?:?/i)) .map(protocol => protocol.match(/(https?)/i)[1].toUpperCase()) .toJS() diff --git a/src/serializers/raml/v1.0/__tests__/Serializer.spec.js b/src/serializers/raml/v1.0/__tests__/Serializer.spec.js index bf7b649..4da88f1 100644 --- a/src/serializers/raml/v1.0/__tests__/Serializer.spec.js +++ b/src/serializers/raml/v1.0/__tests__/Serializer.spec.js @@ -1643,6 +1643,22 @@ describe('serializers/raml/v1.0/Serializer.js', () => { const actual = inputs.map(input => __internals__.extractProtocolsFromApi(input)) expect(actual).toEqual(expected) }) + + it('should work with undefined', () => { + const input = new Api({ + store: new Store({ + endpoint: OrderedMap({ + b: new URL({ + url: 'https://echo.paw.cloud/base', + variableDelimiters: List([ '{', '}' ]) + }).set('protocol', List([ null ])) + }) + }) + }) + const expected = null + const actual = __internals__.extractProtocolsFromApi(input) + expect(actual).toEqual(expected) + }) }) describe('@extractMediaTypeUUIDfromApi', () => { diff --git a/src/serializers/swagger/v2.0/Serializer.js b/src/serializers/swagger/v2.0/Serializer.js index 77b27e9..a96823d 100644 --- a/src/serializers/swagger/v2.0/Serializer.js +++ b/src/serializers/swagger/v2.0/Serializer.js @@ -343,6 +343,9 @@ methods.getMostCommonEndpoint = (api) => { * @return {string} the normalized protocol */ methods.removeDotsFromProtocol = (protocol) => { + if (!protocol) { + return null + } if (protocol[protocol.length - 1] === ':') { return protocol.slice(0, protocol.length - 1) } diff --git a/src/serializers/swagger/v2.0/__tests__/Serializer.spec.js b/src/serializers/swagger/v2.0/__tests__/Serializer.spec.js index e5765f9..bd7a349 100644 --- a/src/serializers/swagger/v2.0/__tests__/Serializer.spec.js +++ b/src/serializers/swagger/v2.0/__tests__/Serializer.spec.js @@ -665,6 +665,13 @@ describe('serializers/swagger/v2.0/Serializer.js', () => { expect(actual).toEqual(expected) }) + + it('should work with undefined', () => { + const expected = null + const actual = __internals__.removeDotsFromProtocol(null) + + expect(actual).toEqual(expected) + }) }) describe('@getSchemesFromEndpoint', () => { diff --git a/yarn.lock b/yarn.lock index 8955699..3c8a94c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,7 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + abbrev@1: version "1.1.0" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" @@ -16,6 +18,10 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -24,10 +30,6 @@ acorn@^4.0.3, acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -67,6 +69,12 @@ ansi-styles@^2.1.0, ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -231,30 +239,6 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0, babel-code-frame@^6.3.13: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.23.0, babel-core@^6.3.13, babel-core@^6.6.5: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" - dependencies: - babel-code-frame "^6.22.0" - babel-generator "^6.23.0" - babel-helpers "^6.23.0" - babel-messages "^6.23.0" - babel-register "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" - babylon "^6.11.0" - convert-source-map "^1.1.0" - debug "^2.1.1" - json5 "^0.5.0" - lodash "^4.2.0" - minimatch "^3.0.2" - path-is-absolute "^1.0.0" - private "^0.1.6" - slash "^1.0.0" - source-map "^0.5.0" - babel-core@6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.4.0.tgz#648dfae98d2bc92ed57d4050d462a82c8c218474" @@ -281,6 +265,30 @@ babel-core@6.4.0: slash "^1.0.0" source-map "^0.5.0" +babel-core@^6.23.0, babel-core@^6.3.13, babel-core@^6.6.5: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.23.0" + babel-helpers "^6.23.0" + babel-messages "^6.23.0" + babel-register "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.11.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + babel-eslint@^6.1.2: version "6.1.2" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-6.1.2.tgz#5293419fe3672d66598d327da9694567ba6a5f2f" @@ -559,16 +567,6 @@ babel-plugin-transform-decorators-legacy@1.3.2: babel-runtime "^6.2.0" babel-template "^6.3.0" -babel-plugin-transform-decorators@^6.22.0, babel-plugin-transform-decorators@^6.3.13: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" - dependencies: - babel-helper-explode-class "^6.22.0" - babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-types "^6.22.0" - babel-plugin-transform-decorators@6.3.13: version "6.3.13" resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.3.13.tgz#e1f168f10271eb0cb5c13da661f06d4cc48aec60" @@ -580,6 +578,16 @@ babel-plugin-transform-decorators@6.3.13: babel-template "^6.3.13" babel-types "^6.3.13" +babel-plugin-transform-decorators@^6.22.0, babel-plugin-transform-decorators@^6.3.13: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" + dependencies: + babel-helper-explode-class "^6.22.0" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-types "^6.22.0" + babel-plugin-transform-do-expressions@^6.3.13: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" @@ -779,14 +787,6 @@ babel-plugin-transform-strict-mode@^6.22.0: babel-runtime "^6.22.0" babel-types "^6.22.0" -babel-polyfill@^6.6.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" - dependencies: - babel-runtime "^6.22.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - babel-polyfill@6.3.14: version "6.3.14" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.3.14.tgz#1872298ede5b9f7b02ec7807bd3dd301c189c440" @@ -795,6 +795,14 @@ babel-polyfill@6.3.14: babel-runtime "^5.0.0" core-js "^1.0.1" +babel-polyfill@^6.6.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" + dependencies: + babel-runtime "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + babel-preset-es2015@6.3.13: version "6.3.13" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.3.13.tgz#97dce7ef292e18cb9b2b7545d80c593c28d9517f" @@ -828,6 +836,16 @@ babel-preset-stage-0@6.3.13: babel-plugin-transform-function-bind "^6.3.13" babel-preset-stage-1 "^6.3.13" +babel-preset-stage-1@6.3.13: + version "6.3.13" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.3.13.tgz#e41df518d20c8dcc2cb7dae5a6c078c8c7dcfbd9" + dependencies: + babel-plugin-transform-class-constructor-call "^6.3.13" + babel-plugin-transform-class-properties "^6.3.13" + babel-plugin-transform-decorators "^6.3.13" + babel-plugin-transform-export-extensions "^6.3.13" + babel-preset-stage-2 "^6.3.13" + babel-preset-stage-1@^6.3.13: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.22.0.tgz#7da05bffea6ad5a10aef93e320cfc6dd465dbc1a" @@ -836,15 +854,13 @@ babel-preset-stage-1@^6.3.13: babel-plugin-transform-export-extensions "^6.22.0" babel-preset-stage-2 "^6.22.0" -babel-preset-stage-1@6.3.13: +babel-preset-stage-2@6.3.13: version "6.3.13" - resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.3.13.tgz#e41df518d20c8dcc2cb7dae5a6c078c8c7dcfbd9" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.3.13.tgz#3657db63d11806456f64d4d0b0e9a817837aeea7" dependencies: - babel-plugin-transform-class-constructor-call "^6.3.13" - babel-plugin-transform-class-properties "^6.3.13" - babel-plugin-transform-decorators "^6.3.13" - babel-plugin-transform-export-extensions "^6.3.13" - babel-preset-stage-2 "^6.3.13" + babel-plugin-syntax-trailing-function-commas "^6.3.13" + babel-plugin-transform-object-rest-spread "^6.3.13" + babel-preset-stage-3 "^6.3.13" babel-preset-stage-2@^6.22.0, babel-preset-stage-2@^6.3.13: version "6.22.0" @@ -855,13 +871,12 @@ babel-preset-stage-2@^6.22.0, babel-preset-stage-2@^6.3.13: babel-plugin-transform-decorators "^6.22.0" babel-preset-stage-3 "^6.22.0" -babel-preset-stage-2@6.3.13: +babel-preset-stage-3@6.3.13: version "6.3.13" - resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.3.13.tgz#3657db63d11806456f64d4d0b0e9a817837aeea7" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.3.13.tgz#5f0aa70e3d4176ffab08b1d5cc1cb8210777ba3e" dependencies: - babel-plugin-syntax-trailing-function-commas "^6.3.13" - babel-plugin-transform-object-rest-spread "^6.3.13" - babel-preset-stage-3 "^6.3.13" + babel-plugin-transform-async-to-generator "^6.3.13" + babel-plugin-transform-exponentiation-operator "^6.3.13" babel-preset-stage-3@^6.22.0, babel-preset-stage-3@^6.3.13: version "6.22.0" @@ -873,17 +888,22 @@ babel-preset-stage-3@^6.22.0, babel-preset-stage-3@^6.3.13: babel-plugin-transform-exponentiation-operator "^6.22.0" babel-plugin-transform-object-rest-spread "^6.22.0" -babel-preset-stage-3@6.3.13: - version "6.3.13" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.3.13.tgz#5f0aa70e3d4176ffab08b1d5cc1cb8210777ba3e" - dependencies: - babel-plugin-transform-async-to-generator "^6.3.13" - babel-plugin-transform-exponentiation-operator "^6.3.13" - babel-regenerator-runtime@^6.3.13: version "6.5.0" resolved "https://registry.yarnpkg.com/babel-regenerator-runtime/-/babel-regenerator-runtime-6.5.0.tgz#0e41cd1c9f80442466f015c749fff8ba98f8e110" +babel-register@6.3.13: + version "6.3.13" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.3.13.tgz#858b77cd7765aa5a82a33c26bbb1bc7b264713bf" + dependencies: + babel-core "^6.3.13" + babel-runtime "^5.0.0" + core-js "^1.0.0" + home-or-tmp "^1.0.0" + lodash "^3.10.0" + path-exists "^1.0.0" + source-map-support "^0.2.10" + babel-register@^6.23.0, babel-register@^6.3.13, babel-register@^6.6.5: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.23.0.tgz#c9aa3d4cca94b51da34826c4a0f9e08145d74ff3" @@ -896,17 +916,11 @@ babel-register@^6.23.0, babel-register@^6.3.13, babel-register@^6.6.5: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-register@6.3.13: - version "6.3.13" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.3.13.tgz#858b77cd7765aa5a82a33c26bbb1bc7b264713bf" +babel-runtime@6.3.19: + version "6.3.19" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.3.19.tgz#f2db696c3c8c379881e2a53665e02187074dc681" dependencies: - babel-core "^6.3.13" - babel-runtime "^5.0.0" - core-js "^1.0.0" - home-or-tmp "^1.0.0" - lodash "^3.10.0" - path-exists "^1.0.0" - source-map-support "^0.2.10" + core-js "^1.2.0" babel-runtime@^5.0.0: version "5.8.38" @@ -921,12 +935,6 @@ babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-runtime@6.3.19: - version "6.3.19" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.3.19.tgz#f2db696c3c8c379881e2a53665e02187074dc681" - dependencies: - core-js "^1.2.0" - babel-template@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" @@ -1221,26 +1229,34 @@ chai@3.4.1: deep-eql "^0.1.3" type-detect "^1.0.0" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" +chalk@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.1.tgz#509afb67066e7499f7eb3535c77445772ae2d019" dependencies: - ansi-styles "^2.2.1" + ansi-styles "^2.1.0" escape-string-regexp "^1.0.2" has-ansi "^2.0.0" strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.1.tgz#509afb67066e7499f7eb3535c77445772ae2d019" +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: - ansi-styles "^2.1.0" + ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" has-ansi "^2.0.0" strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chance@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/chance/-/chance-1.0.6.tgz#4734f62d02b738cdc2882d8b5d41f89af49e7bfd" @@ -1325,6 +1341,16 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +color-convert@^1.9.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + dependencies: + color-name "1.1.1" + +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + colors@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -1335,12 +1361,6 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.7.1, commander@^2.8.1, commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - commander@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06" @@ -1349,6 +1369,12 @@ commander@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" +commander@^2.7.1, commander@^2.8.1, commander@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -1510,18 +1536,18 @@ debug-log@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" +debug@2.2.0, debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + debug@^2.1.1, debug@^2.2.0: version "2.6.1" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" dependencies: ms "0.7.2" -debug@~2.2.0, debug@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1592,14 +1618,14 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" - diff@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" +diff@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -1744,7 +1770,7 @@ es6-set@~0.1.3: es6-symbol "3" event-emitter "~0.3.4" -es6-symbol@~3.1, es6-symbol@~3.1.0, es6-symbol@3: +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" dependencies: @@ -1760,14 +1786,14 @@ es6-weak-map@^2.0.1: es6-iterator "2" es6-symbol "3" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - escape-string-regexp@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -2122,6 +2148,14 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467" + dependencies: + graceful-fs "~2.0.0" + inherits "2" + minimatch "~0.2.11" + glob@^5.0.5: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -2143,14 +2177,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467" - dependencies: - graceful-fs "~2.0.0" - inherits "2" - minimatch "~0.2.11" - globals@^9.0.0, globals@^9.14.0: version "9.16.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" @@ -2225,6 +2251,10 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2349,7 +2379,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@2: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2586,14 +2616,14 @@ is-windows@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.0.tgz#c61d61020c3ebe99261b781bd3d1622395f547f8" -isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2675,13 +2705,6 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.5.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" - dependencies: - argparse "^1.0.7" - esprima "^3.1.1" - js-yaml@3.5.5: version "3.5.5" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.5.5.tgz#0377c38017cabc7322b0d1fbcd25a491641f2fbe" @@ -2689,6 +2712,13 @@ js-yaml@3.5.5: argparse "^1.0.2" esprima "^2.6.0" +js-yaml@^3.5.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -2701,7 +2731,7 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" -json-loader@^0.5.4, json-loader@0.5.4: +json-loader@0.5.4, json-loader@^0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de" @@ -2888,6 +2918,10 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" @@ -2895,10 +2929,6 @@ lru-cache@^4.0.1: pseudomap "^1.0.1" yallist "^2.0.0" -lru-cache@2: - version "2.7.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" - lrucache@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/lrucache/-/lrucache-0.2.0.tgz#1edc7dc845454a5c7b6bd0cf302f13b85b3f06da" @@ -3009,15 +3039,15 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@^2.0.3: - version "2.0.10" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" -minimatch@^3.0.0, minimatch@^3.0.2, "minimatch@2 || 3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +minimatch@^2.0.3: + version "2.0.10" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" dependencies: brace-expansion "^1.0.0" @@ -3028,6 +3058,10 @@ minimatch@~0.2.11: lru-cache "2" sigmund "~1.0.0" +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3036,16 +3070,6 @@ minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - mkdirp@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" @@ -3056,6 +3080,12 @@ mkdirp@0.5.0: dependencies: minimist "0.0.8" +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + mocha@2.3.4: version "2.3.4" resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.3.4.tgz#8629a6fb044f2d225aa4b81a2ae2d001699eb266" @@ -3486,22 +3516,22 @@ public-encrypt@^4.0.0: parse-asn1 "^5.0.0" randombytes "^2.0.1" -punycode@^1.2.4, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" -q@^1.0.0: +punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" q@0.9.7: version "0.9.7" resolved "https://registry.yarnpkg.com/q/-/q-0.9.7.tgz#4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75" +q@^1.0.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + qs@^6.1.0, qs@~6.3.0: version "6.3.1" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.1.tgz#918c0b3bcd36679772baf135b1acb4c1651ed79d" @@ -3832,7 +3862,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.4, rimraf@2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.4: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -3876,14 +3906,14 @@ semver-truncate@^1.0.0: dependencies: semver "^5.3.0" +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + semver@^4.0.3: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" -semver@^5.3.0, semver@~5.3.0, "semver@2 || 3 || 4 || 5": - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - sentence-case@^1.1.1, sentence-case@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-1.1.3.tgz#8034aafc2145772d3abe1509aa42c9e1042dc139" @@ -3978,6 +4008,12 @@ source-map-support@^0.4.2: dependencies: source-map "^0.5.3" +source-map@0.1.32: + version "0.1.32" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.32.tgz#c8b6c167797ba4740a8ea33252162ff08591b266" + dependencies: + amdefine ">=0.0.4" + source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" @@ -3988,12 +4024,6 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, sour version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -source-map@0.1.32: - version "0.1.32" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.32.tgz#c8b6c167797ba4740a8ea33252162ff08591b266" - dependencies: - amdefine ">=0.0.4" - spawn-wrap@1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40" @@ -4063,10 +4093,6 @@ stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" -string_decoder@^0.10.25, string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -4082,6 +4108,10 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" +string_decoder@^0.10.25, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -4112,6 +4142,10 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +supports-color@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -4122,9 +4156,11 @@ supports-color@^3.1.0, supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -supports-color@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" +supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" swagger-schema-official@2.0.0-bab6bed: version "2.0.0-bab6bed" @@ -4284,14 +4320,14 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" - type-detect@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" +type-detect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" + typedarray@^0.0.6, typedarray@~0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -4376,7 +4412,7 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -util@^0.10.3, util@0.10.3: +util@0.10.3, util@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" dependencies: @@ -4475,6 +4511,10 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" @@ -4483,10 +4523,6 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4627,4 +4663,3 @@ z-schema@^3.16.1: validator "^6.0.0" optionalDependencies: commander "^2.7.1" -