sync with upstream

This commit is contained in:
Harjeet Singh 2018-05-29 14:43:45 -07:00
commit 9e3179e2b8
90 changed files with 2523 additions and 1787 deletions

4
.gitignore vendored
View File

@ -24,7 +24,9 @@ node_modules
lib/ lib/
stats.json stats.json
cypress/ cypress/
bundles bundles/
typings/*
!typings/styled-patch.d.ts
cli/index.js cli/index.js
/benchmark/revisions /benchmark/revisions

View File

@ -1,5 +1,6 @@
* *
!bundles/* !bundles/*
!typings/*
!package.json !package.json
!README.md !README.md
!LICENSE !LICENSE

View File

@ -14,10 +14,10 @@ env:
- secure: YWBKHe3EdY3DcASsMaW3/scxba11eMRjJ8HebyKyampU9JTkyj3rFY9sfYQshusYCVa3/pt2LyYITNLDI2vYGGFYVIu9ia9kMBjt4kZ99QQxvXTftmBruF2Gcw6aqja9e5SnQrDUY+Wnc3k33SqQhhNGiyF6M1HpV0S8JJZNc3oQjZHKkZ93IwA1mU/UWL/K3wE/y5xiKz8d+DjsLrhU94G6NE2mhs0eaJW/fMLLYxn+UfDuidGaRQ4v4a2aRPecalzyLqdRFgFH2YJpBPFF3XEC23J/hm1QChI75iINChWbTrNTJqWYKKljjB7WLNtqVrm3S5qpZwl322nwBhwhPVtT4PqattMribCA8XMSL9Lk/g1hRaxH7gXgGHAfpPaMhyPcKBzQ5HJxYI+UXoKPZqfyxkZbnVY/3s7P0pZ8Nql+UouvFURZkbWK3WLWCISCVVVdyhnB3wn+jKLWdsYCtu9ibvYDDCDT64T08b4Gf30j3BfaAlgO4uU30Bg/IulrFnOC99qhslQRODxY6HGizr6ggtS1C8TFZ2/+3CXuHZJ3LDdj9WoHyBgYtMtnQf+qBVy6z6nvyx/QsdnQ/8A1twObuZoFCLPpOPoKmAbjApC8XS0TgIyqf5KGcq33Jxg+bIakNAGJW33n4jtZW7+Z+p8SVGLQmRC/558Tn402a58= - secure: YWBKHe3EdY3DcASsMaW3/scxba11eMRjJ8HebyKyampU9JTkyj3rFY9sfYQshusYCVa3/pt2LyYITNLDI2vYGGFYVIu9ia9kMBjt4kZ99QQxvXTftmBruF2Gcw6aqja9e5SnQrDUY+Wnc3k33SqQhhNGiyF6M1HpV0S8JJZNc3oQjZHKkZ93IwA1mU/UWL/K3wE/y5xiKz8d+DjsLrhU94G6NE2mhs0eaJW/fMLLYxn+UfDuidGaRQ4v4a2aRPecalzyLqdRFgFH2YJpBPFF3XEC23J/hm1QChI75iINChWbTrNTJqWYKKljjB7WLNtqVrm3S5qpZwl322nwBhwhPVtT4PqattMribCA8XMSL9Lk/g1hRaxH7gXgGHAfpPaMhyPcKBzQ5HJxYI+UXoKPZqfyxkZbnVY/3s7P0pZ8Nql+UouvFURZkbWK3WLWCISCVVVdyhnB3wn+jKLWdsYCtu9ibvYDDCDT64T08b4Gf30j3BfaAlgO4uU30Bg/IulrFnOC99qhslQRODxY6HGizr6ggtS1C8TFZ2/+3CXuHZJ3LDdj9WoHyBgYtMtnQf+qBVy6z6nvyx/QsdnQ/8A1twObuZoFCLPpOPoKmAbjApC8XS0TgIyqf5KGcq33Jxg+bIakNAGJW33n4jtZW7+Z+p8SVGLQmRC/558Tn402a58=
addons: addons:
chrome: stable chrome: stable
before_script: npm run bundle && npm run compile:cli before_script: npm run bundle
script: npm test && npm run e2e-ci script: npm test && npm run e2e-ci
after_script: cat ./coverage/lcov.info | coveralls after_script: cat ./coverage/lcov.info | coveralls
before_deploy: npm run compile:cli before_deploy: npm run compile:cli && npm run declarations
deploy: deploy:
- provider: npm - provider: npm
skip_cleanup: true skip_cleanup: true
@ -34,3 +34,5 @@ deploy:
- provider: script - provider: script
skip_cleanup: true skip_cleanup: true
script: yarn deploy:demo script: yarn deploy:demo
on:
tags: true

View File

@ -1,3 +1,76 @@
<a name="2.0.0-alpha.22"></a>
# [2.0.0-alpha.22](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.21...v2.0.0-alpha.22) (2018-05-29)
### Bug Fixes
* **cli:** create directories when a path is specified in the --output option ([#513](https://github.com/Rebilly/ReDoc/issues/513)) ([ac7372b](https://github.com/Rebilly/ReDoc/commit/ac7372b)), closes [#512](https://github.com/Rebilly/ReDoc/issues/512)
* **cli:** return 1 as exit code if an error happens in the cli ([#516](https://github.com/Rebilly/ReDoc/issues/516)) ([720c304](https://github.com/Rebilly/ReDoc/commit/720c304))
* fix font-weight inconsistency ([6ea2b7b](https://github.com/Rebilly/ReDoc/commit/6ea2b7b)), closes [#506](https://github.com/Rebilly/ReDoc/issues/506)
* HEAD http verb support in menu badges ([2eb1952](https://github.com/Rebilly/ReDoc/commit/2eb1952)), closes [#493](https://github.com/Rebilly/ReDoc/issues/493)
* more descriptive message for wrong discriminator use ([3c6de2c](https://github.com/Rebilly/ReDoc/commit/3c6de2c)), closes [#505](https://github.com/Rebilly/ReDoc/issues/505)
### Features
* add new experimental option unstable_ignoreMimeParameters ([d162bab](https://github.com/Rebilly/ReDoc/commit/d162bab))
* support x-discriminator for OpenAPI 2 ([aaff311](https://github.com/Rebilly/ReDoc/commit/aaff311)), closes [#496](https://github.com/Rebilly/ReDoc/issues/496)
<a name="2.0.0-alpha.21"></a>
# [2.0.0-alpha.21](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2018-05-28)
### Bug Fixes
* add tslib dependency ([8e1a5cb](https://github.com/Rebilly/ReDoc/commit/8e1a5cb))
* **cli:** escape \u2029 \u2028 characters ([5018473](https://github.com/Rebilly/ReDoc/commit/5018473)), closes [#475](https://github.com/Rebilly/ReDoc/issues/475)
* reduce search index size ([a1fa4b4](https://github.com/Rebilly/ReDoc/commit/a1fa4b4))
* replace "oops" with field name 🙈 ([6b1e8e7](https://github.com/Rebilly/ReDoc/commit/6b1e8e7))
* specify caption-side ([64801b0](https://github.com/Rebilly/ReDoc/commit/64801b0)), closes [#509](https://github.com/Rebilly/ReDoc/issues/509)
### Features
* export TypeScript typings ([9115be8](https://github.com/Rebilly/ReDoc/commit/9115be8))
* new theme colors: code and codeBg ([f8b793d](https://github.com/Rebilly/ReDoc/commit/f8b793d))
* new theme option: nestingSpacing ([782ef77](https://github.com/Rebilly/ReDoc/commit/782ef77))
<a name="2.0.0-alpha.20"></a>
# [2.0.0-alpha.20](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2018-05-14)
### Bug Fixes
* fix worker is not defined in lib bundle ([6a5513e](https://github.com/Rebilly/ReDoc/commit/6a5513e))
<a name="2.0.0-alpha.19"></a>
# [2.0.0-alpha.19](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2018-05-14)
### Bug Fixes
* change look of additionalProperties ([126c6a6](https://github.com/Rebilly/ReDoc/commit/126c6a6))
* disable chrome tap-highlight on mobile ([09cbe88](https://github.com/Rebilly/ReDoc/commit/09cbe88))
* fix [@observer](https://github.com/observer) on PureComponent warning ([afb11d6](https://github.com/Rebilly/ReDoc/commit/afb11d6))
* fix build caused by new babel decorators syntax, fixes [#487](https://github.com/Rebilly/ReDoc/issues/487) ([01f575c](https://github.com/Rebilly/ReDoc/commit/01f575c))
* fix prism lang dependencies, fixes [#467](https://github.com/Rebilly/ReDoc/issues/467) ([42cf18e](https://github.com/Rebilly/ReDoc/commit/42cf18e))
* fix spelling in error message ([#455](https://github.com/Rebilly/ReDoc/issues/455)) ([64119c4](https://github.com/Rebilly/ReDoc/commit/64119c4))
* limit height of discriminator dropdown, fixes [#484](https://github.com/Rebilly/ReDoc/issues/484) ([6d1a9e5](https://github.com/Rebilly/ReDoc/commit/6d1a9e5))
* path parameters are not correctly override, fixes [#481](https://github.com/Rebilly/ReDoc/issues/481) ([2cf4c3c](https://github.com/Rebilly/ReDoc/commit/2cf4c3c))
### Features
* display scope description as markdown, fixes [#466](https://github.com/Rebilly/ReDoc/issues/466) ([0d6deff](https://github.com/Rebilly/ReDoc/commit/0d6deff))
<a name="2.0.0-alpha.18"></a> <a name="2.0.0-alpha.18"></a>
# [2.0.0-alpha.18](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2018-03-23) # [2.0.0-alpha.18](https://github.com/Rebilly/ReDoc/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2018-03-23)

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2018, Rebilly, Inc. Copyright (c) 2015-present, Rebilly, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -15,7 +15,7 @@
![ReDoc demo](https://raw.githubusercontent.com/Rebilly/ReDoc/master/demo/redoc-demo.png) ![ReDoc demo](https://raw.githubusercontent.com/Rebilly/ReDoc/master/demo/redoc-demo.png)
## [Live demo (v1.x)](http://rebilly.github.io/ReDoc/) ## [Live demo](http://rebilly.github.io/ReDoc/)
[<img alt="Deploy to Github" src="http://i.imgur.com/YZmaqk3.png" height="60px">](https://github.com/Rebilly/generator-openapi-repo#generator-openapi-repo--) [<img alt="ReDoc as a service" src="http://i.imgur.com/edqdCv6.png" height="60px">](https://redoc.ly) [<img alt="Customization services" src="http://i.imgur.com/c4sUF7M.png" height="60px">](https://redoc.ly/#services) [<img alt="Deploy to Github" src="http://i.imgur.com/YZmaqk3.png" height="60px">](https://github.com/Rebilly/generator-openapi-repo#generator-openapi-repo--) [<img alt="ReDoc as a service" src="http://i.imgur.com/edqdCv6.png" height="60px">](https://redoc.ly) [<img alt="Customization services" src="http://i.imgur.com/c4sUF7M.png" height="60px">](https://redoc.ly/#services)
@ -34,7 +34,7 @@
- Integrate API Introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking. - Integrate API Introduction into side menu - ReDoc takes advantage of markdown headings from OpenAPI description field. It pulls them into side menu and also supports deep linking.
- High-level grouping in side-menu via [`x-tagGroups`](docs/redoc-vendor-extensions.md#x-tagGroups) vendor extension - High-level grouping in side-menu via [`x-tagGroups`](docs/redoc-vendor-extensions.md#x-tagGroups) vendor extension
- Simple integration with `create-react-app` ([sample](https://github.com/APIs-guru/create-react-app-redoc)) - Simple integration with `create-react-app` ([sample](https://github.com/APIs-guru/create-react-app-redoc))
- Branding/cusomizations via [`theme` option](#redoc-options-object) - Branding/customizations via [`theme` option](#redoc-options-object)
## Roadmap ## Roadmap
- [x] ~~[OpenAPI v3.0 support](https://github.com/Rebilly/ReDoc/issues/312)~~ - [x] ~~[OpenAPI v3.0 support](https://github.com/Rebilly/ReDoc/issues/312)~~
@ -103,7 +103,7 @@ Additionally, all the 1.x releases are hosted on our GitHub Pages-based **CDN**:
``` ```
That's all folks! That's all folks!
**IMPORTANT NOTE:** if you work with untrusted user spec, use `untrusted-spec` [option](#redoc-tag-attributes) to prevent XSS security risks. **IMPORTANT NOTE:** if you work with untrusted user spec, use `untrusted-spec` [option](#redoc-options-object) to prevent XSS security risks.
### 1. Install ReDoc (skip this step for CDN) ### 1. Install ReDoc (skip this step for CDN)
Install using [yarn](https://yarnpkg.com): Install using [yarn](https://yarnpkg.com):
@ -189,7 +189,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica
* [`x-ignoredHeaderParameters`](docs/redoc-vendor-extensions.md#x-ignoredHeaderParameters) - ability to specify header parameter names to ignore * [`x-ignoredHeaderParameters`](docs/redoc-vendor-extensions.md#x-ignoredHeaderParameters) - ability to specify header parameter names to ignore
### `<redoc>` options object ### `<redoc>` options object
You can use all of the following optins with standalone version on <redoc> tag by kebab-casing them, e.g. `scrollYOffset` becomes `scroll-y-offset` and `expandResponses` becomes `expand-responses`. You can use all of the following options with standalone version on <redoc> tag by kebab-casing them, e.g. `scrollYOffset` becomes `scroll-y-offset` and `expandResponses` becomes `expand-responses`.
* `untrustedSpec` - if set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS. **Disabled by default** for performance reasons. **Enable this option if you work with untrusted user data!** * `untrustedSpec` - if set, the spec is considered untrusted and all HTML/markdown is sanitized to prevent XSS. **Disabled by default** for performance reasons. **Enable this option if you work with untrusted user data!**
* `scrollYOffset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc; * `scrollYOffset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc;

View File

@ -7,7 +7,7 @@ You can use redoc cli by installing `redoc-cli` globally or using [npx](https://
## Usage ## Usage
Twe following commans are available: Two following commands are available:
- `redoc-cli serve [spec]` - starts the server with `spec` rendered with ReDoc. Supports SSR mode (`--ssr`) and can watch the spec (`--watch`) - `redoc-cli serve [spec]` - starts the server with `spec` rendered with ReDoc. Supports SSR mode (`--ssr`) and can watch the spec (`--watch`)
- `redoc-cli bundle [spec]` - bundles spec and ReDoc into **zero-dependency** HTML file. - `redoc-cli bundle [spec]` - bundles spec and ReDoc into **zero-dependency** HTML file.
@ -18,4 +18,4 @@ Some examples:
- Serve with `nativeScrollbars` option set to true: <br> `$ redoc-cli serve [spec] --options.nativeScrollbars` - Serve with `nativeScrollbars` option set to true: <br> `$ redoc-cli serve [spec] --options.nativeScrollbars`
- Bundle using custom template (check [default template](https://github.com/Rebilly/ReDoc/blob/master/cli/template.hbs) for reference): <br> `$ redoc-cli bundle [spec] -t custom.hbs` - Bundle using custom template (check [default template](https://github.com/Rebilly/ReDoc/blob/master/cli/template.hbs) for reference): <br> `$ redoc-cli bundle [spec] -t custom.hbs`
For more details run `redoc-cli --help`. For more details run `redoc-cli --help`.

View File

@ -1,20 +1,24 @@
#!/usr/bin/env node #!/usr/bin/env node
/* tslint:disable:no-implicit-dependencies */
import * as React from 'react'; import * as React from 'react';
import { renderToString } from 'react-dom/server'; import { renderToString } from 'react-dom/server';
import { ServerStyleSheet } from 'styled-components'; import { ServerStyleSheet } from 'styled-components';
import { createServer, ServerResponse, ServerRequest } from 'http';
import * as zlib from 'zlib';
import { join, dirname } from 'path';
import { compile } from 'handlebars'; import { compile } from 'handlebars';
import { createServer, ServerRequest, ServerResponse } from 'http';
import { dirname, join } from 'path';
import * as zlib from 'zlib';
// @ts-ignore // @ts-ignore
import { Redoc, loadAndBundleSpec, createStore } from 'redoc'; import { createStore, loadAndBundleSpec, Redoc } from 'redoc';
import { createReadStream, writeFileSync, ReadStream, readFileSync, watch, existsSync } from 'fs'; import { createReadStream, existsSync, readFileSync, ReadStream, watch, writeFileSync } from 'fs';
import * as mkdirp from 'mkdirp';
import * as yargs from 'yargs'; import * as YargsParser from 'yargs';
type Options = { interface Options {
ssr?: boolean; ssr?: boolean;
watch?: boolean; watch?: boolean;
cdn?: boolean; cdn?: boolean;
@ -22,51 +26,47 @@ type Options = {
title?: string; title?: string;
templateFileName?: string; templateFileName?: string;
redocOptions?: any; redocOptions?: any;
}; }
const BUNDLES_DIR = dirname(require.resolve('redoc')); const BUNDLES_DIR = dirname(require.resolve('redoc'));
yargs /* tslint:disable-next-line */
.command( YargsParser.command(
'serve [spec]', 'serve [spec]',
'start the server', 'start the server',
yargs => { yargs => {
yargs.positional('spec', { yargs.positional('spec', {
describe: 'path or URL to your spec', describe: 'path or URL to your spec',
}); });
yargs.option('s', { yargs.option('s', {
alias: 'ssr', alias: 'ssr',
describe: 'Enable server-side rendering', describe: 'Enable server-side rendering',
type: 'boolean', type: 'boolean',
}); });
yargs.option('p', { yargs.option('p', {
alias: 'port', alias: 'port',
type: 'number', type: 'number',
default: 8080, default: 8080,
}); });
yargs.option('w', { yargs.option('w', {
alias: 'watch', alias: 'watch',
type: 'boolean', type: 'boolean',
}); });
yargs.demandOption('spec'); yargs.demandOption('spec');
return yargs; return yargs;
}, },
async argv => { async argv => {
try { await serve(argv.port, argv.spec, {
await serve(argv.port, argv.spec, { ssr: argv.ssr,
ssr: argv.ssr, watch: argv.watch,
watch: argv.watch, templateFileName: argv.template,
templateFileName: argv.template, redocOptions: argv.options || {},
redocOptions: argv.options || {}, });
}); },
} catch (e) {
console.log(e.stack);
}
},
) )
.command( .command(
'bundle [spec]', 'bundle [spec]',
@ -99,20 +99,16 @@ yargs
return yargs; return yargs;
}, },
async argv => { async argv => {
try { await bundle(argv.spec, {
await bundle(argv.spec, { ssr: true,
ssr: true, output: argv.o,
output: argv.o, cdn: argv.cdn,
cdn: argv.cdn, title: argv.title,
title: argv.title, templateFileName: argv.template,
templateFileName: argv.template, redocOptions: argv.options || {},
redocOptions: argv.options || {}, });
});
} catch (e) {
console.log(e.message);
}
}, },
) )
.demandCommand() .demandCommand()
.options('t', { .options('t', {
alias: 'template', alias: 'template',
@ -121,6 +117,10 @@ yargs
}) })
.options('options', { .options('options', {
describe: 'ReDoc options, use dot notation, e.g. options.nativeScrollbars', describe: 'ReDoc options, use dot notation, e.g. options.nativeScrollbars',
})
.fail((message, error) => {
console.log(error.stack);
process.exit(1);
}).argv; }).argv;
async function serve(port: number, pathToSpec: string, options: Options = {}) { async function serve(port: number, pathToSpec: string, options: Options = {}) {
@ -183,6 +183,7 @@ async function bundle(pathToSpec, options: Options = {}) {
const spec = await loadAndBundleSpec(pathToSpec); const spec = await loadAndBundleSpec(pathToSpec);
const pageHTML = await getPageHTML(spec, pathToSpec, { ...options, ssr: true }); const pageHTML = await getPageHTML(spec, pathToSpec, { ...options, ssr: true });
mkdirp.sync(dirname(options.output!));
writeFileSync(options.output!, pageHTML); writeFileSync(options.output!, pageHTML);
const sizeInKiB = Math.ceil(Buffer.byteLength(pageHTML) / 1024); const sizeInKiB = Math.ceil(Buffer.byteLength(pageHTML) / 1024);
const time = Date.now() - start; const time = Date.now() - start;
@ -196,7 +197,9 @@ async function getPageHTML(
pathToSpec: string, pathToSpec: string,
{ ssr, cdn, title, templateFileName, redocOptions = {} }: Options, { ssr, cdn, title, templateFileName, redocOptions = {} }: Options,
) { ) {
let html, css, state; let html;
let css;
let state;
let redocStandaloneSrc; let redocStandaloneSrc;
if (ssr) { if (ssr) {
console.log('Prerendering docs'); console.log('Prerendering docs');
@ -219,22 +222,22 @@ async function getPageHTML(
redocHTML: ` redocHTML: `
<div id="redoc">${(ssr && html) || ''}</div> <div id="redoc">${(ssr && html) || ''}</div>
<script> <script>
${(ssr && `const __redoc_state = ${JSON.stringify(state)};`) || ''} ${(ssr && `const __redoc_state = ${escapeUnicode(JSON.stringify(state))};`) || ''}
var container = document.getElementById('redoc'); var container = document.getElementById('redoc');
Redoc.${ Redoc.${
ssr ssr
? 'hydrate(__redoc_state, container);' ? 'hydrate(__redoc_state, container);'
: `init("spec.json", ${JSON.stringify(redocOptions)}, container)` : `init("spec.json", ${JSON.stringify(redocOptions)}, container)`
}; };
</script>`, </script>`,
redocHead: ssr redocHead: ssr
? (cdn ? (cdn
? '<script src="https://unpkg.com/redoc@next/bundles/redoc.standalone.js"></script>' ? '<script src="https://unpkg.com/redoc@next/bundles/redoc.standalone.js"></script>'
: `<script>${redocStandaloneSrc}</script>`) + css : `<script>${redocStandaloneSrc}</script>`) + css
: '<script src="redoc.standalone.js"></script>', : '<script src="redoc.standalone.js"></script>',
title: title, title,
}); });
} }
@ -274,7 +277,7 @@ function respondWithGzip(
} }
} }
function debounce(callback: Function, time: number) { function debounce(callback: (...args) => void, time: number) {
let interval; let interval;
return (...args) => { return (...args) => {
clearTimeout(interval); clearTimeout(interval);
@ -288,3 +291,8 @@ function debounce(callback: Function, time: number) {
function isURL(str: string): boolean { function isURL(str: string): boolean {
return /^(https?:)\/\//m.test(str); return /^(https?:)\/\//m.test(str);
} }
// see http://www.thespanner.co.uk/2011/07/25/the-json-specification-is-now-wrong/
function escapeUnicode(str) {
return str.replace(/\u2028|\u2029/g, m => '\\u202' + (m === '\u2028' ? '8' : '9'));
}

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc-cli", "name": "redoc-cli",
"version": "0.3.6", "version": "0.4.0",
"description": "ReDoc's Command Line Interface", "description": "ReDoc's Command Line Interface",
"main": "index.js", "main": "index.js",
"bin": "index.js", "bin": "index.js",
@ -10,9 +10,11 @@
"dependencies": { "dependencies": {
"handlebars": "^4.0.11", "handlebars": "^4.0.11",
"isarray": "^2.0.4", "isarray": "^2.0.4",
"react": "^16.3.0-alpha.2", "mkdirp": "^0.5.1",
"react-dom": "^16.3.0-alpha.2", "react": "^16.3.2",
"redoc": "^2.0.0-alpha.18", "react-dom": "^16.3.2",
"redoc": "^2.0.0-alpha.20",
"tslib": "^1.9.0",
"yargs": "^11.0.0" "yargs": "^11.0.0"
}, },
"scripts": { "scripts": {
@ -23,6 +25,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/handlebars": "^4.0.36", "@types/handlebars": "^4.0.36",
"@types/mkdirp": "^0.5.2",
"ci-publish": "^1.3.1" "ci-publish": "^1.3.1"
} }
} }

View File

@ -3,22 +3,18 @@
"@types/handlebars@^4.0.36": "@types/handlebars@^4.0.36":
version "4.0.36" version "4.0.37"
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79" resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.37.tgz#a3bc3eba0c0f03f753cac00841a5b21e26a02c03"
"@types/jquery@*": "@types/mkdirp@^0.5.2":
version "3.3.1" version "0.5.2"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.3.1.tgz#55758d44d422756d6329cbf54e6d41931d7ba28f" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f"
"@types/mark.js@^8.11.1":
version "8.11.1"
resolved "https://registry.yarnpkg.com/@types/mark.js/-/mark.js-8.11.1.tgz#a93de600b10bf0d77b74cd0ba77045f528465f8a"
dependencies: dependencies:
"@types/jquery" "*" "@types/node" "*"
"@types/marked@^0.3.0": "@types/node@*":
version "0.3.0" version "10.1.3"
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.3.0.tgz#583c223dd33385a1dda01aaf77b0cd0411c4b524" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.3.tgz#5c16980936c4e3c83ce64e8ed71fb37bd7aea135"
agent-base@2: agent-base@2:
version "2.1.1" version "2.1.1"
@ -175,8 +171,8 @@ aws-sign2@~0.7.0:
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
aws4@^1.2.1, aws4@^1.6.0: aws4@^1.2.1, aws4@^1.6.0:
version "1.6.0" version "1.7.0"
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289"
axios@0.18.0: axios@0.18.0:
version "0.18.0" version "0.18.0"
@ -185,28 +181,13 @@ axios@0.18.0:
follow-redirects "^1.3.0" follow-redirects "^1.3.0"
is-buffer "^1.1.5" is-buffer "^1.1.5"
babel-polyfill@6.23.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-runtime@^6.22.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.11.0"
balanced-match@^1.0.0: balanced-match@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
base64-js@^1.0.2: base64-js@^1.0.2:
version "1.2.3" version "1.3.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.3.tgz#fb13668233d9614cf5fb4bce95a9ba4096cdf801" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"
bcrypt-pbkdf@^1.0.0: bcrypt-pbkdf@^1.0.0:
version "1.0.1" version "1.0.1"
@ -273,6 +254,10 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0" balanced-match "^1.0.0"
concat-map "0.0.1" concat-map "0.0.1"
buffer-from@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531"
buffer@^5.0.3: buffer@^5.0.3:
version "5.1.0" version "5.1.0"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe"
@ -330,8 +315,8 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1:
supports-color "^2.0.0" supports-color "^2.0.0"
chalk@^2.0.1: chalk@^2.0.1:
version "2.3.2" version "2.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
dependencies: dependencies:
ansi-styles "^3.2.1" ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5" escape-string-regexp "^1.0.5"
@ -354,10 +339,6 @@ changed-log@0.11.0:
ramda "0.15.1" ramda "0.15.1"
update-notifier "1.0.2" update-notifier "1.0.2"
chardet@^0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
chdir-promise@0.4.1: chdir-promise@0.4.1:
version "0.4.1" version "0.4.1"
resolved "https://registry.yarnpkg.com/chdir-promise/-/chdir-promise-0.4.1.tgz#1888bb33719699c9fb72138c07556503c4913e85" resolved "https://registry.yarnpkg.com/chdir-promise/-/chdir-promise-0.4.1.tgz#1888bb33719699c9fb72138c07556503c4913e85"
@ -402,12 +383,6 @@ cli-cursor@^1.0.1:
dependencies: dependencies:
restore-cursor "^1.0.1" restore-cursor "^1.0.1"
cli-cursor@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
dependencies:
restore-cursor "^2.0.0"
cli-table@0.3.1: cli-table@0.3.1:
version "0.3.1" version "0.3.1"
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23"
@ -419,8 +394,8 @@ cli-width@^2.0.0:
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
clipboard@^2.0.0: clipboard@^2.0.0:
version "2.0.0" version "2.0.1"
resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.0.tgz#4661dc972fb72a4c4770b8db78aa9b1caef52b50" resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.1.tgz#a12481e1c13d8a50f5f036b0560fe5d16d74e46a"
dependencies: dependencies:
good-listener "^1.2.2" good-listener "^1.2.2"
select "^1.1.2" select "^1.1.2"
@ -435,16 +410,16 @@ cliui@^2.1.0:
wordwrap "0.0.2" wordwrap "0.0.2"
cliui@^4.0.0: cliui@^4.0.0:
version "4.0.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49"
dependencies: dependencies:
string-width "^2.1.1" string-width "^2.1.1"
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
wrap-ansi "^2.0.0" wrap-ansi "^2.0.0"
clone@^1.0.2: clone@^1.0.2:
version "1.0.3" version "1.0.4"
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
co@^4.6.0: co@^4.6.0:
version "4.6.0" version "4.6.0"
@ -487,9 +462,10 @@ concat-map@0.0.1:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
concat-stream@^1.4.7, concat-stream@^1.5.2: concat-stream@^1.4.7, concat-stream@^1.5.2:
version "1.6.1" version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
dependencies: dependencies:
buffer-from "^1.0.0"
inherits "^2.0.3" inherits "^2.0.3"
readable-stream "^2.2.2" readable-stream "^2.2.2"
typedarray "^0.0.6" typedarray "^0.0.6"
@ -509,8 +485,8 @@ configstore@^2.0.0:
xdg-basedir "^2.0.0" xdg-basedir "^2.0.0"
configstore@^3.0.0: configstore@^3.0.0:
version "3.1.1" version "3.1.2"
resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.1.tgz#094ee662ab83fad9917678de114faaea8fcdca90" resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f"
dependencies: dependencies:
dot-prop "^4.1.0" dot-prop "^4.1.0"
graceful-fs "^4.1.2" graceful-fs "^4.1.2"
@ -533,10 +509,6 @@ core-js@^1.0.0:
version "1.2.7" version "1.2.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
core-js@^2.4.0:
version "2.5.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
core-util-is@1.0.2, core-util-is@~1.0.0: core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@ -583,8 +555,8 @@ css-color-keywords@^1.0.0:
resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05"
css-to-react-native@^2.0.3: css-to-react-native@^2.0.3:
version "2.1.2" version "2.2.0"
resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.1.2.tgz#c06d628467ef961c85ec358a90f3c87469fb0095" resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.2.0.tgz#d524ef7f39a2747a8914e86563669ba35b7cf2e7"
dependencies: dependencies:
css-color-keywords "^1.0.0" css-color-keywords "^1.0.0"
fbjs "^0.8.5" fbjs "^0.8.5"
@ -638,9 +610,9 @@ decko@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817" resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817"
deep-extend@~0.4.0: deep-extend@^0.5.1:
version "0.4.2" version "0.5.1"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.5.1.tgz#b894a9dd90d3023fbf1c55a394fb858eb2066f1f"
defaults@^1.0.3: defaults@^1.0.3:
version "1.0.3" version "1.0.3"
@ -677,8 +649,8 @@ dom-walk@^0.1.0:
resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
dompurify@^1.0.2: dompurify@^1.0.2:
version "1.0.3" version "1.0.4"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-1.0.3.tgz#3f2f6ecb6ecd27599a506b410ff47d6eb90fd05d" resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-1.0.4.tgz#b0655d07856c1ef76fd27ae18e8ab1174ed18819"
dot-prop@^3.0.0: dot-prop@^3.0.0:
version "3.0.0" version "3.0.0"
@ -726,12 +698,6 @@ error-ex@^1.2.0:
dependencies: dependencies:
is-arrayish "^0.2.1" is-arrayish "^0.2.1"
error-stack-parser@^1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-1.3.6.tgz#e0e73b93e417138d1cd7c0b746b1a4a14854c292"
dependencies:
stackframe "^0.3.1"
es6-promise@^3.2.1: es6-promise@^3.2.1:
version "3.3.1" version "3.3.1"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
@ -745,8 +711,8 @@ esprima@^4.0.0:
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
eventemitter3@^3.0.0: eventemitter3@^3.0.0:
version "3.0.1" version "3.1.0"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.0.1.tgz#4ce66c3fc5b5a6b9f2245e359e1938f1ab10f960" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163"
execa@0.7.0, execa@^0.7.0: execa@0.7.0, execa@^0.7.0:
version "0.7.0" version "0.7.0"
@ -776,14 +742,6 @@ external-editor@^1.0.1:
spawn-sync "^1.0.15" spawn-sync "^1.0.15"
tmp "^0.0.29" tmp "^0.0.29"
external-editor@^2.0.1:
version "2.1.0"
resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48"
dependencies:
chardet "^0.4.0"
iconv-lite "^0.4.17"
tmp "^0.0.33"
extsprintf@1.3.0: extsprintf@1.3.0:
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
@ -800,7 +758,11 @@ fast-json-stable-stringify@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
fbjs@^0.8.16, fbjs@^0.8.5, fbjs@^0.8.9: fast-levenshtein@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
fbjs@^0.8.16, fbjs@^0.8.5:
version "0.8.16" version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies: dependencies:
@ -819,12 +781,6 @@ figures@^1.3.5:
escape-string-regexp "^1.0.5" escape-string-regexp "^1.0.5"
object-assign "^4.1.0" object-assign "^4.1.0"
figures@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
dependencies:
escape-string-regexp "^1.0.5"
filled-array@^1.0.0: filled-array@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84" resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84"
@ -1091,15 +1047,11 @@ hoek@4.x.x:
version "4.2.1" version "4.2.1"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
hoist-non-react-statics@^1.2.0: hoist-non-react-statics@^2.5.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
hoist-non-react-statics@^2.3.1:
version "2.5.0" version "2.5.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
hosted-git-info@^2.1.4, hosted-git-info@^2.5.0: hosted-git-info@^2.1.4, hosted-git-info@^2.6.0:
version "2.6.0" version "2.6.0"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222"
@ -1127,13 +1079,15 @@ https-proxy-agent@^1.0.0:
debug "2" debug "2"
extend "3" extend "3"
iconv-lite@^0.4.17, iconv-lite@~0.4.13: iconv-lite@~0.4.13:
version "0.4.19" version "0.4.23"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
dependencies:
safer-buffer ">= 2.1.2 < 3"
ieee754@^1.1.4: ieee754@^1.1.4:
version "1.1.10" version "1.1.11"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.10.tgz#719a6f7b026831e64bdb838b0de1bb0029bbf716" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455"
imurmurhash@^0.1.4: imurmurhash@^0.1.4:
version "0.1.4" version "0.1.4"
@ -1173,24 +1127,6 @@ inquirer@1.1.2:
strip-ansi "^3.0.0" strip-ansi "^3.0.0"
through "^2.3.6" through "^2.3.6"
inquirer@3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347"
dependencies:
ansi-escapes "^1.1.0"
chalk "^1.0.0"
cli-cursor "^2.1.0"
cli-width "^2.0.0"
external-editor "^2.0.1"
figures "^2.0.0"
lodash "^4.3.0"
mute-stream "0.0.7"
run-async "^2.2.0"
rx "^4.1.0"
string-width "^2.0.0"
strip-ansi "^3.0.0"
through "^2.3.6"
invert-kv@^1.0.0: invert-kv@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
@ -1238,8 +1174,8 @@ is-path-cwd@^1.0.0:
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
is-path-in-cwd@^1.0.0: is-path-in-cwd@^1.0.0:
version "1.0.0" version "1.0.1"
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52"
dependencies: dependencies:
is-path-inside "^1.0.0" is-path-inside "^1.0.0"
@ -1306,7 +1242,7 @@ js-tokens@^3.0.0:
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
js-yaml@^3.10.0, js-yaml@^3.6.1: js-yaml@^3.11.0, js-yaml@^3.6.1:
version "3.11.0" version "3.11.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef"
dependencies: dependencies:
@ -1323,13 +1259,13 @@ json-pointer@^0.6.0:
dependencies: dependencies:
foreach "^2.0.4" foreach "^2.0.4"
json-schema-ref-parser@^4.0.4: json-schema-ref-parser@^5.0.0:
version "4.1.1" version "5.0.3"
resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-4.1.1.tgz#f7900efc15f693432d4ac6519dc1ee09c01aa40b" resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-5.0.3.tgz#5a8a7b4c865f840ee637c7a5f076421988eb8292"
dependencies: dependencies:
call-me-maybe "^1.0.1" call-me-maybe "^1.0.1"
debug "^3.1.0" debug "^3.1.0"
js-yaml "^3.10.0" js-yaml "^3.11.0"
ono "^4.0.3" ono "^4.0.3"
json-schema-traverse@^0.3.0: json-schema-traverse@^0.3.0:
@ -1433,9 +1369,9 @@ lodash@4.17.4:
version "4.17.4" version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
lodash@^4.3.0, lodash@^4.6.1: lodash@^4.3.0:
version "4.17.5" version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
longest@^1.0.1: longest@^1.0.1:
version "1.0.1" version "1.0.1"
@ -1448,23 +1384,23 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
js-tokens "^3.0.0" js-tokens "^3.0.0"
lowercase-keys@^1.0.0: lowercase-keys@^1.0.0:
version "1.0.0" version "1.0.1"
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
lru-cache@^4.0.1: lru-cache@^4.0.1:
version "4.1.2" version "4.1.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
dependencies: dependencies:
pseudomap "^1.0.2" pseudomap "^1.0.2"
yallist "^2.1.2" yallist "^2.1.2"
lunr@^2.1.5: lunr@^2.1.5:
version "2.1.6" version "2.2.0"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.1.6.tgz#671d2321c4c5bc4c522914953d1c54d612f60aa7" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.2.0.tgz#ab66b8853e8f420cd018d9b474a650537d78a86f"
make-dir@^1.0.0: make-dir@^1.0.0:
version "1.2.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
dependencies: dependencies:
pify "^3.0.0" pify "^3.0.0"
@ -1472,9 +1408,9 @@ mark.js@^8.11.1:
version "8.11.1" version "8.11.1"
resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5"
marked@^0.3.12: marked@^0.3.19:
version "0.3.17" version "0.3.19"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.17.tgz#607f06668b3c6b1246b28f13da76116ac1aa2d2b" resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
mem@^1.1.0: mem@^1.1.0:
version "1.1.0" version "1.1.0"
@ -1516,7 +1452,7 @@ minimist@0.0.8:
version "0.0.8" version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
minimist@1.2.0, minimist@^1.2.0: minimist@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
@ -1524,21 +1460,22 @@ minimist@~0.0.1:
version "0.0.10" version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
mkdirp@^0.5.0: mkdirp@^0.5.0, mkdirp@^0.5.1:
version "0.5.1" version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
dependencies: dependencies:
minimist "0.0.8" minimist "0.0.8"
mobx-react@^4.3.3: mobx-react@^5.0.0:
version "4.4.3" version "5.1.2"
resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-4.4.3.tgz#baa9ec41165ee35ae7b9df19bca10190f36f117e" resolved "https://registry.yarnpkg.com/mobx-react/-/mobx-react-5.1.2.tgz#ec5c2d29a1df823dbd1b37e214fa36a0907054e2"
dependencies: dependencies:
hoist-non-react-statics "^2.3.1" hoist-non-react-statics "^2.5.0"
react-lifecycles-compat "^3.0.2"
mobx@^3.3.0: mobx@^4.1.0:
version "3.6.2" version "4.2.1"
resolved "https://registry.yarnpkg.com/mobx/-/mobx-3.6.2.tgz#fb9f5ff5090539a1ad54e75dc4c098b602693320" resolved "https://registry.yarnpkg.com/mobx/-/mobx-4.2.1.tgz#dd4190daf1b43d41a3a228585253f9970b0a27dd"
moment@2.18.1: moment@2.18.1:
version "2.18.1" version "2.18.1"
@ -1560,17 +1497,6 @@ mute-stream@0.0.6:
version "0.0.6" version "0.0.6"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db"
mute-stream@0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
node-fetch@1.6.3:
version "1.6.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04"
dependencies:
encoding "^0.1.11"
is-stream "^1.0.1"
node-fetch@^1.0.1: node-fetch@^1.0.1:
version "1.7.3" version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
@ -1579,8 +1505,8 @@ node-fetch@^1.0.1:
is-stream "^1.0.1" is-stream "^1.0.1"
node-fetch@^2.0.0: node-fetch@^2.0.0:
version "2.1.1" version "2.1.2"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.1.tgz#369ca70b82f50c86496104a6c776d274f4e4a2d4" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5"
node-readfiles@^0.2.0: node-readfiles@^0.2.0:
version "0.2.0" version "0.2.0"
@ -1602,12 +1528,12 @@ node-status-codes@^1.0.0:
validate-npm-package-license "^3.0.1" validate-npm-package-license "^3.0.1"
"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0": "npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0":
version "6.0.0" version "6.1.0"
resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.0.0.tgz#8cce04b49d3f9faec3f56b0fe5f4391aeb9d2fac" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1"
dependencies: dependencies:
hosted-git-info "^2.5.0" hosted-git-info "^2.6.0"
osenv "^0.1.4" osenv "^0.1.5"
semver "^5.4.1" semver "^5.5.0"
validate-npm-package-name "^3.0.0" validate-npm-package-name "^3.0.0"
npm-registry-client@^8.0.0: npm-registry-client@^8.0.0:
@ -1696,15 +1622,9 @@ onetime@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789"
onetime@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
dependencies:
mimic-fn "^1.0.0"
ono@^4.0.3: ono@^4.0.3:
version "4.0.3" version "4.0.5"
resolved "https://registry.yarnpkg.com/ono/-/ono-4.0.3.tgz#b36050f71b02841bfb59f368deab8b07375e2219" resolved "https://registry.yarnpkg.com/ono/-/ono-4.0.5.tgz#bc62740493a5c1c08b2c21e60cbb0e5c56ab7de2"
dependencies: dependencies:
format-util "^1.0.3" format-util "^1.0.3"
@ -1714,24 +1634,6 @@ openapi-sampler@1.0.0-beta.9:
dependencies: dependencies:
json-pointer "^0.6.0" json-pointer "^0.6.0"
opencollective@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/opencollective/-/opencollective-1.0.3.tgz#aee6372bc28144583690c3ca8daecfc120dd0ef1"
dependencies:
babel-polyfill "6.23.0"
chalk "1.1.3"
inquirer "3.0.6"
minimist "1.2.0"
node-fetch "1.6.3"
opn "4.0.2"
opn@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95"
dependencies:
object-assign "^4.0.1"
pinkie-promise "^2.0.0"
optimist@0.6.1, optimist@^0.6.1: optimist@0.6.1, optimist@^0.6.1:
version "0.6.1" version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
@ -1755,11 +1657,11 @@ os-shim@^0.1.2:
version "0.1.3" version "0.1.3"
resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917"
os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: os-tmpdir@^1.0.0, os-tmpdir@~1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
osenv@^0.1.0, osenv@^0.1.4: osenv@^0.1.0, osenv@^0.1.5:
version "0.1.5" version "0.1.5"
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
dependencies: dependencies:
@ -1899,9 +1801,9 @@ prepend-http@^1.0.1:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
prismjs@^1.8.1: prismjs@^1.12.2:
version "1.12.2" version "1.14.0"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.12.2.tgz#a40a6cd5bf36716e316cb75df91976a7d5d694e6" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.14.0.tgz#bbccfdb8be5d850d26453933cb50122ca0362ae0"
optionalDependencies: optionalDependencies:
clipboard "^2.0.0" clipboard "^2.0.0"
@ -1919,7 +1821,7 @@ promise@^7.1.1:
dependencies: dependencies:
asap "~2.0.3" asap "~2.0.3"
prop-types@^15.5.0, prop-types@^15.5.4, prop-types@^15.6.0: prop-types@^15.5.0, prop-types@^15.5.4, prop-types@^15.6.0, prop-types@^15.6.1:
version "15.6.1" version "15.6.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca"
dependencies: dependencies:
@ -1956,8 +1858,8 @@ qs@~6.4.0:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
qs@~6.5.1: qs@~6.5.1:
version "6.5.1" version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
quote@0.4.0: quote@0.4.0:
version "0.4.0" version "0.4.0"
@ -1972,21 +1874,17 @@ ramda@0.24.1:
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857"
rc@^1.0.1, rc@^1.1.2, rc@^1.1.6: rc@^1.0.1, rc@^1.1.2, rc@^1.1.6:
version "1.2.6" version "1.2.7"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.7.tgz#8a10ca30d588d00464360372b890d06dacd02297"
dependencies: dependencies:
deep-extend "~0.4.0" deep-extend "^0.5.1"
ini "~1.3.0" ini "~1.3.0"
minimist "^1.2.0" minimist "^1.2.0"
strip-json-comments "~2.0.1" strip-json-comments "~2.0.1"
react-deep-force-update@^2.1.1: react-dom@^16.3.2:
version "2.1.1" version "16.3.2"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.1.1.tgz#8ea4263cd6455a050b37445b3f08fd839d86e909" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.2.tgz#cb90f107e09536d683d84ed5d4888e9640e0e4df"
react-dom@^16.3.0-alpha.2:
version "16.3.0-alpha.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.3.0-alpha.2.tgz#a970b6185684941e89a568c09321d22643457cb6"
dependencies: dependencies:
fbjs "^0.8.16" fbjs "^0.8.16"
loose-envify "^1.1.0" loose-envify "^1.1.0"
@ -1994,37 +1892,40 @@ react-dom@^16.3.0-alpha.2:
prop-types "^15.6.0" prop-types "^15.6.0"
react-dropdown@^1.3.0: react-dropdown@^1.3.0:
version "1.4.0" version "1.5.0"
resolved "https://registry.yarnpkg.com/react-dropdown/-/react-dropdown-1.4.0.tgz#ea88d4846e9b6da249784107b0f9135248fa88a3" resolved "https://registry.yarnpkg.com/react-dropdown/-/react-dropdown-1.5.0.tgz#3a08f0dd574b64d8eddde60ce51e45b72edc81c3"
dependencies: dependencies:
classnames "^2.2.3" classnames "^2.2.3"
react-hot-loader@3.1.3: react-hot-loader@^4.0.0:
version "3.1.3" version "4.1.3"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-3.1.3.tgz#6f92877326958c7cb0134b512474517869126082" resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.1.3.tgz#b4ceca7961cc08451f8199a24a5753a749edd9ce"
dependencies: dependencies:
fast-levenshtein "^2.0.6"
global "^4.3.0" global "^4.3.0"
react-deep-force-update "^2.1.1" hoist-non-react-statics "^2.5.0"
react-proxy "^3.0.0-alpha.0" prop-types "^15.6.1"
redbox-react "^1.3.6" react-lifecycles-compat "^3.0.2"
source-map "^0.6.1" shallowequal "^1.0.2"
react-proxy@^3.0.0-alpha.0: react-is@^16.3.1:
version "3.0.0-alpha.1" version "16.3.2"
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-3.0.0-alpha.1.tgz#4400426bcfa80caa6724c7755695315209fa4b07" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.3.2.tgz#f4d3d0e2f5fbb6ac46450641eb2e25bf05d36b22"
dependencies:
lodash "^4.6.1" react-lifecycles-compat@^3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
react-tabs@^2.0.0: react-tabs@^2.0.0:
version "2.2.1" version "2.2.2"
resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-2.2.1.tgz#0331d26173c56e7af4fdbfb6225e62683cfdda52" resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-2.2.2.tgz#2f2935da379889484751d1df47c1b639e5ee835d"
dependencies: dependencies:
classnames "^2.2.0" classnames "^2.2.0"
prop-types "^15.5.0" prop-types "^15.5.0"
react@^16.3.0-alpha.2: react@^16.3.2:
version "16.3.0-alpha.2" version "16.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.3.0-alpha.2.tgz#91e2b82bb985b23e7b6555f810e1fd94894afce2" resolved "https://registry.yarnpkg.com/react/-/react-16.3.2.tgz#fdc8420398533a1e58872f59091b272ce2f91ea9"
dependencies: dependencies:
fbjs "^0.8.16" fbjs "^0.8.16"
loose-envify "^1.1.0" loose-envify "^1.1.0"
@ -2039,69 +1940,49 @@ read-all-stream@^3.0.0:
readable-stream "^2.0.0" readable-stream "^2.0.0"
readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.2.2: readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.2.2:
version "2.3.5" version "2.3.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
dependencies: dependencies:
core-util-is "~1.0.0" core-util-is "~1.0.0"
inherits "~2.0.3" inherits "~2.0.3"
isarray "~1.0.0" isarray "~1.0.0"
process-nextick-args "~2.0.0" process-nextick-args "~2.0.0"
safe-buffer "~5.1.1" safe-buffer "~5.1.1"
string_decoder "~1.0.3" string_decoder "~1.1.1"
util-deprecate "~1.0.1" util-deprecate "~1.0.1"
redbox-react@^1.3.6: redoc@^2.0.0-alpha.20:
version "1.5.0" version "2.0.0-alpha.20"
resolved "https://registry.yarnpkg.com/redbox-react/-/redbox-react-1.5.0.tgz#04dab11557d26651bf3562a67c22ace56c5d3967" resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-alpha.20.tgz#ae2a9ab0410b8ed9f40d1c7e8fa79d6a9b6dcf27"
dependencies: dependencies:
error-stack-parser "^1.3.6"
object-assign "^4.0.1"
prop-types "^15.5.4"
sourcemapped-stacktrace "^1.1.6"
redoc@^2.0.0-alpha.15:
version "2.0.0-alpha.15"
resolved "https://registry.yarnpkg.com/redoc/-/redoc-2.0.0-alpha.15.tgz#6a7262824a568bf99c2b21cc2ac3a9657582e331"
dependencies:
"@types/mark.js" "^8.11.1"
"@types/marked" "^0.3.0"
classnames "^2.2.5" classnames "^2.2.5"
decko "^1.2.0" decko "^1.2.0"
dompurify "^1.0.2" dompurify "^1.0.2"
eventemitter3 "^3.0.0" eventemitter3 "^3.0.0"
json-pointer "^0.6.0" json-pointer "^0.6.0"
json-schema-ref-parser "^4.0.4" json-schema-ref-parser "^5.0.0"
lunr "^2.1.5" lunr "^2.1.5"
mark.js "^8.11.1" mark.js "^8.11.1"
marked "^0.3.12" marked "^0.3.19"
mobx "^3.3.0" mobx "^4.1.0"
mobx-react "^4.3.3" mobx-react "^5.0.0"
openapi-sampler "1.0.0-beta.9" openapi-sampler "1.0.0-beta.9"
perfect-scrollbar "^1.3.0" perfect-scrollbar "^1.3.0"
polished "^1.9.2" polished "^1.9.2"
prismjs "^1.8.1" prismjs "^1.12.2"
prop-types "^15.6.0" prop-types "^15.6.0"
react-dropdown "^1.3.0" react-dropdown "^1.3.0"
react-hot-loader "3.1.3" react-hot-loader "^4.0.0"
react-tabs "^2.0.0" react-tabs "^2.0.0"
slugify "^1.2.1" slugify "^1.2.1"
stickyfill "^1.1.1" stickyfill "^1.1.1"
styled-components "^3.1.0" styled-components "^3.2.3"
swagger2openapi "^2.11.0" swagger2openapi "^2.11.0"
yargs "^11.0.0"
reftools@0.0.20: reftools@0.0.20:
version "0.0.20" version "0.0.20"
resolved "https://registry.yarnpkg.com/reftools/-/reftools-0.0.20.tgz#011e00736e51c631149a3a22b4c05b7383bdee8c" resolved "https://registry.yarnpkg.com/reftools/-/reftools-0.0.20.tgz#011e00736e51c631149a3a22b4c05b7383bdee8c"
regenerator-runtime@^0.10.0:
version "0.10.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
regenerator-runtime@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
registry-auth-token@^3.0.1: registry-auth-token@^3.0.1:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20"
@ -2200,13 +2081,6 @@ restore-cursor@^1.0.1:
exit-hook "^1.0.0" exit-hook "^1.0.0"
onetime "^1.0.0" onetime "^1.0.0"
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
dependencies:
onetime "^2.0.0"
signal-exit "^3.0.2"
retry@^0.10.0: retry@^0.10.0:
version "0.10.1" version "0.10.1"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
@ -2234,8 +2108,12 @@ rx@^4.1.0:
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1" version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
select@^1.1.2: select@^1.1.2:
version "1.1.2" version "1.1.2"
@ -2247,7 +2125,7 @@ semver-diff@^2.0.0:
dependencies: dependencies:
semver "^5.0.3" semver "^5.0.3"
"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.4.1: "semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.5.0:
version "5.5.0" version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
@ -2271,6 +2149,10 @@ setimmediate@^1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
shallowequal@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.0.2.tgz#1561dbdefb8c01408100319085764da3fcf83f8f"
shebang-command@^1.2.0: shebang-command@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
@ -2343,8 +2225,8 @@ slide@^1.1.3, slide@^1.1.5:
resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707"
slugify@^1.2.1: slugify@^1.2.1:
version "1.2.9" version "1.3.0"
resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.2.9.tgz#c3d518f5136b3c69345d5d0bbbcde7412b5694aa" resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.3.0.tgz#787919259d28c825fbcae6da2e01c77a109793f6"
sntp@1.x.x: sntp@1.x.x:
version "1.0.9" version "1.0.9"
@ -2358,30 +2240,16 @@ sntp@2.x.x:
dependencies: dependencies:
hoek "4.x.x" hoek "4.x.x"
source-map@0.5.6:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
source-map@^0.4.4: source-map@^0.4.4:
version "0.4.4" version "0.4.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
dependencies: dependencies:
amdefine ">=0.0.4" amdefine ">=0.0.4"
source-map@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
source-map@~0.5.1: source-map@~0.5.1:
version "0.5.7" version "0.5.7"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
sourcemapped-stacktrace@^1.1.6:
version "1.1.8"
resolved "https://registry.yarnpkg.com/sourcemapped-stacktrace/-/sourcemapped-stacktrace-1.1.8.tgz#6b7a3f1a6fb15f6d40e701e23ce404553480d688"
dependencies:
source-map "0.5.6"
spawn-sync@^1.0.15: spawn-sync@^1.0.15:
version "1.0.15" version "1.0.15"
resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476"
@ -2439,10 +2307,6 @@ ssri@^5.2.4:
dependencies: dependencies:
safe-buffer "^5.1.1" safe-buffer "^5.1.1"
stackframe@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4"
stickyfill@^1.1.1: stickyfill@^1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/stickyfill/-/stickyfill-1.1.1.tgz#39413fee9d025c74a7e59ceecb23784cc0f17f02" resolved "https://registry.yarnpkg.com/stickyfill/-/stickyfill-1.1.1.tgz#39413fee9d025c74a7e59ceecb23784cc0f17f02"
@ -2466,9 +2330,9 @@ string-width@^2.0.0, string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0" is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
string_decoder@~1.0.3: string_decoder@~1.1.1:
version "1.0.3" version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
dependencies: dependencies:
safe-buffer "~5.1.0" safe-buffer "~5.1.0"
@ -2496,17 +2360,17 @@ strip-json-comments@~2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
styled-components@^3.1.0: styled-components@^3.2.3:
version "3.2.3" version "3.2.6"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.2.3.tgz#50f71207320eeb1ef539dec4637f21f5e3c936b4" resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.2.6.tgz#99e6e75a746bdedd295a17e03dd1493055a1cc3b"
dependencies: dependencies:
buffer "^5.0.3" buffer "^5.0.3"
css-to-react-native "^2.0.3" css-to-react-native "^2.0.3"
fbjs "^0.8.9" fbjs "^0.8.16"
hoist-non-react-statics "^1.2.0" hoist-non-react-statics "^2.5.0"
is-plain-object "^2.0.1" is-plain-object "^2.0.1"
opencollective "^1.0.3"
prop-types "^15.5.4" prop-types "^15.5.4"
react-is "^16.3.1"
stylis "^3.5.0" stylis "^3.5.0"
stylis-rule-sheet "^0.0.10" stylis-rule-sheet "^0.0.10"
supports-color "^3.2.3" supports-color "^3.2.3"
@ -2530,8 +2394,8 @@ supports-color@^3.2.3:
has-flag "^1.0.0" has-flag "^1.0.0"
supports-color@^5.3.0: supports-color@^5.3.0:
version "5.3.0" version "5.4.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54"
dependencies: dependencies:
has-flag "^3.0.0" has-flag "^3.0.0"
@ -2577,18 +2441,16 @@ tmp@^0.0.29:
dependencies: dependencies:
os-tmpdir "~1.0.1" os-tmpdir "~1.0.1"
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
dependencies:
os-tmpdir "~1.0.2"
tough-cookie@~2.3.0, tough-cookie@~2.3.3: tough-cookie@~2.3.0, tough-cookie@~2.3.3:
version "2.3.4" version "2.3.4"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
dependencies: dependencies:
punycode "^1.4.1" punycode "^1.4.1"
tslib@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
tunnel-agent@^0.6.0: tunnel-agent@^0.6.0:
version "0.6.0" version "0.6.0"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
@ -2604,8 +2466,8 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
ua-parser-js@^0.7.9: ua-parser-js@^0.7.9:
version "0.7.17" version "0.7.18"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"
uglify-js@^2.6: uglify-js@^2.6:
version "2.8.29" version "2.8.29"
@ -2724,8 +2586,8 @@ weak-map@^1.0.5:
resolved "https://registry.yarnpkg.com/weak-map/-/weak-map-1.0.5.tgz#79691584d98607f5070bd3b70a40e6bb22e401eb" resolved "https://registry.yarnpkg.com/weak-map/-/weak-map-1.0.5.tgz#79691584d98607f5070bd3b70a40e6bb22e401eb"
whatwg-fetch@>=0.10.0: whatwg-fetch@>=0.10.0:
version "2.0.3" version "2.0.4"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"
which-module@^2.0.0: which-module@^2.0.0:
version "2.0.0" version "2.0.0"

2
custom.d.ts vendored
View File

@ -1,4 +1,4 @@
/// <reference path="src/styled.d.ts" /> /// <reference path="typings/styled-patch.d.ts" />
declare module '*.json' { declare module '*.json' {
const content: any; const content: any;

View File

@ -31,7 +31,7 @@ const babelLoader = mode => ({
options: { options: {
plugins: compact([ plugins: compact([
'@babel/plugin-syntax-typescript', '@babel/plugin-syntax-typescript',
'@babel/plugin-syntax-decorators', ['@babel/plugin-syntax-decorators', { legacy: true }],
'@babel/plugin-syntax-jsx', '@babel/plugin-syntax-jsx',
mode !== 'production' ? 'react-hot-loader/babel' : undefined, mode !== 'production' ? 'react-hot-loader/babel' : undefined,
[ [

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc", "name": "redoc",
"version": "2.0.0-alpha.18", "version": "2.0.0-alpha.22",
"description": "ReDoc", "description": "ReDoc",
"repository": { "repository": {
"type": "git", "type": "git",
@ -23,11 +23,12 @@
"React.js" "React.js"
], ],
"main": "bundles/redoc.lib.js", "main": "bundles/redoc.lib.js",
"types": "typings/index.d.ts",
"scripts": { "scripts": {
"start": "webpack-dev-server --mode=development --env.playground --hot --config demo/webpack.config.ts", "start": "webpack-dev-server --mode=development --env.playground --hot --config demo/webpack.config.ts",
"start:prod": "webpack-dev-server --env.playground --mode=production --config demo/webpack.config.ts", "start:prod": "webpack-dev-server --env.playground --mode=production --config demo/webpack.config.ts",
"start:benchmark": "webpack-dev-server --mode=production --env.bench --config demo/webpack.config.ts", "start:benchmark": "webpack-dev-server --mode=production --env.bench --config demo/webpack.config.ts",
"test": "npm run lint && npm run unit && npm run bundlesize", "test": "npm run lint && npm run unit && npm run bundlesize && npm run license-check",
"unit": "jest --coverage", "unit": "jest --coverage",
"e2e": "cypress run", "e2e": "cypress run",
"e2e-ci": "cypress run --record", "e2e-ci": "cypress run --record",
@ -37,40 +38,42 @@
"bundle:standalone": "webpack --env.standalone --mode=production", "bundle:standalone": "webpack --env.standalone --mode=production",
"bundle:lib": "webpack --mode=production", "bundle:lib": "webpack --mode=production",
"bundle": "npm run bundle:clean && npm run bundle:lib && npm run bundle:standalone", "bundle": "npm run bundle:clean && npm run bundle:lib && npm run bundle:standalone",
"declarations": "tsc --emitDeclarationOnly -p tsconfig.lib.json && cp -R src/types typings/",
"stats": "webpack --env.standalone --json --profile --mode=production > stats.json", "stats": "webpack --env.standalone --json --profile --mode=production > stats.json",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"", "prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",
"lint": "tslint --project tsconfig.json", "lint": "tslint --project tsconfig.json",
"benchmark": "node ./benchmark/benchmark.js", "benchmark": "node ./benchmark/benchmark.js",
"start:demo": "webpack-dev-server --hot --config demo/webpack.config.ts --mode=development", "start:demo": "webpack-dev-server --hot --config demo/webpack.config.ts --mode=development",
"compile:cli": "tsc cli/index.ts --target es6 --module commonjs --types yargs", "compile:cli": "tsc custom.d.ts cli/index.ts --target es6 --module commonjs --types yargs",
"build:demo": "webpack --mode=production --config demo/webpack.config.ts", "build:demo": "webpack --mode=production --config demo/webpack.config.ts",
"deploy:demo": "npm run build:demo && deploy-to-gh-pages --update demo/dist" "deploy:demo": "npm run build:demo && deploy-to-gh-pages --update demo/dist",
"license-check": "license-checker --production --onlyAllow 'MIT;ISC;Apache-2.0;BSD-2-Clause;BSD-3-Clause' --summary"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0-beta.40", "@babel/core": "^7.0.0-beta.40",
"@babel/plugin-syntax-decorators": "^7.0.0-beta.42", "@babel/plugin-syntax-decorators": "^7.0.0-beta.42",
"@babel/plugin-syntax-jsx": "^7.0.0-beta.42", "@babel/plugin-syntax-jsx": "^7.0.0-beta.42",
"@babel/plugin-syntax-typescript": "^7.0.0-beta.42", "@babel/plugin-syntax-typescript": "^7.0.0-beta.42",
"@cypress/webpack-preprocessor": "2.0.0", "@cypress/webpack-preprocessor": "2.0.1",
"@types/dompurify": "^0.0.31", "@types/dompurify": "^0.0.31",
"@types/enzyme": "^3.1.8", "@types/enzyme": "^3.1.8",
"@types/enzyme-to-json": "^1.5.0", "@types/enzyme-to-json": "^1.5.0",
"@types/jest": "^22.2.2", "@types/jest": "^22.2.2",
"@types/json-pointer": "^1.0.30", "@types/json-pointer": "^1.0.30",
"@types/lodash": "^4.14.106", "@types/lodash": "^4.14.109",
"@types/lunr": "^2.1.5", "@types/lunr": "^2.1.5",
"@types/mark.js": "^8.11.1", "@types/mark.js": "^8.11.1",
"@types/marked": "^0.3.0", "@types/marked": "^0.3.0",
"@types/prismjs": "^1.6.4", "@types/prismjs": "^1.6.4",
"@types/promise": "^7.1.30", "@types/promise": "^7.1.30",
"@types/prop-types": "^15.5.2",
"@types/qs": "^6.5.1", "@types/qs": "^6.5.1",
"@types/prop-types": "^15.5.3",
"@types/react": "^16.0.41", "@types/react": "^16.0.41",
"@types/react-dom": "^16.0.0", "@types/react-dom": "^16.0.0",
"@types/react-hot-loader": "^3.0.3", "@types/react-hot-loader": "^4.1.0",
"@types/react-tabs": "^1.0.2", "@types/react-tabs": "^1.0.2",
"@types/webpack": "^4.1.2", "@types/webpack": "^4.4.0",
"@types/webpack-env": "^1.13.0", "@types/webpack-env": "^1.13.0",
"@types/whatwg-fetch": "^0.0.33", "@types/whatwg-fetch": "^0.0.33",
"@types/yargs": "^11.0.0", "@types/yargs": "^11.0.0",
@ -81,61 +84,64 @@
"beautify-benchmark": "^0.2.4", "beautify-benchmark": "^0.2.4",
"brace": "^0.11.1", "brace": "^0.11.1",
"bundlesize": "^0.17.0", "bundlesize": "^0.17.0",
"conventional-changelog-cli": "^1.3.17", "conventional-changelog-cli": "^2.0.0",
"copy-webpack-plugin": "^4.5.1", "copy-webpack-plugin": "^4.5.1",
"core-js": "^2.5.1", "core-js": "^2.5.7",
"coveralls": "^3.0.0", "coveralls": "^3.0.0",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"cypress": "~2.1.0", "cypress": "~2.1.0",
"deploy-to-gh-pages": "^1.3.6", "deploy-to-gh-pages": "^1.3.6",
"enzyme": "^3.1.1", "enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.4", "enzyme-adapter-react-16": "^1.0.4",
"enzyme-to-json": "^3.3.3", "enzyme-to-json": "^3.3.4",
"fork-ts-checker-webpack-plugin": "^0.4.1", "fork-ts-checker-webpack-plugin": "^0.4.1",
"html-webpack-plugin": "^3.1.0", "html-webpack-plugin": "^3.1.0",
"jest": "^22.4.3", "react-ace": "^6.0.0",
"lodash": "^4.17.5", "jest": "^23.0.1",
"prettier": "^1.5.3", "license-checker": "^20.0.0",
"lodash": "^4.17.10",
"prettier": "^1.13.2",
"prettier-eslint": "^8.8.1", "prettier-eslint": "^8.8.1",
"puppeteer": "^1.2.0", "puppeteer": "^1.2.0",
"raf": "^3.4.0", "raf": "^3.4.0",
"react": "^16.3.0-alpha.2", "react": "^16.4.0",
"react-ace": "^6.0.0", "react-dom": "^16.4.0",
"react-dom": "^16.3.0-alpha.2",
"rimraf": "^2.6.2", "rimraf": "^2.6.2",
"shelljs": "^0.8.1", "shelljs": "^0.8.1",
"source-map-loader": "^0.2.1", "source-map-loader": "^0.2.1",
"style-loader": "^0.20.3", "style-loader": "^0.21.0",
"ts-jest": "^22.0.1", "ts-jest": "^22.0.1",
"ts-loader": "4.1.0", "ts-loader": "4.3.0",
"ts-node": "^5.0.1", "ts-node": "^6.0.5",
"tslint": "^5.7.0", "tslint": "^5.7.0",
"tslint-react": "^3.4.0", "tslint-react": "^3.4.0",
"typescript": "^2.8.0-rc", "typescript": "^2.8.0-rc",
"webpack": "^4.1.1", "webpack": "^4.10.1",
"webpack-cli": "^2.0.13", "webpack-cli": "^2.1.4",
"webpack-dev-server": "^3.1.1", "webpack-dev-server": "^3.1.1",
"webpack-node-externals": "^1.6.0", "webpack-node-externals": "^1.6.0",
"workerize-loader": "^1.0.2", "workerize-loader": "^1.0.3",
"yaml-js": "^0.2.3" "yaml-js": "^0.2.3"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^16.3.0-alpha.2", "react": "^16.3.0",
"react-dom": "^16.3.0-alpha.2" "react-dom": "^16.3.0"
}, },
"dependencies": { "dependencies": {
"@types/chai": "4.1.3",
"@types/tapable": "1.0.2",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"decko": "^1.2.0", "decko": "^1.2.0",
"dompurify": "^1.0.2", "dompurify": "^1.0.2",
"eventemitter3": "^3.0.0", "eventemitter3": "^3.0.0",
"json-pointer": "^0.6.0", "json-pointer": "^0.6.0",
"json-schema-ref-parser": "^5.0.0", "json-schema-ref-parser": "^5.0.0",
"lunr": "^2.1.5", "lunr": "^2.2.1",
"mark.js": "^8.11.1", "mark.js": "^8.11.1",
"marked": "^0.3.19", "marked": "^0.4.0",
"mobx": "^4.1.0", "mobx": "^4.3.0",
"mobx-react": "^5.0.0", "mobx-react": "^5.0.0",
"openapi-sampler": "1.0.0-beta.9", "openapi-sampler": "1.0.0-beta.12",
"perfect-scrollbar": "^1.3.0", "perfect-scrollbar": "^1.3.0",
"polished": "^1.9.2", "polished": "^1.9.2",
"prismjs": "^1.12.2", "prismjs": "^1.12.2",
@ -145,9 +151,9 @@
"react-tabs": "^2.0.0", "react-tabs": "^2.0.0",
"slugify": "^1.2.1", "slugify": "^1.2.1",
"stickyfill": "^1.1.1", "stickyfill": "^1.1.1",
"styled-components": "^3.2.3", "styled-components": "^3.3.0",
"swagger2openapi": "^2.11.0", "swagger2openapi": "^2.11.0",
"whatwg-fetch": "^2.0.4" "tslib": "^1.9.1"
}, },
"resolutions": { "resolutions": {
"@types/chai": "4.0.8", "@types/chai": "4.0.8",

View File

@ -1,7 +1,9 @@
/* tslint:disable:no-implicit-dependencies */
import * as React from 'react'; import * as React from 'react';
import { renderToString } from 'react-dom/server'; import { renderToString } from 'react-dom/server';
import { Redoc, createStore } from '../';
import * as yaml from 'yaml-js'; import * as yaml from 'yaml-js';
import { createStore, Redoc } from '../';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';

View File

@ -1,5 +1,6 @@
import * as React from 'react'; /* tslint:disable:no-implicit-dependencies */
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import * as React from 'react';
import * as yaml from 'yaml-js'; import * as yaml from 'yaml-js';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
@ -7,14 +8,14 @@ import { resolve } from 'path';
// import { filterPropsDeep } from '../../../utils/test-utils'; // import { filterPropsDeep } from '../../../utils/test-utils';
import { RedocStandalone, Loading, StoreProvider, ErrorBoundary } from '../components/'; import { ErrorBoundary, Loading, RedocStandalone, StoreProvider } from '../components/';
describe('Components', () => { describe('Components', () => {
describe('RedocStandalone', () => { describe('RedocStandalone', () => {
test('should show loading first', () => { test('should show loading first', () => {
const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'))); const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml')));
let inst = mount(<RedocStandalone spec={spec} options={{}} />); const inst = mount(<RedocStandalone spec={spec} options={{}} />);
expect(inst.find(Loading)).toHaveLength(1); expect(inst.find(Loading)).toHaveLength(1);
}); });
}); });

View File

@ -1,6 +1,11 @@
import * as React from 'react';
import Dropdown from 'react-dropdown'; import Dropdown from 'react-dropdown';
import styled, { StyledComponentClass, withProps } from '../styled-components'; import styled, {
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../styled-components';
export interface DropdownOption { export interface DropdownOption {
label: string; label: string;
@ -71,6 +76,9 @@ export const StyledDropdown = withProps<DropdownProps>(styled(Dropdown))`
background: white; background: white;
border: 1px solid rgba(38, 50, 56, 0.2); border: 1px solid rgba(38, 50, 56, 0.2);
box-shadow: 0px 2px 4px 0px rgba(34, 36, 38, 0.12), 0px 2px 10px 0px rgba(34, 36, 38, 0.08); box-shadow: 0px 2px 4px 0px rgba(34, 36, 38, 0.12), 0px 2px 10px 0px rgba(34, 36, 38, 0.08);
max-height: 220px;
overflow: auto;
} }
.Dropdown-option { .Dropdown-option {

View File

@ -1,5 +1,11 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import styled from '../styled-components'; import * as React from 'react';
import styled, {
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../styled-components';
import { deprecatedCss } from './mixins'; import { deprecatedCss } from './mixins';
export const PropertiesTableCaption = styled.caption` export const PropertiesTableCaption = styled.caption`
@ -57,17 +63,18 @@ export const PropertyCellWithInner = PropertyCell.extend`
padding: 0; padding: 0;
`; `;
export const PropertyNameCell = PropertyCell.extend` export const PropertyNameCell = withProps<{ kind?: string }>(PropertyCell.extend)`
vertical-align: top; vertical-align: top;
line-height: 20px; line-height: 20px;
white-space: nowrap; white-space: nowrap;
font-size: 0.929em; font-size: 0.929em;
font-weight: 300;
font-family: ${props => props.theme.headingsFont.family}; font-family: ${props => props.theme.headingsFont.family};
&.deprecated { &.deprecated {
${deprecatedCss}; ${deprecatedCss};
} }
${({ kind }) => (kind !== 'field' ? 'font-style: italic' : '')};
`; `;
export const PropertyDetailsCell = styled.td` export const PropertyDetailsCell = styled.td`
@ -106,12 +113,13 @@ export const PropertyBullet = styled.span`
`; `;
export const InnerPropertiesWrap = styled.div` export const InnerPropertiesWrap = styled.div`
padding: 1em; padding: ${({ theme }) => theme.schemaView.nestingSpacing};
`; `;
export const PropertiesTable = styled.table` export const PropertiesTable = styled.table`
border-collapse: collapse; border-collapse: collapse;
border-radius: 3px; border-radius: 3px;
font-size: ${props => props.theme.baseFont.size};
border-spacing: 0; border-spacing: 0;
width: 100%; width: 100%;
@ -132,7 +140,8 @@ export const PropertiesTable = styled.table`
${InnerPropertiesWrap} ${InnerPropertiesWrap}
${InnerPropertiesWrap} ${InnerPropertiesWrap}
${InnerPropertiesWrap} { ${InnerPropertiesWrap} {
margin: 1em 0 1em 1em; margin: ${({ theme }) => theme.schemaView.nestingSpacing};
margin-right: 0;
background: #f0f0f0; background: #f0f0f0;
} }

View File

@ -1,5 +1,7 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import styled from '../styled-components'; import * as React from 'react';
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
import { PropertyNameCell } from './fields-layout'; import { PropertyNameCell } from './fields-layout';
export const ClickablePropertyNameCell = PropertyNameCell.extend` export const ClickablePropertyNameCell = PropertyNameCell.extend`

View File

@ -1,4 +1,7 @@
import styled, { css } from '../styled-components'; import * as React from 'react';
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import styled, { css, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
const headerFontSize = { const headerFontSize = {
1: '1.85714em', 1: '1.85714em',
@ -15,7 +18,6 @@ export const headerCommonMixin = level => css`
export const H1 = styled.h1` export const H1 = styled.h1`
${headerCommonMixin(1)}; ${headerCommonMixin(1)};
color: ${props => props.theme.colors.main}; color: ${props => props.theme.colors.main};
text-transform: capitalize;
`; `;
export const H2 = styled.h2` export const H2 = styled.h2`

View File

@ -1,4 +1,7 @@
import styled, { css } from '../styled-components'; import * as React from 'react';
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import styled, { css, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
// tslint:disable-next-line // tslint:disable-next-line
export const linkifyMixin = className => css` export const linkifyMixin = className => css`

View File

@ -1,4 +1,6 @@
import { css } from '../styled-components'; import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import { css, StyledComponentClass } from '../styled-components';
export const deprecatedCss = css` export const deprecatedCss = css`
text-decoration: line-through; text-decoration: line-through;

View File

@ -1,4 +1,5 @@
import styled, { media } from '../styled-components'; import * as React from 'react';
import styled, { media, ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
export const MiddlePanel = styled.div` export const MiddlePanel = styled.div`
width: calc(100% - ${props => props.theme.rightPanel.width}); width: calc(100% - ${props => props.theme.rightPanel.width});

View File

@ -1,4 +1,6 @@
import styled from '../styled-components'; import * as React from 'react';
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
export const SampleControls = styled.div` export const SampleControls = styled.div`
opacity: 0.4; opacity: 0.4;

View File

@ -1,4 +1,9 @@
import styled, { withProps } from '../styled-components'; import * as React from 'react';
import styled, {
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../styled-components';
export const OneOfList = styled.ul` export const OneOfList = styled.ul`
margin: 0; margin: 0;

View File

@ -1,5 +1,9 @@
import * as React from 'react'; import * as React from 'react';
import styled, { withProps } from '../styled-components'; import styled, {
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../styled-components';
const directionMap = { const directionMap = {
left: '90deg', left: '90deg',

View File

@ -1,5 +1,5 @@
import { Tabs as ReactTabs } from 'react-tabs'; import { Tabs as ReactTabs, TabsProps } from 'react-tabs';
import styled from '../styled-components'; import styled, { ResolvedThemeInterface, StyledComponentClass } from '../styled-components';
export { Tab, TabList, TabPanel } from 'react-tabs'; export { Tab, TabList, TabPanel } from 'react-tabs';
@ -8,24 +8,28 @@ export const Tabs = styled(ReactTabs)`
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
display: flex; margin: 0 -5px;
flex-wrap: wrap;
> li { > li {
padding: 5px 10px; padding: 5px 10px;
display: inline-block; display: inline-block;
flex: 1;
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(0, 0, 0, 0.2);
border-bottom: 1px solid rgba(0, 0, 0, 0.5); border-bottom: 1px solid rgba(0, 0, 0, 0.5);
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
outline: none; outline: none;
color: #ccc; color: #ccc;
margin: 5px;
border: 1px solid #181f22;
border-radius: 5px;
min-width: 60px;
font-size: 0.9em;
font-weight: bold;
&.react-tabs__tab--selected { &.react-tabs__tab--selected {
color: #fff; color: ${props => props.theme.colors.text};
background: rgba(0, 0, 0, 0.5); background: #e2e2e2;
border-bottom: 1px solid ${props => props.theme.schemaView.linesColor};
} }
&:only-child { &:only-child {
@ -64,21 +68,23 @@ export const SmallTabs = Tabs.extend`
> ul { > ul {
display: block; display: block;
> li { > li {
padding: 0; padding: 2px 5px;
margin-right: 20px; min-width: auto;
font-size: 12px; margin: 0 15px 0 0;
padding: 2px 0; font-size: 13px;
font-weight: normal;
border-bottom: 1px dashed; border-bottom: 1px dashed;
color: #787b7d; color: #787b7d;
backgrond: none; border-radius: 0;
background: none;
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
&.react-tabs__tab--selected { &.react-tabs__tab--selected {
backgrond: none;
color: #babcbf; color: #babcbf;
background: none;
} }
} }
} }

View File

@ -15,7 +15,7 @@ import {
InfoSpanBoxWrap, InfoSpanBoxWrap,
} from './styled.elements'; } from './styled.elements';
interface ApiInfoProps { export interface ApiInfoProps {
store: AppStore; store: AppStore;
} }

View File

@ -1,6 +1,7 @@
import styled from '../../styled-components'; import { AnchorHTMLAttributes, ClassAttributes, HTMLAttributes } from 'react';
import { H1, MiddlePanel } from '../../common-elements'; import { H1, MiddlePanel } from '../../common-elements';
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
const delimiterWidth = 15; const delimiterWidth = 15;

View File

@ -1,5 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import styled from '../../styled-components'; import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
export const LogoImgEl = styled.img` export const LogoImgEl = styled.img`
max-height: ${props => props.theme.logo.maxHeight}; max-height: ${props => props.theme.logo.maxHeight};

View File

@ -22,7 +22,7 @@ export class ContentItems extends React.Component<{
} }
} }
interface ContentItemProps { export interface ContentItemProps {
item: ContentItemModel; item: ContentItemModel;
} }

View File

@ -1,4 +1,10 @@
import styled, { withProps } from '../../styled-components'; import { ClassAttributes, HTMLAttributes, HTMLProps } from 'react';
import styled, {
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../../styled-components';
export const OperationEndpointWrap = styled.div` export const OperationEndpointWrap = styled.div`
cursor: pointer; cursor: pointer;
@ -16,7 +22,6 @@ export const EndpointInfo = withProps<{ expanded?: boolean; inverted?: boolean }
border-radius: ${props => (props.inverted ? '0' : '4px 4px 0 0')}; border-radius: ${props => (props.inverted ? '0' : '4px 4px 0 0')};
background-color: ${props => (props.inverted ? 'transparent' : '#222d32')}; background-color: ${props => (props.inverted ? 'transparent' : '#222d32')};
display: block; display: block;
font-weight: 300;
white-space: nowrap; white-space: nowrap;
overflow-x: hidden; overflow-x: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -44,12 +49,6 @@ export const HttpVerb = withProps<{ type: string }>(styled.span).attrs({
margin: 0; margin: 0;
`; `;
// background: transparent;
// border-bottom: 1px solid #cccccc;
// border-color: transparent;
// border-bottom: 1px solid rgba(0,0,0,0.33);
// padding-left: 10px;
export const ServersOverlay = withProps<{ expanded: boolean }>(styled.div)` export const ServersOverlay = withProps<{ expanded: boolean }>(styled.div)`
position: absolute; position: absolute;
width: 100%; width: 100%;

View File

@ -32,23 +32,29 @@ export class Field extends React.PureComponent<FieldProps> {
}; };
render() { render() {
const { className, field, isLast } = this.props; const { className, field, isLast } = this.props;
const { name, expanded, deprecated, required } = field; const { name, expanded, deprecated, required, kind } = field;
const withSubSchema = !field.schema.isPrimitive && !field.schema.isCircular; const withSubSchema = !field.schema.isPrimitive && !field.schema.isCircular;
const paramName = withSubSchema ? ( const paramName = withSubSchema ? (
<ClickablePropertyNameCell onClick={this.toggle} className={deprecated ? 'deprecated' : ''}> <ClickablePropertyNameCell
onClick={this.toggle}
className={deprecated ? 'deprecated' : ''}
kind={kind}
title={name}
>
<PropertyBullet /> <PropertyBullet />
{name} {name}
<ShelfIcon size={'1.2em'} direction={expanded ? 'down' : 'right'} /> <ShelfIcon size={'1.2em'} direction={expanded ? 'down' : 'right'} />
{required && <RequiredLabel> required </RequiredLabel>} {required && <RequiredLabel> required </RequiredLabel>}
</ClickablePropertyNameCell> </ClickablePropertyNameCell>
) : ( ) : (
<PropertyNameCell className={deprecated ? 'deprecated' : undefined}> <PropertyNameCell className={deprecated ? 'deprecated' : undefined} kind={kind} title={name}>
<PropertyBullet /> <PropertyBullet />
{name} {name}
{required && <RequiredLabel> required </RequiredLabel>} {required && <RequiredLabel> required </RequiredLabel>}
</PropertyNameCell> </PropertyNameCell>
); );
return ( return (
<> <>
<tr className={isLast ? 'last ' + className : className}> <tr className={isLast ? 'last ' + className : className}>

View File

@ -1,12 +1,12 @@
import * as React from 'react'; import * as React from 'react';
import styled from '../../styled-components'; import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
import { SampleControls } from '../../common-elements'; import { SampleControls } from '../../common-elements';
import { CopyButtonWrapper } from '../../common-elements/CopyButtonWrapper'; import { CopyButtonWrapper } from '../../common-elements/CopyButtonWrapper';
import { jsonToHTML } from '../../utils/jsonToHtml'; import { jsonToHTML } from '../../utils/jsonToHtml';
import { jsonStyles } from './style'; import { jsonStyles } from './style';
interface JsonProps { export interface JsonProps {
data: any; data: any;
className?: string; className?: string;
} }

View File

@ -1,4 +1,5 @@
import { css } from '../../styled-components'; import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import { css, ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
export const jsonStyles = css` export const jsonStyles = css`
.redoc-json > .collapser { .redoc-json > .collapser {

View File

@ -1,5 +1,9 @@
import * as React from 'react'; import * as React from 'react';
import styled, { keyframes } from '../../styled-components'; import styled, {
keyframes,
ResolvedThemeInterface,
StyledComponentClass,
} from '../../styled-components';
const _Spinner = (props: { className?: string; color: string }) => ( const _Spinner = (props: { className?: string; color: string }) => (
<svg className={props.className} version="1.1" width="512" height="512" viewBox="0 0 512 512"> <svg className={props.className} version="1.1" width="512" height="512" viewBox="0 0 512 512">

View File

@ -1,5 +1,5 @@
import * as React from 'react'; import * as React from 'react';
import styled from '../../styled-components'; import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
import * as DOMPurify from 'dompurify'; import * as DOMPurify from 'dompurify';
import { AppStore, MarkdownRenderer } from '../../services'; import { AppStore, MarkdownRenderer } from '../../services';

View File

@ -1,7 +1,14 @@
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import { headerCommonMixin, linkifyMixin } from '../../common-elements'; import { headerCommonMixin, linkifyMixin } from '../../common-elements';
import { css } from '../../styled-components'; import { css, ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
export const markdownCss = css` export const markdownCss = css`
font-family: ${props => props.theme.baseFont.family};
font-weight: ${props => props.theme.baseFont.weight};
line-height: ${props => props.theme.baseFont.lineHeight};
p { p {
&:last-of-type { &:last-of-type {
margin-bottom: 0; margin-bottom: 0;
@ -28,8 +35,8 @@ export const markdownCss = css`
} }
code { code {
color: #e53935; color: ${({ theme }) => theme.colors.code};
background-color: rgba(38, 50, 56, 0.04); background-color: ${({ theme }) => theme.colors.codeBg};
font-family: ${props => props.theme.code.fontFamily}; font-family: ${props => props.theme.code.fontFamily};
border-radius: 2px; border-radius: 2px;
border: 1px solid rgba(38, 50, 56, 0.1); border: 1px solid rgba(38, 50, 56, 0.1);
@ -77,9 +84,6 @@ export const markdownCss = css`
padding-left: 2em; padding-left: 2em;
margin: 0; margin: 0;
margin-bottom: 1em; margin-bottom: 1em;
font-family: ${props => props.theme.baseFont.family};
font-weight: ${props => props.theme.baseFont.weight};
line-height: ${props => props.theme.baseFont.lineHeight};
> li { > li {
margin: 1em 0; margin: 1em 0;
} }

View File

@ -36,7 +36,7 @@ const OperationRow = Row.extend`
} }
`; `;
interface OperationProps { export interface OperationProps {
operation: OperationType; operation: OperationType;
} }

View File

@ -3,19 +3,6 @@ import * as React from 'react';
import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions'; import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions';
// TODO: contribute declarations to @types/react once 16.3 is released
type ReactProviderComponent<T> = React.ComponentType<{ value: T }>;
type ReactConsumerComponent<T> = React.ComponentType<{ children: ((value: T) => React.ReactNode) }>;
interface ReactContext<T> {
Provider: ReactProviderComponent<T>;
Consumer: ReactConsumerComponent<T>;
}
declare module 'react' {
function createContext<T>(defatulValue: T): ReactContext<T>;
}
export const OptionsContext = React.createContext(new RedocNormalizedOptions({})); export const OptionsContext = React.createContext(new RedocNormalizedOptions({}));
export const OptionsProvider = OptionsContext.Provider; export const OptionsProvider = OptionsContext.Provider;
export const OptionsConsumer = OptionsContext.Consumer; export const OptionsConsumer = OptionsContext.Consumer;

View File

@ -17,7 +17,7 @@ function safePush(obj, prop, item) {
obj[prop].push(item); obj[prop].push(item);
} }
interface ParametersProps { export interface ParametersProps {
parameters?: FieldModel[]; parameters?: FieldModel[];
body?: RequestBodyModel; body?: RequestBodyModel;
} }

View File

@ -1,6 +1,7 @@
import styled from '../../styled-components'; import { ClassAttributes, HTMLAttributes } from 'react';
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
import { StyledDropdown } from '../../common-elements'; import { DropdownProps, StyledDropdown } from '../../common-elements';
export const MimeLabel = styled.div` export const MimeLabel = styled.div`
border-bottom: 1px solid rgba(255, 255, 255, 0.9); border-bottom: 1px solid rgba(255, 255, 255, 0.9);

View File

@ -10,7 +10,7 @@ import { ContentItems } from '../ContentItems/ContentItems';
import { OptionsProvider } from '../OptionsProvider'; import { OptionsProvider } from '../OptionsProvider';
import { SideMenu } from '../SideMenu/SideMenu'; import { SideMenu } from '../SideMenu/SideMenu';
import { StickyResponsiveSidebar } from '../StickySidebar/StickyResponsiveSidebar'; import { StickyResponsiveSidebar } from '../StickySidebar/StickyResponsiveSidebar';
import { ApiContent, BackgroundStub, RedocWrap } from './elements'; import { ApiContentWrap, BackgroundStub, RedocWrap } from './styled.elements';
import { SearchBox } from '../SearchBox/SearchBox'; import { SearchBox } from '../SearchBox/SearchBox';
@ -32,7 +32,9 @@ export class Redoc extends React.Component<RedocProps> {
} }
render() { render() {
const { store: { spec, menu, options, search, marker } } = this.props; const {
store: { spec, menu, options, search, marker },
} = this.props;
const store = this.props.store; const store = this.props.store;
return ( return (
<ThemeProvider theme={options.theme}> <ThemeProvider theme={options.theme}>
@ -48,10 +50,10 @@ export class Redoc extends React.Component<RedocProps> {
/> />
<SideMenu menu={menu} /> <SideMenu menu={menu} />
</StickyResponsiveSidebar> </StickyResponsiveSidebar>
<ApiContent className="api-content"> <ApiContentWrap className="api-content">
<ApiInfo store={store} /> <ApiInfo store={store} />
<ContentItems items={menu.items as any} /> <ContentItems items={menu.items as any} />
</ApiContent> </ApiContentWrap>
<BackgroundStub /> <BackgroundStub />
</RedocWrap> </RedocWrap>
</OptionsProvider> </OptionsProvider>

View File

@ -1,9 +1,15 @@
import styled, { media } from '../../styled-components'; import { ClassAttributes, HTMLAttributes } from 'react';
export { ClassAttributes } from 'react';
import styled, {
media,
ResolvedThemeInterface,
StyledComponentClass,
} from '../../styled-components';
export const RedocWrap = styled.div` export const RedocWrap = styled.div`
font-family: ${props => props.theme.baseFont.family}; font-family: ${props => props.theme.baseFont.family};
font-size: ${props => props.theme.baseFont.size}; font-size: ${props => props.theme.baseFont.size};
font-weight: ${props => props.theme.baseFont.weight};
line-height: ${props => props.theme.baseFont.lineHeight}; line-height: ${props => props.theme.baseFont.lineHeight};
color: ${props => props.theme.colors.text}; color: ${props => props.theme.colors.text};
display: flex; display: flex;
@ -41,7 +47,7 @@ export const RedocWrap = styled.div`
} }
`; `;
export const ApiContent = styled.div` export const ApiContentWrap = styled.div`
z-index: 1; z-index: 1;
position: relative; position: relative;
overflow: hidden; overflow: hidden;

View File

@ -1,8 +1,9 @@
import styled from '../../styled-components';
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import { ClassAttributes, HTMLAttributes } from 'react';
import { UnderlinedHeader } from '../../common-elements'; import { UnderlinedHeader } from '../../common-elements';
import { ResponseTitle } from './ResponseTitle'; import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
import { ResponseTitle, ResponseTitleProps } from './ResponseTitle';
export const StyledResponseTitle = styled(ResponseTitle)` export const StyledResponseTitle = styled(ResponseTitle)`
padding: 10px; padding: 10px;
@ -37,4 +38,5 @@ export const ResponseDetailsWrap = styled.div`
export const HeadersCaption = UnderlinedHeader.withComponent('caption').extend` export const HeadersCaption = UnderlinedHeader.withComponent('caption').extend`
text-align: left; text-align: left;
margin-top: 1em; margin-top: 1em;
caption-side: top;
`; `;

View File

@ -24,7 +24,11 @@ export class ObjectSchema extends React.Component<ObjectSchemaProps> {
} }
render() { render() {
const { schema: { fields = [] }, showTitle, discriminator } = this.props; const {
schema: { fields = [] },
showTitle,
discriminator,
} = this.props;
const needFilter = this.props.skipReadOnly || this.props.skipWriteOnly; const needFilter = this.props.skipReadOnly || this.props.skipWriteOnly;

View File

@ -16,7 +16,7 @@ export interface OneOfButtonProps {
} }
@observer @observer
export class OneOfButton extends React.PureComponent<OneOfButtonProps> { export class OneOfButton extends React.Component<OneOfButtonProps> {
render() { render() {
const { idx, schema, subSchema } = this.props; const { idx, schema, subSchema } = this.props;
return ( return (
@ -34,7 +34,10 @@ export class OneOfButton extends React.PureComponent<OneOfButtonProps> {
@observer @observer
export class OneOfSchema extends React.Component<SchemaProps> { export class OneOfSchema extends React.Component<SchemaProps> {
render() { render() {
const { schema: { oneOf }, schema } = this.props; const {
schema: { oneOf },
schema,
} = this.props;
if (oneOf === undefined) { if (oneOf === undefined) {
return null; return null;

View File

@ -40,6 +40,13 @@ export class Schema extends React.Component<Partial<SchemaProps>> {
} }
if (discriminatorProp !== undefined) { if (discriminatorProp !== undefined) {
if (!oneOf || !oneOf.length) {
throw new Error(
`Looks like you are using discriminator wrong: you don't have any definition inherited from the ${
schema.title
}`,
);
}
return ( return (
<ObjectSchema <ObjectSchema
{...{ ...this.props, schema: oneOf![schema.activeOneOf] }} {...{ ...this.props, schema: oneOf![schema.activeOneOf] }}

View File

@ -5,12 +5,18 @@ import { SearchStore } from '../../services/SearchStore';
import { MenuItem } from '../SideMenu/MenuItem'; import { MenuItem } from '../SideMenu/MenuItem';
import { MarkerService } from '../../services/MarkerService'; import { MarkerService } from '../../services/MarkerService';
import { SearchDocument } from '../../services/SearchWorker.worker'; import { SearchResult } from '../../services/SearchWorker.worker';
import { ClearIcon, SearchIcon, SearchInput, SearchResultsBox, SearchWrap } from './elements'; import {
ClearIcon,
SearchIcon,
SearchInput,
SearchResultsBox,
SearchWrap,
} from './styled.elements';
export interface SearchBoxProps { export interface SearchBoxProps {
search: SearchStore; search: SearchStore<string>;
marker: MarkerService; marker: MarkerService;
getItemById: (id: string) => IMenuItem | undefined; getItemById: (id: string) => IMenuItem | undefined;
onActivate: (item: IMenuItem) => void; onActivate: (item: IMenuItem) => void;
@ -19,16 +25,11 @@ export interface SearchBoxProps {
} }
export interface SearchBoxState { export interface SearchBoxState {
results: any; results: SearchResult[];
term: string; term: string;
activeItemIdx: number; activeItemIdx: number;
} }
interface SearchResult {
item: IMenuItem;
score: number;
}
export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxState> { export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxState> {
activeItemRef: MenuItem | null = null; activeItemRef: MenuItem | null = null;
@ -81,7 +82,7 @@ export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxStat
// enter // enter
const activeResult = this.state.results[this.state.activeItemIdx]; const activeResult = this.state.results[this.state.activeItemIdx];
if (activeResult) { if (activeResult) {
const item = this.props.getItemById(activeResult.id); const item = this.props.getItemById(activeResult.meta);
if (item) { if (item) {
this.props.onActivate(item); this.props.onActivate(item);
} }
@ -89,7 +90,7 @@ export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxStat
} }
}; };
setResults(results: SearchDocument[], term: string) { setResults(results: SearchResult[], term: string) {
this.setState({ this.setState({
results, results,
term, term,
@ -115,8 +116,8 @@ export class SearchBox extends React.PureComponent<SearchBoxProps, SearchBoxStat
render() { render() {
const { activeItemIdx } = this.state; const { activeItemIdx } = this.state;
const results: SearchResult[] = this.state.results.map(res => ({ const results = this.state.results.map(res => ({
item: this.props.getItemById(res.id), item: this.props.getItemById(res.meta)!,
score: res.score, score: res.score,
})); }));

View File

@ -1,5 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import styled from '../../styled-components';
import styled, { ResolvedThemeInterface, StyledComponentClass } from '../../styled-components';
import { MenuItemLabel } from '../SideMenu/styled.elements'; import { MenuItemLabel } from '../SideMenu/styled.elements';
export const SearchWrap = styled.div` export const SearchWrap = styled.div`

View File

@ -1,5 +1,6 @@
import { transparentize } from 'polished'; import { transparentize } from 'polished';
import * as React from 'react'; import * as React from 'react';
import styled from '../../styled-components'; import styled from '../../styled-components';
import { UnderlinedHeader } from '../../common-elements/headers'; import { UnderlinedHeader } from '../../common-elements/headers';

View File

@ -60,7 +60,7 @@ export class OAuthFlow extends React.PureComponent<OAuthFlowProps> {
<ul> <ul>
{Object.keys(flow!.scopes).map(scope => ( {Object.keys(flow!.scopes).map(scope => (
<li key={scope}> <li key={scope}>
<code>{scope}</code> - {flow!.scopes[scope]} <code>{scope}</code> - <Markdown inline={true} source={flow!.scopes[scope] || ''} />
</li> </li>
))} ))}
</ul> </ul>

View File

@ -6,7 +6,7 @@ import { IMenuItem, OperationModel } from '../../services';
import { MenuItems } from './MenuItems'; import { MenuItems } from './MenuItems';
import { MenuItemLabel, MenuItemLi, MenuItemTitle, OperationBadge } from './styled.elements'; import { MenuItemLabel, MenuItemLi, MenuItemTitle, OperationBadge } from './styled.elements';
interface MenuItemProps { export interface MenuItemProps {
item: IMenuItem; item: IMenuItem;
onActivate?: (item: IMenuItem) => void; onActivate?: (item: IMenuItem) => void;
withoutChildren?: boolean; withoutChildren?: boolean;
@ -47,10 +47,13 @@ export class MenuItem extends React.Component<MenuItemProps> {
data-item-id={item.id} data-item-id={item.id}
> >
{item.type === 'operation' ? ( {item.type === 'operation' ? (
<OperationMenuItemContent item={item as OperationModel} /> <OperationMenuItemContent {...this.props} item={item as OperationModel} />
) : ( ) : (
<MenuItemLabel depth={item.depth} active={item.active} type={item.type}> <MenuItemLabel depth={item.depth} active={item.active} type={item.type}>
<MenuItemTitle title={item.name}>{item.name}</MenuItemTitle> <MenuItemTitle title={item.name}>
{item.name}
{this.props.children}
</MenuItemTitle>
{(item.depth > 0 && {(item.depth > 0 &&
item.items.length > 0 && ( item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} /> <ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} />
@ -85,7 +88,10 @@ class OperationMenuItemContent extends React.Component<OperationMenuItemContentP
deprecated={item.deprecated} deprecated={item.deprecated}
> >
<OperationBadge type={item.httpVerb} /> <OperationBadge type={item.httpVerb} />
<MenuItemTitle width="calc(100% - 32px)">{item.name}</MenuItemTitle> <MenuItemTitle width="calc(100% - 32px)">
{item.name}
{this.props.children}
</MenuItemTitle>
</MenuItemLabel> </MenuItemLabel>
); );
} }

View File

@ -6,7 +6,7 @@ import { IMenuItem } from '../../services';
import { MenuItem } from './MenuItem'; import { MenuItem } from './MenuItem';
import { MenuItemUl } from './styled.elements'; import { MenuItemUl } from './styled.elements';
interface MenuItemsProps { export interface MenuItemsProps {
items: IMenuItem[]; items: IMenuItem[];
active?: boolean; active?: boolean;
onActivate?: (item: IMenuItem) => void; onActivate?: (item: IMenuItem) => void;

View File

@ -0,0 +1,4 @@
export * from './MenuItem';
export * from './MenuItems';
export * from './SideMenu';
export * from './styled.elements';

View File

@ -1,7 +1,14 @@
import * as classnames from 'classnames'; import * as classnames from 'classnames';
import * as React from 'react';
import { InterpolationFunction, Styles, ThemeProps } from 'styled-components';
import { deprecatedCss } from '../../common-elements'; import { deprecatedCss } from '../../common-elements';
import styled, { css, withProps } from '../../styled-components'; import styled, {
css,
ResolvedThemeInterface,
StyledComponentClass,
withProps,
} from '../../styled-components';
export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({ export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({
className: props => `operation-type ${props.type}`, className: props => `operation-type ${props.type}`,
@ -12,7 +19,7 @@ export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({
background-color: #333; background-color: #333;
border-radius: 3px; border-radius: 3px;
vertical-align: top; vertical-align: top;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAACgCAYAAADuDlcXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFNjQ5N0JDQUE3OTYxMUU0ODNGMUE0RUM3NjRDRTQyNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpFNjQ5N0JDQkE3OTYxMUU0ODNGMUE0RUM3NjRDRTQyNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU2NDk3QkM4QTc5NjExRTQ4M0YxQTRFQzc2NENFNDI3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU2NDk3QkM5QTc5NjExRTQ4M0YxQTRFQzc2NENFNDI3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+mIrGwQAAAZ9JREFUeNrsmtuOwyAMRBmU//9lbx9208ayjQ1EarSDVFW56ARIGGZIIK/S3gWvX3X7LN3a6WxDHdPnnDBpcZHEOe3wrmLUMg2zatKykPOq1/5fK71tLIQR9jjYsaJfWdWAAcRsM2W1z9LNGcFkRlmtPhvpf7qmHAGEESZqLFr/qbHaCy4Is6oxLdvT+nWr0lLPCCPsFn+mA5e2UjLycL1o6qLMiapqRGoifVCDinrgU2mRyJthzZg3CSPs+2HhIM4YGq0a4oDgiGjYTKw20/OwUzAEuXz73YSqtdsV+F1a3eZpweFEGGG7Y3ULbJRk4nYPlEHbUi86wpNtbz4oB37PICOrLEdC9DKzFv7EkQ8tYY8Nr8tuyJrRsdpMrIJ0n4GPBmGEEUbYzRMKnFwug1B7rppmbCiyBjBrQ1vC8KW/CxrF7osNrRbxMjofWsIIuwU2vapnZfTRq4/wFXl3hG9bMzP6ZWV47LoB+Gym1/EyUleKI2GEPW8pQpu80bHLvsifSWFVAVEzo2VDTxxb9T16eO7sF0vmxPNPxPFHgAEA/rGUMXq/uWcAAAAASUVORK5CYII="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAACgCAMAAADZ0KclAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAA80lEQVR42uSWSwLCIAxEX+5/aa2QZBJw5UIt9QMdRqSPEAAw/TyvqzZf150NzdXL49qreXwXjeqz9bqN1tgJl/KLyaVrrL7K7gx+1vlNMqy+helOO4rfBGYZiEkq1ubQ3DeKvc97Et+d+e01vIZlLZZqb1WNJFd8ZKYsmv4Hh3H2fDgjMUI5WSExjiEZs7rEZ5T+/jQn9lhgsw53j/e9MQtxqPsbZY54M5fNl/MY/f1s7NbRSkYlYjc0KPsWMrmhIU9933ywxDiSE+upYNH8TdusUotllNvcAUzfnE/NC4OSYyklQhpdl9E4Tw0Cm4/G9xBgAO7VCkjWLOMfAAAAAElFTkSuQmCC");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 6px 4px; background-position: 6px 4px;
text-indent: -9000px; text-indent: -9000px;
@ -58,6 +65,11 @@ export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({
background-position: 4px -131px; background-position: 4px -131px;
background-color: ${props => props.theme.colors.http.link}; background-color: ${props => props.theme.colors.http.link};
} }
&.head {
background-position: 6px -102px;
background-color: ${props => props.theme.colors.http.head};
}
`; `;
function menuItemActiveBg(depth): string { function menuItemActiveBg(depth): string {

View File

@ -114,7 +114,7 @@ export class StickyResponsiveSidebar extends React.Component<StickySidebarProps>
style={style(options)} style={style(options)}
// tslint:disable-next-line // tslint:disable-next-line
innerRef={el => { innerRef={el => {
this.stickyElement = el; this.stickyElement = el as any;
}} }}
> >
{this.props.children} {this.props.children}

View File

@ -5,7 +5,7 @@ import { RedocRawOptions } from '../services/RedocNormalizedOptions';
import { OpenAPISpec } from '../types'; import { OpenAPISpec } from '../types';
import { loadAndBundleSpec } from '../utils'; import { loadAndBundleSpec } from '../utils';
interface StoreProviderProps { export interface StoreProviderProps {
specUrl?: string; specUrl?: string;
spec?: object; spec?: object;
store?: AppStore; store?: AppStore;
@ -15,7 +15,7 @@ interface StoreProviderProps {
children: (props: { loading: boolean; store?: AppStore }) => any; children: (props: { loading: boolean; store?: AppStore }) => any;
} }
interface StoreProviderState { export interface StoreProviderState {
error?: Error; error?: Error;
loading: boolean; loading: boolean;
store?: AppStore; store?: AppStore;

View File

@ -1,12 +1,14 @@
import * as React from 'react'; /* tslint:disable:no-implicit-dependencies */
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json'; import toJson from 'enzyme-to-json';
import * as React from 'react';
import { filterPropsDeep } from '../../utils/test-utils'; import { filterPropsDeep } from '../../utils/test-utils';
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions'; import { ObjectSchema, Schema } from '../';
import { OpenAPIParser, SchemaModel } from '../../services'; import { OpenAPIParser, SchemaModel } from '../../services';
import { Schema, ObjectSchema } from '../'; import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';
import * as simpleDiscriminatorFixture from './fixtures/simple-discriminator.json'; import * as simpleDiscriminatorFixture from './fixtures/simple-discriminator.json';
const options = new RedocNormalizedOptions({}); const options = new RedocNormalizedOptions({});

View File

@ -1,5 +1,7 @@
import * as React from 'react'; /* tslint:disable:no-implicit-dependencies */
import { mount, ReactWrapper } from 'enzyme'; import { mount, ReactWrapper } from 'enzyme';
import * as React from 'react';
import { JsonViewer } from '../'; import { JsonViewer } from '../';
import { withTheme } from '../testProviders'; import { withTheme } from '../testProviders';

View File

@ -1,12 +1,14 @@
import * as React from 'react'; /* tslint:disable:no-implicit-dependencies */
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json'; import toJson from 'enzyme-to-json';
import * as React from 'react';
import { filterPropsDeep } from '../../utils/test-utils'; import { filterPropsDeep } from '../../utils/test-utils';
import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions'; import { OneOfSchema, Schema } from '../';
import { OpenAPIParser, SchemaModel } from '../../services'; import { OpenAPIParser, SchemaModel } from '../../services';
import { Schema, OneOfSchema } from '../'; import { RedocNormalizedOptions } from '../../services/RedocNormalizedOptions';
const options = new RedocNormalizedOptions({}); const options = new RedocNormalizedOptions({});
describe('Components', () => { describe('Components', () => {

View File

@ -11,6 +11,7 @@ exports[`Components SchemaView discriminator should correctly render discriminat
"example": undefined, "example": undefined,
"expanded": false, "expanded": false,
"in": undefined, "in": undefined,
"kind": "field",
"name": "packSize", "name": "packSize",
"required": false, "required": false,
"schema": SchemaModel { "schema": SchemaModel {
@ -57,6 +58,7 @@ exports[`Components SchemaView discriminator should correctly render discriminat
"example": undefined, "example": undefined,
"expanded": false, "expanded": false,
"in": undefined, "in": undefined,
"kind": "field",
"name": "type", "name": "type",
"required": true, "required": true,
"schema": SchemaModel { "schema": SchemaModel {

View File

@ -1,6 +1,9 @@
export * from './RedocStandalone'; export * from './RedocStandalone';
export * from './Redoc/Redoc'; export * from './Redoc/Redoc';
// export * from './Redoc/elements'; export * from './ApiInfo/ApiInfo';
export * from './ApiLogo/ApiLogo';
export * from './ContentItems/ContentItems';
export { ApiContentWrap, BackgroundStub, RedocWrap } from './Redoc/styled.elements';
export * from './Schema/'; export * from './Schema/';
export * from './SearchBox/SearchBox'; export * from './SearchBox/SearchBox';
export * from './Operation/Operation'; export * from './Operation/Operation';
@ -10,4 +13,7 @@ export * from './JsonViewer';
export * from './ErrorBoundary'; export * from './ErrorBoundary';
export * from './StoreProvider'; export * from './StoreProvider';
// re-export the rest of components export * from './OptionsProvider';
export * from './SideMenu/';
export * from './StickySidebar/StickyResponsiveSidebar';
export * from './SearchBox/SearchBox';

View File

@ -1,3 +1,6 @@
export * from './components'; export * from './components';
export * from './services'; export * from './services';
export * from './utils'; export * from './utils';
export * from './styled-components';
export { default as styled } from './styled-components';

View File

@ -49,7 +49,7 @@ export class AppStore {
spec: SpecStore; spec: SpecStore;
rawOptions: RedocRawOptions; rawOptions: RedocRawOptions;
options: RedocNormalizedOptions; options: RedocNormalizedOptions;
search: SearchStore; search: SearchStore<string>;
marker = new MarkerService(); marker = new MarkerService();
private scroll: ScrollService; private scroll: ScrollService;

View File

@ -8,7 +8,7 @@ function isSameHash(a: string, b: string): boolean {
return a === b || '#' + a === b || a === '#' + b; return a === b || '#' + a === b || a === '#' + b;
} }
class IntHistoryService { export class IntHistoryService {
private causedHashChange: boolean = false; private causedHashChange: boolean = false;
private _emiter; private _emiter;

View File

@ -19,7 +19,7 @@ export function buildComponentComment(name: string) {
return `<!-- ReDoc-Inject: <${name}> -->`; return `<!-- ReDoc-Inject: <${name}> -->`;
} }
interface MarkdownHeading { export interface MarkdownHeading {
id: string; id: string;
name: string; name: string;
items?: MarkdownHeading[]; items?: MarkdownHeading[];

View File

@ -46,8 +46,8 @@ export class OpenAPIParser {
constructor( constructor(
spec: OpenAPISpec, spec: OpenAPISpec,
specUrl: string | undefined, specUrl?: string,
private options: RedocNormalizedOptions, private options: RedocNormalizedOptions = new RedocNormalizedOptions({}),
) { ) {
this.validate(spec); this.validate(spec);
this.preprocess(spec); this.preprocess(spec);
@ -166,6 +166,13 @@ export class OpenAPIParser {
return obj; return obj;
} }
shalowDeref<T extends object>(obj: OpenAPIRef | T): T {
if (this.isRef(obj)) {
return this.byRef<T>(obj.$ref)!;
}
return obj;
}
/** /**
* Merge allOf contsraints. * Merge allOf contsraints.
* @param schema schema with allOF * @param schema schema with allOF

View File

@ -14,6 +14,8 @@ export interface RedocRawOptions {
untrustedSpec?: boolean | string; untrustedSpec?: boolean | string;
hideLoading?: boolean | string; hideLoading?: boolean | string;
hideDownloadButton?: boolean | string; hideDownloadButton?: boolean | string;
unstable_ignoreMimeParameters?: boolean;
} }
function argValueToBoolean(val?: string | boolean): boolean { function argValueToBoolean(val?: string | boolean): boolean {
@ -92,6 +94,9 @@ export class RedocNormalizedOptions {
untrustedSpec: boolean; untrustedSpec: boolean;
hideDownloadButton: boolean; hideDownloadButton: boolean;
/* tslint:disable-next-line */
unstable_ignoreMimeParameters: boolean;
constructor(raw: RedocRawOptions) { constructor(raw: RedocRawOptions) {
this.theme = resolveTheme(mergeObjects({} as any, defaultTheme, raw.theme || {})); this.theme = resolveTheme(mergeObjects({} as any, defaultTheme, raw.theme || {}));
this.scrollYOffset = RedocNormalizedOptions.normalizeScrollYOffset(raw.scrollYOffset); this.scrollYOffset = RedocNormalizedOptions.normalizeScrollYOffset(raw.scrollYOffset);
@ -103,5 +108,7 @@ export class RedocNormalizedOptions {
this.pathInMiddlePanel = argValueToBoolean(raw.pathInMiddlePanel); this.pathInMiddlePanel = argValueToBoolean(raw.pathInMiddlePanel);
this.untrustedSpec = argValueToBoolean(raw.untrustedSpec); this.untrustedSpec = argValueToBoolean(raw.untrustedSpec);
this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton); this.hideDownloadButton = argValueToBoolean(raw.hideDownloadButton);
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
} }
} }

View File

@ -2,7 +2,9 @@ import { IS_BROWSER } from '../utils/';
import { IMenuItem } from './MenuStore'; import { IMenuItem } from './MenuStore';
import { OperationModel } from './models'; import { OperationModel } from './models';
let worker; import Worker, { SearchDocument, SearchResult } from './SearchWorker.worker';
let worker: new () => Worker;
if (IS_BROWSER) { if (IS_BROWSER) {
try { try {
@ -15,7 +17,7 @@ if (IS_BROWSER) {
worker = require('./SearchWorker.worker').default; worker = require('./SearchWorker.worker').default;
} }
export class SearchStore { export class SearchStore<T> {
searchWorker = new worker(); searchWorker = new worker();
indexItems(groups: Array<IMenuItem | OperationModel>) { indexItems(groups: Array<IMenuItem | OperationModel>) {
@ -32,12 +34,12 @@ export class SearchStore {
this.searchWorker.done(); this.searchWorker.done();
} }
add(title: string, body: string, ref: string) { add(title: string, body: string, meta?: T) {
this.searchWorker.add(title, body, ref); this.searchWorker.add(title, body, meta);
} }
search(q: string) { search(q: string) {
return this.searchWorker.search(q); return this.searchWorker.search<T>(q);
} }
async toJS() { async toJS() {

View File

@ -2,9 +2,9 @@ import * as lunr from 'lunr';
/* just for better typings */ /* just for better typings */
export default class Worker { export default class Worker {
add = add; add: typeof add = add;
done = done; done = done;
search = search; search: typeof search = search;
toJS = toJS; toJS = toJS;
load = load; load = load;
} }
@ -15,11 +15,12 @@ export interface SearchDocument {
id: string; id: string;
} }
export interface SearchResult extends SearchDocument { export interface SearchResult<T = string> {
meta: T;
score: number; score: number;
} }
let store: { [id: string]: SearchDocument } = {}; let store: any[] = [];
let resolveIndex: (v: lunr.Index) => void = () => { let resolveIndex: (v: lunr.Index) => void = () => {
throw new Error('Should not be called'); throw new Error('Should not be called');
@ -29,19 +30,21 @@ const index: Promise<lunr.Index> = new Promise(resolve => {
resolveIndex = resolve; resolveIndex = resolve;
}); });
lunr.tokenizer.separator = /\s+/;
const builder = new lunr.Builder(); const builder = new lunr.Builder();
builder.field('title'); builder.field('title');
builder.field('description'); builder.field('description');
builder.ref('id'); builder.ref('ref');
builder.pipeline.add(lunr.trimmer, lunr.stopWordFilter, lunr.stemmer); builder.pipeline.add(lunr.trimmer, lunr.stopWordFilter, lunr.stemmer);
const expandTerm = term => '*' + lunr.stemmer(new lunr.Token(term, {})) + '*'; const expandTerm = term => '*' + lunr.stemmer(new lunr.Token(term, {})) + '*';
export function add(title: string, description: string, id: string) { export function add<T>(title: string, description: string, meta?: T) {
const item = { title, description, id }; const ref = store.push(meta) - 1;
const item = { title: title.toLowerCase(), description: description.toLowerCase(), ref };
builder.add(item); builder.add(item);
store[id] = item;
} }
export async function done() { export async function done() {
@ -60,20 +63,28 @@ export async function load(state: any) {
resolveIndex(lunr.Index.load(state.index)); resolveIndex(lunr.Index.load(state.index));
} }
export async function search(q: string): Promise<SearchResult[]> { export async function search<Meta = string>(
q: string,
limit = 0,
): Promise<Array<SearchResult<Meta>>> {
if (q.trim().length === 0) { if (q.trim().length === 0) {
return []; return [];
} }
return (await index) let searchResults = (await index).query(t => {
.query(t => { q
q .trim()
.trim() .toLowerCase()
.split(/\s+/) .split(/\s+/)
.forEach(term => { .forEach(term => {
const exp = expandTerm(term); const exp = expandTerm(term);
t.term(exp, {}); t.term(exp, {});
}); });
}) });
.map(res => ({ ...store[res.ref], score: res.score }));
if (limit > 0) {
searchResults = searchResults.slice(0, limit);
}
return searchResults.map(res => ({ meta: store[res.ref], score: res.score }));
} }

View File

@ -1,9 +1,8 @@
import { computed, observable } from 'mobx'; import { computed, observable } from 'mobx';
import { OpenAPISpec } from '../types'; import { OpenAPIExternalDocumentation, OpenAPISpec } from '../types';
// import { OpenAPIExternalDocumentation, OpenAPIInfo } from '../types';
import { MenuBuilder } from './MenuBuilder'; import { MenuBuilder } from './MenuBuilder';
import { GroupModel, OperationModel } from './models/';
import { ApiInfoModel } from './models/ApiInfo'; import { ApiInfoModel } from './models/ApiInfo';
import { SecuritySchemesModel } from './models/SecuritySchemes'; import { SecuritySchemesModel } from './models/SecuritySchemes';
import { OpenAPIParser } from './OpenAPIParser'; import { OpenAPIParser } from './OpenAPIParser';

View File

@ -19,14 +19,16 @@ export class FieldModel {
example?: string; example?: string;
deprecated: boolean; deprecated: boolean;
in?: string; in?: string;
kind: string;
constructor( constructor(
parser: OpenAPIParser, parser: OpenAPIParser,
infoOrRef: Referenced<OpenAPIParameter> & { name?: string }, infoOrRef: Referenced<OpenAPIParameter> & { name?: string; kind?: string },
pointer: string, pointer: string,
options: RedocNormalizedOptions, options: RedocNormalizedOptions,
) { ) {
const info = parser.deref<OpenAPIParameter>(infoOrRef); const info = parser.deref<OpenAPIParameter>(infoOrRef);
this.kind = infoOrRef.kind || 'field';
this.name = infoOrRef.name || info.name; this.name = infoOrRef.name || info.name;
this.in = info.in; this.in = info.in;
this.required = !!info.required; this.required = !!info.required;

View File

@ -3,12 +3,13 @@ import { action, computed, observable } from 'mobx';
import { OpenAPIMediaType } from '../../types'; import { OpenAPIMediaType } from '../../types';
import { MediaTypeModel } from './MediaType'; import { MediaTypeModel } from './MediaType';
import { mergeSimilarMediaTypes } from '../../utils';
import { OpenAPIParser } from '../OpenAPIParser'; import { OpenAPIParser } from '../OpenAPIParser';
import { RedocNormalizedOptions } from '../RedocNormalizedOptions'; import { RedocNormalizedOptions } from '../RedocNormalizedOptions';
/** /**
* MediaContent model ready to be sued by React components * MediaContent model ready to be sued by React components
* Contains multiple MediaTypes and keeps track of the currently active on * Contains multiple MediaTypes and keeps track of the currently active one
*/ */
export class MediaContentModel { export class MediaContentModel {
mediaTypes: MediaTypeModel[]; mediaTypes: MediaTypeModel[];
@ -20,10 +21,13 @@ export class MediaContentModel {
*/ */
constructor( constructor(
public parser: OpenAPIParser, public parser: OpenAPIParser,
info: { [mime: string]: OpenAPIMediaType }, info: Dict<OpenAPIMediaType>,
public isRequestType: boolean, public isRequestType: boolean,
options: RedocNormalizedOptions, options: RedocNormalizedOptions,
) { ) {
if (options.unstable_ignoreMimeParameters) {
info = mergeSimilarMediaTypes(info);
}
this.mediaTypes = Object.keys(info).map(name => { this.mediaTypes = Object.keys(info).map(name => {
const mime = info[name]; const mime = info[name];
// reset deref cache just in case something is left there // reset deref cache just in case something is left there

View File

@ -12,6 +12,7 @@ import {
getOperationSummary, getOperationSummary,
isAbsolutePath, isAbsolutePath,
JsonPointer, JsonPointer,
mergeParams,
sortByRequired, sortByRequired,
stripTrailingSlash, stripTrailingSlash,
} from '../../utils'; } from '../../utils';
@ -65,7 +66,9 @@ export class OperationModel implements IMenuItem {
this.id = this.id =
operationSpec.operationId !== undefined operationSpec.operationId !== undefined
? 'operation/' + operationSpec.operationId ? 'operation/' + operationSpec.operationId
: this.parent !== undefined ? this.parent.id + operationSpec._$ref : operationSpec._$ref; : this.parent !== undefined
? this.parent.id + operationSpec._$ref
: operationSpec._$ref;
this.name = getOperationSummary(operationSpec); this.name = getOperationSummary(operationSpec);
this.description = operationSpec.description; this.description = operationSpec.description;
@ -83,9 +86,11 @@ export class OperationModel implements IMenuItem {
this.codeSamples = operationSpec['x-code-samples'] || []; this.codeSamples = operationSpec['x-code-samples'] || [];
this.path = JsonPointer.baseName(this._$ref, 2); this.path = JsonPointer.baseName(this._$ref, 2);
this.parameters = operationSpec.pathParameters this.parameters = mergeParams(
.concat(operationSpec.parameters || []) parser,
.map(paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options)); operationSpec.pathParameters,
operationSpec.parameters,
).map(paramOrRef => new FieldModel(parser, paramOrRef, this._$ref, options));
if (options.requiredPropsFirst) { if (options.requiredPropsFirst) {
sortByRequired(this.parameters); sortByRequired(this.parameters);

View File

@ -111,7 +111,7 @@ export class SchemaModel {
return; return;
} }
if (!isChild && schema.discriminator !== undefined) { if (!isChild && getDiscriminator(schema) !== undefined) {
this.initDiscriminator(schema, parser); this.initDiscriminator(schema, parser);
return; return;
} }
@ -171,7 +171,8 @@ export class SchemaModel {
}, },
parser: OpenAPIParser, parser: OpenAPIParser,
) { ) {
this.discriminatorProp = schema.discriminator!.propertyName; const discriminator = getDiscriminator(schema)!;
this.discriminatorProp = discriminator.propertyName;
const derived = parser.findDerived([...(schema.parentRefs || []), this._$ref]); const derived = parser.findDerived([...(schema.parentRefs || []), this._$ref]);
if (schema.oneOf) { if (schema.oneOf) {
@ -184,7 +185,7 @@ export class SchemaModel {
} }
} }
const mapping = schema.discriminator!.mapping || {}; const mapping = discriminator.mapping || {};
for (const name in mapping) { for (const name in mapping) {
derived[mapping[name]] = name; derived[mapping[name]] = name;
} }
@ -244,9 +245,10 @@ function buildFields(
new FieldModel( new FieldModel(
parser, parser,
{ {
name: '[property name] *', name: 'property name *',
required: false, required: false,
schema: additionalProps, schema: additionalProps,
kind: 'additionalProperties',
}, },
$ref + '/additionalProperties', $ref + '/additionalProperties',
options, options,
@ -256,3 +258,7 @@ function buildFields(
return fields; return fields;
} }
function getDiscriminator(schema: OpenAPISchema): OpenAPISchema['discriminator'] {
return schema.discriminator || schema['x-discriminator'];
}

View File

@ -2,7 +2,7 @@ import { OpenAPISecurityRequirement } from '../../types';
import { SECURITY_SCHEMES_SECTION } from '../../utils/openapi'; import { SECURITY_SCHEMES_SECTION } from '../../utils/openapi';
import { OpenAPIParser } from '../OpenAPIParser'; import { OpenAPIParser } from '../OpenAPIParser';
interface SecurityScheme { export interface SecurityScheme {
id: string; id: string;
sectionId: string; sectionId: string;
type: string; type: string;

View File

@ -1,7 +1,12 @@
import { ComponentClass, StatelessComponent } from 'react';
import * as styledComponents from 'styled-components'; import * as styledComponents from 'styled-components';
import { ResolvedThemeInterface } from './theme'; import { ResolvedThemeInterface } from './theme';
export { ResolvedThemeInterface };
export type InterpolationFunction<P> = styledComponents.InterpolationFunction<P>;
export type StyledFunction<T> = styledComponents.ThemedStyledFunction<T, ResolvedThemeInterface>; export type StyledFunction<T> = styledComponents.ThemedStyledFunction<T, ResolvedThemeInterface>;
function withProps<T, U extends HTMLElement = HTMLElement>( function withProps<T, U extends HTMLElement = HTMLElement>(
@ -16,10 +21,9 @@ const {
injectGlobal, injectGlobal,
keyframes, keyframes,
ThemeProvider, ThemeProvider,
withTheme, } = (styledComponents as any) as styledComponents.ThemedStyledComponentsModule<
} = (styledComponents as styledComponents.ThemedStyledComponentsModule< ResolvedThemeInterface
any >;
>) as styledComponents.ThemedStyledComponentsModule<ResolvedThemeInterface>;
export const media = { export const media = {
lessThan(breakpoint) { lessThan(breakpoint) {
@ -49,6 +53,6 @@ export const media = {
}, },
}; };
export { css, injectGlobal, keyframes, ThemeProvider, withTheme, withProps }; export { css, injectGlobal, keyframes, ThemeProvider, withProps };
export { StyledComponentClass } from 'styled-components'; export { StyledComponentClass } from 'styled-components';
export default styled; export default styled;

View File

@ -14,6 +14,8 @@ const defaultTheme: ThemeInterface = {
error: '#e53935', error: '#e53935',
info: '#87ceeb', info: '#87ceeb',
text: '#263238', text: '#263238',
code: '#e53935',
codeBg: 'rgba(38, 50, 56, 0.04)',
warning: '#f1c400', warning: '#f1c400',
http: { http: {
get: '#6bbd5b', get: '#6bbd5b',
@ -24,6 +26,7 @@ const defaultTheme: ThemeInterface = {
delete: '#e27a7a', delete: '#e27a7a',
basic: '#999', basic: '#999',
link: '#31bbb6', link: '#31bbb6',
head: '#c167e4',
}, },
}, },
schemaView: { schemaView: {
@ -32,6 +35,7 @@ const defaultTheme: ThemeInterface = {
typeNameColor: theme => transparentize(0.2, theme.colors.text), typeNameColor: theme => transparentize(0.2, theme.colors.text),
typeTitleColor: theme => theme.schemaView.typeNameColor, typeTitleColor: theme => theme.schemaView.typeNameColor,
requireLabelColor: theme => theme.colors.error, requireLabelColor: theme => theme.colors.error,
nestingSpacing: '1em',
}, },
baseFont: { baseFont: {
size: '14px', size: '14px',
@ -120,6 +124,8 @@ export interface ResolvedThemeInterface {
error: string; error: string;
info: string; info: string;
text: string; text: string;
code: string;
codeBg: string;
warning: string; warning: string;
http: { http: {
get: string; get: string;
@ -130,6 +136,7 @@ export interface ResolvedThemeInterface {
delete: string; delete: string;
basic: string; basic: string;
link: string; link: string;
head: string;
}; };
}; };
schemaView: { schemaView: {
@ -138,6 +145,7 @@ export interface ResolvedThemeInterface {
typeNameColor: string; typeNameColor: string;
typeTitleColor: string; typeTitleColor: string;
requireLabelColor: string; requireLabelColor: string;
nestingSpacing: string;
}; };
baseFont: { baseFont: {
size: string; size: string;
@ -180,5 +188,5 @@ export type primitive = string | number | boolean | undefined | null;
export type AdvancedThemeDeep<T> = T extends primitive export type AdvancedThemeDeep<T> = T extends primitive
? T | ((theme: ResolvedThemeInterface) => T) ? T | ((theme: ResolvedThemeInterface) => T)
: AdvancedThemeObject<T>; : AdvancedThemeObject<T>;
export type AdvancedThemeObject<T> = { [P in keyof T]: AdvancedThemeDeep<T[P]> }; export type AdvancedThemeObject<T> = { [P in keyof T]?: AdvancedThemeDeep<T[P]> };
export type ThemeInterface = AdvancedThemeObject<ResolvedThemeInterface>; export type ThemeInterface = AdvancedThemeObject<ResolvedThemeInterface>;

View File

@ -1,5 +1,3 @@
export * from './open-api'; export * from './open-api';
export type Diff<T extends string, U extends string> = ({ [P in T]: P } & export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
{ [P in U]: never } & { [x: string]: never })[T];
export type Omit<T, K extends keyof T> = { [P in Diff<keyof T, K>]: T[P] };

View File

@ -1,4 +1,4 @@
import { Omit } from './'; import { Omit } from './index';
export interface OpenAPISpec { export interface OpenAPISpec {
openapi: string; openapi: string;

View File

@ -4,8 +4,12 @@ import {
getStatusCodeType, getStatusCodeType,
isOperationName, isOperationName,
isPrimitiveType, isPrimitiveType,
mergeParams,
} from '../'; } from '../';
import { OpenAPIParser } from '../../services';
import { OpenAPIParameter } from '../../types';
describe('Utils', () => { describe('Utils', () => {
describe('openapi getStatusCode', () => { describe('openapi getStatusCode', () => {
it('Should return info for status codes within 100 and 200', () => { it('Should return info for status codes within 100 and 200', () => {
@ -183,4 +187,39 @@ describe('Utils', () => {
expect(isPrimitiveType(schema)).toEqual(false); expect(isPrimitiveType(schema)).toEqual(false);
}); });
}); });
describe('openapi mergeParams', () => {
it('Should deduplicate params with same "name" and "in"', () => {
const pathParams: OpenAPIParameter[] = [
{
name: 'param1',
in: 'path',
description: 'path',
},
{
name: 'param2',
in: 'path',
},
];
const operationParams: OpenAPIParameter[] = [
{
name: 'param1',
in: 'path',
description: 'oper',
},
{
name: 'param2',
in: 'query',
},
];
const parser = new OpenAPIParser({ openapi: '3.0' } as any);
const res = mergeParams(parser, pathParams, operationParams) as OpenAPIParameter[];
expect(res).toHaveLength(3);
expect(res[0]).toEqual(pathParams[1]);
expect(res[1]).toEqual(operationParams[0]);
expect(res[2]).toEqual(operationParams[1]);
});
});
}); });

View File

@ -1,12 +1,14 @@
import * as Prism from 'prismjs'; import * as Prism from 'prismjs';
import 'prismjs/components/prism-bash.js'; import 'prismjs/components/prism-bash.js';
import 'prismjs/components/prism-c.js'; import 'prismjs/components/prism-c.js';
import 'prismjs/components/prism-clike.js';
import 'prismjs/components/prism-coffeescript.js'; import 'prismjs/components/prism-coffeescript.js';
import 'prismjs/components/prism-cpp.js'; import 'prismjs/components/prism-cpp.js';
import 'prismjs/components/prism-csharp.js'; import 'prismjs/components/prism-csharp.js';
import 'prismjs/components/prism-go.js'; import 'prismjs/components/prism-go.js';
import 'prismjs/components/prism-java.js'; import 'prismjs/components/prism-java.js';
import 'prismjs/components/prism-lua.js'; import 'prismjs/components/prism-lua.js';
import 'prismjs/components/prism-markup-templating.js'; // dep of php
import 'prismjs/components/prism-markup.js'; // xml import 'prismjs/components/prism-markup.js'; // xml
import 'prismjs/components/prism-objectivec.js'; import 'prismjs/components/prism-objectivec.js';
import 'prismjs/components/prism-perl.js'; import 'prismjs/components/prism-perl.js';

View File

@ -1,4 +1,11 @@
import { OpenAPIOperation, OpenAPISchema } from '../types'; import { OpenAPIParser } from '../services/OpenAPIParser';
import {
OpenAPIMediaType,
OpenAPIOperation,
OpenAPIParameter,
OpenAPISchema,
Referenced,
} from '../types';
export function getStatusCodeType(statusCode: string | number, defaultAsError = false): string { export function getStatusCodeType(statusCode: string | number, defaultAsError = false): string {
if (statusCode === 'default') { if (statusCode === 'default') {
@ -178,4 +185,40 @@ export function sortByRequired(
}); });
} }
export function mergeParams(
parser: OpenAPIParser,
pathParams: Array<Referenced<OpenAPIParameter>> = [],
operationParams: Array<Referenced<OpenAPIParameter>> = [],
): Array<Referenced<OpenAPIParameter>> {
const operationParamNames = {};
operationParams.forEach(param => {
param = parser.shalowDeref(param);
operationParamNames[param.name + '_' + param.in] = true;
});
// filter out path params overriden by operation ones with the same name
pathParams = pathParams.filter(param => {
param = parser.shalowDeref(param);
return !operationParamNames[param.name + '_' + param.in];
});
return pathParams.concat(operationParams);
}
export function mergeSimilarMediaTypes(types: Dict<OpenAPIMediaType>): Dict<OpenAPIMediaType> {
const mergedTypes = {};
Object.keys(types).forEach(name => {
const mime = types[name];
// ignore content type parameters (e.g. charset) and merge
const normalizedMimeName = name.split(';')[0].trim();
if (!mergedTypes[normalizedMimeName]) {
mergedTypes[normalizedMimeName] = mime;
return;
}
mergedTypes[normalizedMimeName] = { ...mergedTypes[normalizedMimeName], ...mime };
});
return mergedTypes;
}
export const SECURITY_SCHEMES_SECTION = 'section/Authentication/'; export const SECURITY_SCHEMES_SECTION = 'section/Authentication/';

View File

@ -1,20 +1,24 @@
/* tslint:disable:no-implicit-dependencies */
import { has, set } from 'lodash';
import { instanceOf } from 'prop-types'; import { instanceOf } from 'prop-types';
import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions'; import { RedocNormalizedOptions } from '../services/RedocNormalizedOptions';
import { set, has } from 'lodash';
function traverseComponent(root, fn) { function traverseComponent(root, fn) {
if (!root) return; if (!root) {
return;
}
fn(root); fn(root);
if (root.children) { if (root.children) {
for (let child of root.children) { for (const child of root.children) {
traverseComponent(child, fn); traverseComponent(child, fn);
} }
} }
} }
export function filterPropsDeep<T extends Object>(component: T, paths: string[]): T { export function filterPropsDeep<T extends object>(component: T, paths: string[]): T {
traverseComponent(component, comp => { traverseComponent(component, comp => {
if (comp.props) { if (comp.props) {
for (const path of paths) { for (const path of paths) {

View File

@ -7,7 +7,7 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"strictNullChecks": true, "strictNullChecks": true,
"sourceMap": true, "sourceMap": true,
// "declaration": true, "declaration": true,
"noEmitHelpers": true, "noEmitHelpers": true,
"importHelpers": true, "importHelpers": true,
"outDir": "lib", "outDir": "lib",
@ -35,8 +35,7 @@
"include": [ "include": [
"./custom.d.ts", "./custom.d.ts",
"./demo/playground/hmr-playground.tsx", "./demo/playground/hmr-playground.tsx",
"./src/index.ts", "./src/**/*.ts?",
"./src/standalone.tsx",
"demo/*.tsx" "demo/*.tsx"
] ]
} }

10
tsconfig.lib.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declarationDir": "typings"
},
"include": [
"./custom.d.ts",
"src/index.ts"
]
}

View File

@ -17,7 +17,7 @@
"quotemark": [true, "single", "avoid-template", "jsx-double"], "quotemark": [true, "single", "avoid-template", "jsx-double"],
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"], "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
"arrow-parens": [true, "ban-single-arg-parens"], "arrow-parens": [true, "ban-single-arg-parens"],
"no-submodule-imports": [true, "prismjs", "perfect-scrollbar"], "no-submodule-imports": [true, "prismjs", "perfect-scrollbar", "react-dom", "core-js"],
"object-literal-key-quotes": [true, "as-needed"], "object-literal-key-quotes": [true, "as-needed"],
"no-unused-expression": [true, "allow-tagged-template"], "no-unused-expression": [true, "allow-tagged-template"],
"semicolon": [true, "always", "ignore-bound-class-methods"], "semicolon": [true, "always", "ignore-bound-class-methods"],

View File

@ -1,6 +1,8 @@
import * as webpack from 'webpack'; /* tslint:disable:no-implicit-dependencies */
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import * as ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
import * as webpack from 'webpack';
import * as path from 'path'; import * as path from 'path';
const nodeExternals = require('webpack-node-externals')({ const nodeExternals = require('webpack-node-externals')({
@ -54,8 +56,12 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
} }
: (context, request, callback) => { : (context, request, callback) => {
// ignore node-fetch dep of swagger2openapi as it is not used // ignore node-fetch dep of swagger2openapi as it is not used
if (/node-fetch$/i.test(request)) return callback(null, 'var undefined'); if (/node-fetch$/i.test(request)) {
if (/esprima$/i.test(request)) return callback(null, 'var undefined'); return callback(null, 'var undefined');
}
if (/esprima$/i.test(request)) {
return callback(null, 'var undefined');
}
return nodeExternals(context, request, callback); return nodeExternals(context, request, callback);
}, },
@ -69,6 +75,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
options: { options: {
compilerOptions: { compilerOptions: {
module: 'es2015', module: 'es2015',
declaration: false,
}, },
}, },
}, },
@ -77,7 +84,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
options: { options: {
plugins: [ plugins: [
'@babel/plugin-syntax-typescript', '@babel/plugin-syntax-typescript',
'@babel/plugin-syntax-decorators', ['@babel/plugin-syntax-decorators', { legacy: true }],
'@babel/plugin-syntax-jsx', '@babel/plugin-syntax-jsx',
[ [
'babel-plugin-styled-components', 'babel-plugin-styled-components',
@ -127,7 +134,7 @@ export default (env: { standalone?: boolean } = {}, { mode }) => ({
new webpack.BannerPlugin(BANNER), new webpack.BannerPlugin(BANNER),
ignore(/js-yaml\/dumper\.js$/), ignore(/js-yaml\/dumper\.js$/),
ignore(/json-schema-ref-parser\/lib\/dereference\.js/), ignore(/json-schema-ref-parser\/lib\/dereference\.js/),
ignore(/^\.\/SearchWorker\.worker$/), env.standalone ? ignore(/^\.\/SearchWorker\.worker$/) : ignore(/$non-existing^/),
], ],
}); });

2840
yarn.lock

File diff suppressed because it is too large Load Diff