From 8fddb1bf64122b23dab41585f3957d50da6ffa16 Mon Sep 17 00:00:00 2001 From: friej715 Date: Sat, 11 Apr 2020 14:36:36 -0400 Subject: [PATCH 01/12] first tiny pass at swagger page --- package.json | 1 + src/components/common/swagger-sandbox.js | 11 +++++++ src/pages/data/api-sandbox.js | 41 ++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 src/components/common/swagger-sandbox.js create mode 100644 src/pages/data/api-sandbox.js diff --git a/package.json b/package.json index 9c26080bd..ed445d7f5 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "react-typography": "^0.16.19", "reflexbox": "^4.0.6", "slugify": "^1.4.0", + "swagger-ui-react": "^3.25.0", "typography": "^0.16.19", "understory": "^1.11.0" }, diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js new file mode 100644 index 000000000..b8d1a7f24 --- /dev/null +++ b/src/components/common/swagger-sandbox.js @@ -0,0 +1,11 @@ +import React from 'react' +import SwaggerUI from 'swagger-ui-react' +import 'swagger-ui-react/swagger-ui.css' + +export default () => ( + +) diff --git a/src/pages/data/api-sandbox.js b/src/pages/data/api-sandbox.js new file mode 100644 index 000000000..4720292d7 --- /dev/null +++ b/src/pages/data/api-sandbox.js @@ -0,0 +1,41 @@ +import React from 'react' +import { graphql } from 'gatsby' +import SwaggerSandbox from '../../components/common/swagger-sandbox' +// import { Flex, Box } from '../../components/common/flexbox' +// import DetailText from '../../components/common/detail-text' +import Layout from '../../components/layout' +// import StateList from '../../components/pages/data/state-list' +// import StatesNav from '../../components/pages/data/state-nav' +// import SummaryTable from '../../components/common/summary-table' +// import { SyncInfobox } from '../../components/common/infobox' +// import stateNavStyles from './index.module.scss' + +export default ({ data }) => ( + + + +) + +export const query = graphql` + query { + allContentfulNavigationGroup(filter: { slug: { eq: "data" } }) { + edges { + node { + pages { + ... on ContentfulPage { + title + link: slug + } + ... on ContentfulNavigationLink { + title + link: url + } + } + } + } + } + } +` From 86a4c76c3058e3a7fcff5d437602cffcee449d5f Mon Sep 17 00:00:00 2001 From: friej715 Date: Sat, 11 Apr 2020 14:37:48 -0400 Subject: [PATCH 02/12] fix(docs): removing comments --- src/pages/data/api-sandbox.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/pages/data/api-sandbox.js b/src/pages/data/api-sandbox.js index 4720292d7..f8944afcd 100644 --- a/src/pages/data/api-sandbox.js +++ b/src/pages/data/api-sandbox.js @@ -1,14 +1,7 @@ import React from 'react' import { graphql } from 'gatsby' import SwaggerSandbox from '../../components/common/swagger-sandbox' -// import { Flex, Box } from '../../components/common/flexbox' -// import DetailText from '../../components/common/detail-text' import Layout from '../../components/layout' -// import StateList from '../../components/pages/data/state-list' -// import StatesNav from '../../components/pages/data/state-nav' -// import SummaryTable from '../../components/common/summary-table' -// import { SyncInfobox } from '../../components/common/infobox' -// import stateNavStyles from './index.module.scss' export default ({ data }) => ( Date: Sun, 12 Apr 2020 21:56:12 -0400 Subject: [PATCH 03/12] moving locally, tweaking style --- src/components/common/swagger-sandbox.js | 3 +- src/components/common/swagger-sandbox.scss | 21 + .../COVID-tracking-endpoints-1.0-docs.json | 541 ++++++++++++++++++ 3 files changed, 564 insertions(+), 1 deletion(-) create mode 100644 src/components/common/swagger-sandbox.scss create mode 100644 static/api-docs/COVID-tracking-endpoints-1.0-docs.json diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js index b8d1a7f24..76ef10fbd 100644 --- a/src/components/common/swagger-sandbox.js +++ b/src/components/common/swagger-sandbox.js @@ -1,11 +1,12 @@ import React from 'react' import SwaggerUI from 'swagger-ui-react' import 'swagger-ui-react/swagger-ui.css' +import './swagger-sandbox.scss' export default () => ( ) diff --git a/src/components/common/swagger-sandbox.scss b/src/components/common/swagger-sandbox.scss new file mode 100644 index 000000000..b35b8aa0d --- /dev/null +++ b/src/components/common/swagger-sandbox.scss @@ -0,0 +1,21 @@ +.swagger-ui { + pre.microlight { + line-height: 1rem; + } + .download-contents { + font-size: .7rem; + line-height: 1.2rem; + } + + td { + font-size:.8rem; + } + + tr { + line-height: 1.5rem; + } + + ul { + margin: auto; + } +} \ No newline at end of file diff --git a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json new file mode 100644 index 000000000..051a79a03 --- /dev/null +++ b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json @@ -0,0 +1,541 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "COVID Tracking API", + "description" : "API documentation.", + "version" : "1.0" + }, + "servers" : [ { + "url" : "http://covidtracking.com" + }, { + "url" : "https://covidtracking.com" + } ], + "paths" : { + "/api/v1/states/daily.{format}" : { + "get" : { + "description" : "States historical data. Entries saved each day at 4 pm ET.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StateData" + } + } + } + } + } + } + } + }, + "/api/v1/states/{state}/daily.{format}" : { + "get" : { + "description" : "State historical data. Entries saved each day at 4 pm ET.", + "parameters" : [ { + "in" : "path", + "name" : "state", + "required" : true, + "schema" : { + "type" : "string", + "example" : "CA" + } + }, { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StateData" + } + } + } + } + } + } + } + }, + "/api/v1/states/{state}/{date}.{format}" : { + "get" : { + "description" : "State historical data for a given date.", + "parameters" : [ { + "in" : "path", + "name" : "state", + "required" : true, + "schema" : { + "type" : "string", + "example" : "CA" + } + }, { + "in" : "path", + "name" : "date", + "required" : true, + "schema" : { + "type" : "string", + "example" : 20200408 + } + }, { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StateData" + } + } + } + } + } + } + }, + "/api/v1/states/current.{format}" : { + "get" : { + "description" : "States current values.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StateData" + } + } + } + } + } + } + } + }, + "/api/v1/states/info.{format}" : { + "get" : { + "description" : "States information.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StateInfo" + } + } + } + } + } + } + } + }, + "/api/v1/us/current.{format}" : { + "get" : { + "description" : "US current values.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/USData" + } + } + } + } + } + } + } + }, + "/api/v1/us/daily.{format}" : { + "get" : { + "description" : "US historical data. Entries saved each day at 4 pm ET.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/USDataWithDate" + } + } + } + } + } + } + } + }, + "/api/v1/us/{date}.{format}" : { + "get" : { + "description" : "US historical data for a given date.", + "parameters" : [ { + "in" : "path", + "name" : "date", + "required" : true, + "schema" : { + "type" : "string", + "example" : 20200408 + } + }, { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/USDataWithDate" + } + } + } + } + } + } + } + }, + "components" : { + "schemas" : { + "BasicData" : { + "type" : "object", + "properties" : { + "positive" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative positive test results." + }, + "positiveIncrease" : { + "type" : "integer", + "nullable" : true + }, + "negativeIncrease" : { + "type" : "integer", + "nullable" : true + }, + "negative" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative negative test results." + }, + "pending" : { + "type" : "integer", + "nullable" : true, + "description" : "Tests that have been submitted to a lab but no results have been reported yet." + }, + "hospitalizedCurrently" : { + "type" : "integer", + "nullable" : true, + "description" : "Number of people currently hospitalized." + }, + "hospitalizedCumulative" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people hospitalized." + }, + "inIcuCurrently" : { + "type" : "integer", + "nullable" : true, + "description" : "Number of people currently in ICU." + }, + "inIcuCumulative" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people in ICU." + }, + "onVentilatorCurrently" : { + "type" : "integer", + "nullable" : true, + "description" : "Number of people currently on a ventilator." + }, + "onVentilatorCumulative" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people on ventilators." + }, + "recovered" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people recovered." + }, + "hash" : { + "type" : "string", + "description" : "A unique ID changed every time the data updates. Survives a cache reset.", + "example" : "c385c4550994322e9818445fdc90e934dd027d4e" + }, + "totalTestResults" : { + "type" : "integer", + "nullable" : true, + "description" : "Calculated value (positive + negative) of total test results." + }, + "totalTestResultsIncrease" : { + "type" : "integer", + "nullable" : true + }, + "hospitalized" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people hospitalized." + }, + "death" : { + "type" : "integer", + "nullable" : true, + "description" : "Total cumulative number of people that have died." + }, + "deathIncrease" : { + "type" : "integer", + "nullable" : true + }, + "lastModified" : { + "type" : "string", + "description" : "The date the API cache was last updated. Even if the values didn't change but the cache was manually cleared or reset the date will reflect that time of reset and doesn't necessarily indicate an update was made. Manual cache clearing is rare however." + }, + "posNeg" : { + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED. Renamed to totalTestResults." + }, + "total" : { + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED. Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals." + } + } + }, + "USData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + } ], + "example" : { + "positive" : 426757, + "negative" : 1807168, + "pending" : 16933, + "hospitalizedCurrently" : 41264, + "hospitalizedCumulative" : 46803, + "inIcuCurrently" : 10215, + "inIcuCumulative" : 873, + "onVentilatorCurrently" : 4416, + "onVentilatorCumulative" : 108, + "recovered" : 19417, + "hash" : "c385c4550994322e9818445fdc90e934dd027d4e", + "totalTestResults" : 2233925, + "hospitalized" : 46803, + "death" : 14705, + "lastModified" : "2020-04-09T15:27:17.861Z", + "posNeg" : 2233925, + "total" : 2250858 + } + }, + "USDataWithDate" : { + "allOf" : [ { + "$ref" : "#/components/schemas/USData" + }, { + "type" : "object", + "properties" : { + "date" : { + "type" : "integer", + "description" : "YYMMDD of the time we saved/visited their website." + } + } + } ], + "example" : { + "date" : 20200408 + } + }, + "StateData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + }, { + "type" : "object", + "properties" : { + "date" : { + "type" : "integer", + "nullable" : false + }, + "state" : { + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation." + }, + "dateChecked" : { + "type" : "string", + "nullable" : false, + "description" : "ISO 8601 date of the time we saved/visited their website." + }, + "fips" : { + "type" : "string", + "nullable" : false, + "description" : "Federal Information Processing Standard state code." + } + } + } ], + "example" : { + "date" : 20200408, + "state" : "CA", + "positive" : 16957, + "negative" : 127307, + "pending" : 14600, + "hospitalizedCurrently" : 2714, + "hospitalizedCumulative" : null, + "inIcuCurrently" : 1154, + "inIcuCumulative" : null, + "onVentilatorCurrently" : null, + "onVentilatorCumulative" : null, + "recovered" : null, + "hash" : "c597c8b5b77b179c9e590a881c97d79fea2bd2db", + "dateChecked" : "2020-04-08T20:00:00Z", + "death" : 442, + "hospitalized" : null, + "total" : 158864, + "totalTestResults" : 144264, + "posNeg" : 144264, + "fips" : "06", + "deathIncrease" : 68, + "hospitalizedIncrease" : 0, + "negativeIncrease" : 11943, + "positiveIncrease" : 1092, + "totalTestResultsIncrease" : 1303 + } + }, + "StateInfo" : { + "type" : "object", + "properties" : { + "state" : { + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation.", + "example" : "CA" + }, + "name" : { + "type" : "string", + "nullable" : false, + "description" : "Full state or territory name.", + "example" : "California" + }, + "covid19SiteOld" : { + "type" : "string", + "nullable" : true, + "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx" + }, + "covid19Site" : { + "type" : "string", + "nullable" : true, + "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx", + "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL." + }, + "covid19SiteSecondary" : { + "type" : "string", + "nullable" : true, + "example" : "https://www.cdph.ca.gov/Programs/OPA/Pages/New-Release-2020.aspx", + "description" : "Typically more informational." + }, + "twitter" : { + "type" : "string", + "example" : "@CAPublicHealth", + "nullable" : true, + "description" : "Twitter for the State Health Department." + }, + "pui" : { + "type" : "string", + "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.", + "nullable" : true, + "example" : "Only positives" + }, + "pum" : { + "type" : "boolean", + "nullable" : false, + "example" : false, + "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states." + }, + "notes" : { + "type" : "string", + "nullable" : true, + "description" : "Notes about the information available and how we collect or record it.", + "example" : "The state has been inconsistent in its timing of reporting, so we used faster updating sources until 4/1, when we standardized on [California's new data dashboards](https://public.tableau.com/views/COVID-19PublicDashboard/Covid-19Public?:embed=y&:display_count=no&:showVizHome=no). This led to a drop in cases and deaths, as the state's data lags some other sources. We assume that \"tests conducted\" = \"people tested.\" The state also reported a huge batch of negative tests 4/4. Negative, pending, and total test reporting tend to lag positive test reporting by one day." + }, + "fips" : { + "type" : "string", + "nullable" : false, + "example" : "06", + "description" : "Federal Information Processing Standard state code." + } + } + } + } + } +} \ No newline at end of file From 33d093eab5372ba2f5378d9644bdd7c4be422d34 Mon Sep 17 00:00:00 2001 From: friej715 Date: Mon, 13 Apr 2020 09:33:13 -0400 Subject: [PATCH 04/12] fix(docs) adding SSR fix --- gatsby-node.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gatsby-node.js b/gatsby-node.js index 1dcccac0c..6e04cbfd6 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -89,4 +89,16 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { } actions.replaceWebpackConfig(config) } + if (stage === 'build-html') { + setWebpackConfig({ + module: { + rules: [ + { + test: /swagger-ui/, + use: loaders.null(), + }, + ], + }, + }) + } } From 899da8188cac4cbc59b01a1c55084bef88016f39 Mon Sep 17 00:00:00 2001 From: friej715 Date: Thu, 16 Apr 2020 12:23:23 -0400 Subject: [PATCH 05/12] fix(sandbox): minor tweak to gatsby-node.js, but build not solved yet --- gatsby-node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gatsby-node.js b/gatsby-node.js index 6e04cbfd6..e13517dfc 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -78,7 +78,8 @@ exports.createPages = async ({ graphql, actions }) => { }) } -exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { +exports.onCreateWebpackConfig = ({ stage, actions, getConfig, loaders }) => { + const {setWebpackConfig} = actions if (stage === 'build-javascript') { const config = getConfig() const miniCssExtractPlugin = config.plugins.find( From e18787547deb2da5a2ef544e2369d18110cadf4a Mon Sep 17 00:00:00 2001 From: Michel Tomas Date: Wed, 22 Apr 2020 02:18:42 +0200 Subject: [PATCH 06/12] fix(apisandbox): replace swagger-ui-react with a swagger-ui workaround to fix SSR issues --- gatsby-browser.js | 3 + gatsby-node.js | 15 +- package-lock.json | 462 ++++++++++++++++++++++- package.json | 2 +- src/components/common/swagger-sandbox.js | 26 +- 5 files changed, 483 insertions(+), 25 deletions(-) create mode 100644 gatsby-browser.js diff --git a/gatsby-browser.js b/gatsby-browser.js new file mode 100644 index 000000000..5775337b7 --- /dev/null +++ b/gatsby-browser.js @@ -0,0 +1,3 @@ +import SwaggerUI from 'swagger-ui' + +window.SwaggerUI = SwaggerUI diff --git a/gatsby-node.js b/gatsby-node.js index e13517dfc..1dcccac0c 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -78,8 +78,7 @@ exports.createPages = async ({ graphql, actions }) => { }) } -exports.onCreateWebpackConfig = ({ stage, actions, getConfig, loaders }) => { - const {setWebpackConfig} = actions +exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { if (stage === 'build-javascript') { const config = getConfig() const miniCssExtractPlugin = config.plugins.find( @@ -90,16 +89,4 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig, loaders }) => { } actions.replaceWebpackConfig(config) } - if (stage === 'build-html') { - setWebpackConfig({ - module: { - rules: [ - { - test: /swagger-ui/, - use: loaders.null(), - }, - ], - }, - }) - } } diff --git a/package-lock.json b/package-lock.json index aa76154cb..2124543cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1027,6 +1027,15 @@ "regenerator-runtime": "^0.13.4" } }, + "@babel/runtime-corejs2": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.2.tgz", + "integrity": "sha512-ayjSOxuK2GaSDJFCtLgHnYjuMyIpViNujWrZo8GUpN60/n7juzJKK5yOo6RFVb0zdU9ACJFK+MsZrUnj3OmXMw==", + "requires": { + "core-js": "^2.6.5", + "regenerator-runtime": "^0.13.4" + } + }, "@babel/runtime-corejs3": { "version": "7.9.2", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.9.2.tgz", @@ -1088,6 +1097,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@braintree/sanitize-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-3.1.0.tgz", + "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==" + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -3041,6 +3055,19 @@ "core-js": "^2.5.7" } }, + "@kyleshockey/object-assign-deep": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@kyleshockey/object-assign-deep/-/object-assign-deep-0.4.2.tgz", + "integrity": "sha1-hJAPDu/DcnmPR1G1JigwuCCJIuw=" + }, + "@kyleshockey/xml": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@kyleshockey/xml/-/xml-1.0.2.tgz", + "integrity": "sha512-iMo32MPLcI9cPxs3YL5kmKxKgDmkSZDCFEqIT5eRk7d/Ll8r4X3SwGYSigzALd6+RHWlFEmjL1QyaQ15xDZFlw==", + "requires": { + "stream": "^0.0.2" + } + }, "@mdx-js/loader": { "version": "1.5.8", "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-1.5.8.tgz", @@ -7029,6 +7056,14 @@ "integrity": "sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==", "optional": true }, + "autolinker": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-0.28.1.tgz", + "integrity": "sha1-BlK0kYgYefB3XazgzcoyM5QqTkc=", + "requires": { + "gulp-header": "^1.7.1" + } + }, "autoprefixer": { "version": "9.7.4", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.4.tgz", @@ -8712,6 +8747,11 @@ "node-int64": "^0.4.0" } }, + "btoa": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.1.2.tgz", + "integrity": "sha1-PkC4FmP4HS3WWWpMtxSo3BbPq+A=" + }, "buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -9706,6 +9746,21 @@ "typedarray": "^0.0.6" } }, + "concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, "config-chain": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", @@ -10323,6 +10378,11 @@ "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==" }, + "css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=" + }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -11330,6 +11390,11 @@ "domelementtype": "1" } }, + "dompurify": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.8.tgz", + "integrity": "sha512-vIOSyOXkMx81ghEalh4MLBtDHMx1bhKlaqHDMqM2yeitJ996SLOk5mGdDpI9ifJAgokred8Rmu219fX4OltqXw==" + }, "domutils": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", @@ -11559,6 +11624,11 @@ "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==", "dev": true }, + "emitter-component": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.1.1.tgz", + "integrity": "sha1-Bl4tvtaVm/RwZ57avq95gdEAOrY=" + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -11624,6 +11694,11 @@ "hoist-non-react-statics": "^3.3.0" } }, + "encode-3986": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/encode-3986/-/encode-3986-1.0.0.tgz", + "integrity": "sha1-lA1RSY+HQa3hhLda0UObMXwMemA=" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -12565,6 +12640,15 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "event-source-polyfill": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/event-source-polyfill/-/event-source-polyfill-1.0.12.tgz", @@ -13250,6 +13334,14 @@ "micromatch": "^3.1.10" } }, + "fast-json-patch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.1.0.tgz", + "integrity": "sha512-PipOsAKamRw7+CXtKiieehyjUeDVPJ5J7b2kdJYerEf6TSUQoD2ijpVyZ88KQm5YXziff4h762bz3+vzf56khg==", + "requires": { + "deep-equal": "^1.0.1" + } + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -16475,6 +16567,16 @@ "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" }, + "gulp-header": { + "version": "1.8.12", + "resolved": "https://registry.npmjs.org/gulp-header/-/gulp-header-1.8.12.tgz", + "integrity": "sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==", + "requires": { + "concat-with-sourcemaps": "*", + "lodash.template": "^4.4.0", + "through2": "^2.0.0" + } + }, "gzip-size": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", @@ -18068,7 +18170,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-dom/-/is-dom-1.1.0.tgz", "integrity": "sha512-u82f6mvhYxRPKpw8V1N0W8ce1xXwOrQtgGcxl6UCL5zBmZu3is/18K0rR7uFCnMDuAsS/3W54mGL4vsaFUQlEQ==", - "dev": true, "requires": { "is-object": "^1.0.1", "is-window": "^1.0.2" @@ -18546,6 +18647,34 @@ } } }, + "isomorphic-form-data": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-0.0.1.tgz", + "integrity": "sha1-Am9ifgMrDNhBPsyHVZKLlKRosGI=", + "requires": { + "form-data": "^1.0.0-rc3" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "form-data": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", + "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", + "requires": { + "async": "^2.0.1", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.11" + } + } + } + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -21796,6 +21925,11 @@ "nopt": "~3.0.1" } }, + "js-file-download": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/js-file-download/-/js-file-download-0.4.11.tgz", + "integrity": "sha512-VHrnxlhsZC7lTs+WlQ8Tj+7LVFflll3C6ac3Y0akOT+oEgBFT5WIK2PF7wYWdHh8BfKdy8H0IpUkMWJW12jovQ==" + }, "js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", @@ -22345,6 +22479,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash-es": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz", + "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==" + }, "lodash._arrayeach": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz", @@ -22694,6 +22833,14 @@ "yallist": "^2.0.0" } }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "~0.10.2" + } + }, "luxon": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.22.0.tgz", @@ -22968,6 +23115,21 @@ "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.1.1.tgz", "integrity": "sha512-HKeeBpWvqiVJD57ZUAsJNm71eHTykffzcLZVYWiVfQeI1rJtuEaS7hQiEpWfVVk18donPwJEcFKIkCmPJNOhHA==" }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, "memoizerific": { "version": "1.11.3", "resolved": "https://registry.npmjs.org/memoizerific/-/memoizerific-1.11.3.tgz", @@ -26707,6 +26869,11 @@ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, + "querystring-browser": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/querystring-browser/-/querystring-browser-1.0.4.tgz", + "integrity": "sha1-8uNYgYQKgZvHsb9Zf68JeeZiLcY=" + }, "querystring-es3": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", @@ -26875,6 +27042,15 @@ } } }, + "react-debounce-input": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/react-debounce-input/-/react-debounce-input-3.2.2.tgz", + "integrity": "sha512-RIBu68Cq/gImKz/2h1cE042REDqyqj3D+7SJ3lnnIpJX0ht9D9PfH7KAnL+SgDz6hvKa9pZS2CnAxlkrLmnQlg==", + "requires": { + "lodash.debounce": "^4", + "prop-types": "^15.7.2" + } + }, "react-dev-utils": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-4.2.3.tgz", @@ -27317,6 +27493,25 @@ "invariant": "^2.2.2" } }, + "react-immutable-pure-component": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/react-immutable-pure-component/-/react-immutable-pure-component-1.2.3.tgz", + "integrity": "sha512-kNy2A/fDrSuR8TKwB+4ynmItmp1vgF87tWxxfmadwDYo2J3ANipHqTjDIBvJvJ7libvuh76jIbvmK0krjtKH1g==", + "requires": { + "@types/react": "16.4.6" + }, + "dependencies": { + "@types/react": { + "version": "16.4.6", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.4.6.tgz", + "integrity": "sha512-9LDZdhsuKSc+DjY65SjBkA958oBWcTWSVWAd2cD9XqKBjhGw1KzAkRhWRw2eIsXvaIE/TOTjjKMFVC+JA1iU4g==", + "optional": true, + "requires": { + "csstype": "^2.2.0" + } + } + } + }, "react-input-autosize": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/react-input-autosize/-/react-input-autosize-2.2.2.tgz", @@ -27367,6 +27562,23 @@ "prop-types": "^15.7.2" } }, + "react-motion": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/react-motion/-/react-motion-0.5.2.tgz", + "integrity": "sha512-9q3YAvHoUiWlP3cK0v+w1N5Z23HXMj4IF4YuvjvWegWqNPfLXsOBE/V7UvQGpXxHFKRQQcNcVQE31g9SB/6qgQ==", + "requires": { + "performance-now": "^0.2.0", + "prop-types": "^15.5.8", + "raf": "^3.1.0" + }, + "dependencies": { + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=" + } + } + }, "react-onclickoutside": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.9.0.tgz", @@ -27865,6 +28077,14 @@ "symbol-observable": "^1.2.0" } }, + "redux-immutable": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-immutable/-/redux-immutable-3.1.0.tgz", + "integrity": "sha1-yvvWhuBxEmERm5wolgk13EeknQo=", + "requires": { + "immutable": "^3.8.1" + } + }, "redux-notifications": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/redux-notifications/-/redux-notifications-4.0.1.tgz", @@ -28293,6 +28513,15 @@ "xtend": "^4.0.1" } }, + "remarkable": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/remarkable/-/remarkable-1.7.4.tgz", + "integrity": "sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg==", + "requires": { + "argparse": "^1.0.10", + "autolinker": "~0.28.0" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -28402,6 +28631,11 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "reselect": { + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/reselect/-/reselect-2.5.4.tgz", + "integrity": "sha1-t9I/3wC4P6etAnlUb427vXZccEc=" + }, "resize-observer-polyfill": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", @@ -29152,6 +29386,11 @@ } } }, + "serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=" + }, "serialize-javascript": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", @@ -30157,6 +30396,14 @@ "resolved": "https://registry.npmjs.org/store2/-/store2-2.10.0.tgz", "integrity": "sha512-tWEpK0snS2RPUq1i3R6OahfJNjWCQYNxq0+by1amCSuw0mXtymJpzmZIeYpA1UAa+7B0grCpNYIbDcd7AgTbFg==" }, + "stream": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stream/-/stream-0.0.2.tgz", + "integrity": "sha1-f1Nj8Ff2WSxVlfALyAon9c7B8O8=", + "requires": { + "emitter-component": "^1.1.1" + } + }, "stream-browserify": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", @@ -30625,6 +30872,182 @@ } } }, + "swagger-client": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.10.0.tgz", + "integrity": "sha512-XUvqO/jeF+P5gYklN+ThEFq1++XnXV9RTdOpS65B5Y0dHnamxO8v0wG8geVEwIIqKjCYbKQ2Vd67DZMZMeaNvg==", + "requires": { + "@babel/runtime-corejs2": "^7.0.0", + "@kyleshockey/object-assign-deep": "^0.4.0", + "btoa": "1.1.2", + "buffer": "^5.1.0", + "cookie": "^0.3.1", + "cross-fetch": "0.0.8", + "deep-extend": "^0.5.1", + "encode-3986": "^1.0.0", + "fast-json-patch": "~2.1.0", + "isomorphic-form-data": "0.0.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.14", + "qs": "^6.3.0", + "querystring-browser": "^1.0.4", + "traverse": "^0.6.6", + "url": "^0.11.0", + "utf8-bytes": "0.0.1", + "utfstring": "^2.0.0" + }, + "dependencies": { + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cross-fetch": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-0.0.8.tgz", + "integrity": "sha1-Ae2U3EB98sAPGAf95wCnz6SKIFw=", + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.3" + } + }, + "deep-extend": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==" + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "whatwg-fetch": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=" + } + } + }, + "swagger-ui": { + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/swagger-ui/-/swagger-ui-3.25.0.tgz", + "integrity": "sha512-OfGWc93d/jqZ3LQC8fCxWm0nKodGFqa1TkxIW5jSmVqoPlEFGKdeGlrVtnINXn3kGNNuvPgNixb6Rp9sB6nC1Q==", + "requires": { + "@babel/runtime-corejs2": "^7.5.5", + "@braintree/sanitize-url": "^3.0.0", + "@kyleshockey/object-assign-deep": "^0.4.2", + "@kyleshockey/xml": "^1.0.2", + "base64-js": "^1.2.0", + "classnames": "^2.2.6", + "core-js": "^2.5.1", + "css.escape": "1.5.1", + "deep-extend": "0.6.0", + "dompurify": "^2.0.7", + "ieee754": "^1.1.13", + "immutable": "^3.x.x", + "js-file-download": "^0.4.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.15", + "memoizee": "^0.4.12", + "prop-types": "^15.7.2", + "randombytes": "^2.1.0", + "react": "^15.6.2", + "react-debounce-input": "^3.2.0", + "react-dom": "^15.6.2", + "react-immutable-proptypes": "2.1.0", + "react-immutable-pure-component": "^1.1.1", + "react-inspector": "^2.3.0", + "react-motion": "^0.5.2", + "react-redux": "^4.x.x", + "redux": "^3.x.x", + "redux-immutable": "3.1.0", + "remarkable": "^1.7.4", + "reselect": "^2.5.4", + "serialize-error": "^2.1.0", + "sha.js": "^2.4.11", + "swagger-client": "^3.10.0", + "url-parse": "^1.4.7", + "xml-but-prettier": "^1.0.1", + "zenscroll": "^4.0.2" + }, + "dependencies": { + "react": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/react/-/react-15.6.2.tgz", + "integrity": "sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI=", + "requires": { + "create-react-class": "^15.6.0", + "fbjs": "^0.8.9", + "loose-envify": "^1.1.0", + "object-assign": "^4.1.0", + "prop-types": "^15.5.10" + } + }, + "react-dom": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.6.2.tgz", + "integrity": "sha1-Qc+t9pO3V/rycIRDodH9WgK+9zA=", + "requires": { + "fbjs": "^0.8.9", + "loose-envify": "^1.1.0", + "object-assign": "^4.1.0", + "prop-types": "^15.5.10" + } + }, + "react-immutable-proptypes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/react-immutable-proptypes/-/react-immutable-proptypes-2.1.0.tgz", + "integrity": "sha1-Aj1vObsVyXwHHp5g0A0TbqxfoLQ=" + }, + "react-inspector": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/react-inspector/-/react-inspector-2.3.1.tgz", + "integrity": "sha512-tUUK7t3KWgZEIUktOYko5Ic/oYwvjEvQUFAGC1UeMeDaQ5za2yZFtItJa2RTwBJB//NxPr000WQK6sEbqC6y0Q==", + "requires": { + "babel-runtime": "^6.26.0", + "is-dom": "^1.0.9", + "prop-types": "^15.6.1" + } + }, + "react-redux": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-4.4.10.tgz", + "integrity": "sha512-tjL0Bmpkj75Td0k+lXlF8Fc8a9GuXFv/3ahUOCXExWs/jhsKiQeTffdH0j5byejCGCRL4tvGFYlrwBF1X/Aujg==", + "requires": { + "create-react-class": "^15.5.1", + "hoist-non-react-statics": "^3.3.0", + "invariant": "^2.0.0", + "lodash": "^4.17.11", + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2" + } + }, + "redux": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", + "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "requires": { + "lodash": "^4.2.1", + "lodash-es": "^4.2.1", + "loose-envify": "^1.1.0", + "symbol-observable": "^1.0.3" + } + } + } + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -31003,6 +31426,15 @@ "setimmediate": "^1.0.4" } }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, "timm": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/timm/-/timm-1.6.2.tgz", @@ -31182,6 +31614,11 @@ "punycode": "^2.1.0" } }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, "trim": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", @@ -32015,6 +32452,16 @@ "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=" }, + "utf8-bytes": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", + "integrity": "sha1-EWsCVEjJtQAIHN+/H01sbDfYg30=" + }, + "utfstring": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/utfstring/-/utfstring-2.0.1.tgz", + "integrity": "sha512-x8lx0NGB2OUxOOvFE3z4feOpJWrVrllGRzJq4h6H70bh3sincW+LAlexHBFD5jzV9sZ5qcabZcCwA7ZD6MdUkg==" + }, "utif": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz", @@ -33194,6 +33641,14 @@ } } }, + "xml-but-prettier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml-but-prettier/-/xml-but-prettier-1.0.1.tgz", + "integrity": "sha1-9aMyZ+1CzNTjVcYlV6XjmwH7QPM=", + "requires": { + "repeat-string": "^1.5.2" + } + }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", @@ -33580,6 +34035,11 @@ "zen-observable": "^0.8.0" } }, + "zenscroll": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zenscroll/-/zenscroll-4.0.2.tgz", + "integrity": "sha1-6NV3TRwHOKR7z6hynzcS4t7d6yU=" + }, "zwitch": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", diff --git a/package.json b/package.json index ed445d7f5..adcbbf9ae 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "react-typography": "^0.16.19", "reflexbox": "^4.0.6", "slugify": "^1.4.0", - "swagger-ui-react": "^3.25.0", + "swagger-ui": "^3.25.0", "typography": "^0.16.19", "understory": "^1.11.0" }, diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js index 76ef10fbd..853e7d29d 100644 --- a/src/components/common/swagger-sandbox.js +++ b/src/components/common/swagger-sandbox.js @@ -1,12 +1,20 @@ import React from 'react' -import SwaggerUI from 'swagger-ui-react' -import 'swagger-ui-react/swagger-ui.css' +import 'swagger-ui/dist/swagger-ui.css' import './swagger-sandbox.scss' -export default () => ( - -) +class SwaggerSandbox extends React.Component { + componentDidMount() { + window.SwaggerUI({ + dom_id: '#swaggerWrapper', + url: '/api-docs/COVID-tracking-endpoints-1.0-docs.json', + defaultModelExpandDepth: 10, + docExpansion: 'list', + }) + } + + render() { + return
+ } +} + +export default SwaggerSandbox From bdda11ef0170f730c03ae613e23915f48d4b3c7c Mon Sep 17 00:00:00 2001 From: friej715 Date: Wed, 22 Apr 2020 16:20:11 -0400 Subject: [PATCH 07/12] fix(docs): quick fix, hopefully, for test --- .../__snapshots__/swagger-sandbox.js.snap | 7 ++++++ .../components/common/swagger-sandbox.js | 23 +++++++++++++++++++ src/components/common/swagger-sandbox.js | 11 +++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap create mode 100644 src/__tests__/components/common/swagger-sandbox.js diff --git a/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap b/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap new file mode 100644 index 000000000..28c53e72a --- /dev/null +++ b/src/__tests__/components/common/__snapshots__/swagger-sandbox.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Components : Common: Swagger sandbox renders correctly 1`] = ` +
+`; diff --git a/src/__tests__/components/common/swagger-sandbox.js b/src/__tests__/components/common/swagger-sandbox.js new file mode 100644 index 000000000..72825233b --- /dev/null +++ b/src/__tests__/components/common/swagger-sandbox.js @@ -0,0 +1,23 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import SwaggerUI from 'swagger-ui' +import SwaggerSandbox from '../../../components/common/swagger-sandbox' + +beforeEach(() => { + window.SwaggerUI = SwaggerUI; +}) + +describe('Components : Common: Swagger sandbox', () => { + it('renders correctly', () => { + const tree = renderer + .create( + , + ) + .toJSON() + expect(tree).toMatchSnapshot() + }) +}) + +afterEach(() => { + delete window.SwaggerUI +}) \ No newline at end of file diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js index 853e7d29d..9025a04f3 100644 --- a/src/components/common/swagger-sandbox.js +++ b/src/components/common/swagger-sandbox.js @@ -5,7 +5,7 @@ import './swagger-sandbox.scss' class SwaggerSandbox extends React.Component { componentDidMount() { window.SwaggerUI({ - dom_id: '#swaggerWrapper', + domNode: this.swaggerWrapper, url: '/api-docs/COVID-tracking-endpoints-1.0-docs.json', defaultModelExpandDepth: 10, docExpansion: 'list', @@ -13,7 +13,14 @@ class SwaggerSandbox extends React.Component { } render() { - return
+ return ( +
{ + this.swaggerWrapper = ref + }} + id="swaggerWrapper" + /> + ) } } From 3a0900ab5ff45f0d11025678b58e2e756e39d5d6 Mon Sep 17 00:00:00 2001 From: friej715 Date: Wed, 22 Apr 2020 16:35:43 -0400 Subject: [PATCH 08/12] fix(docs): lint --- src/__tests__/components/common/swagger-sandbox.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/__tests__/components/common/swagger-sandbox.js b/src/__tests__/components/common/swagger-sandbox.js index 72825233b..1a8c9189d 100644 --- a/src/__tests__/components/common/swagger-sandbox.js +++ b/src/__tests__/components/common/swagger-sandbox.js @@ -4,20 +4,16 @@ import SwaggerUI from 'swagger-ui' import SwaggerSandbox from '../../../components/common/swagger-sandbox' beforeEach(() => { - window.SwaggerUI = SwaggerUI; + window.SwaggerUI = SwaggerUI }) describe('Components : Common: Swagger sandbox', () => { it('renders correctly', () => { - const tree = renderer - .create( - , - ) - .toJSON() + const tree = renderer.create().toJSON() expect(tree).toMatchSnapshot() }) }) afterEach(() => { delete window.SwaggerUI -}) \ No newline at end of file +}) From e82e708f5e03e7196e0e6af9932f7a13ab5caf9a Mon Sep 17 00:00:00 2001 From: friej715 Date: Sun, 26 Apr 2020 19:46:43 -0400 Subject: [PATCH 09/12] fix(docs): making sandbox look nicer on smaller screens, brand colors --- src/components/common/swagger-sandbox.scss | 106 +++++++-- src/pages/data/api-sandbox.js | 2 + .../COVID-tracking-endpoints-1.0-docs.json | 225 ++++++++++-------- 3 files changed, 216 insertions(+), 117 deletions(-) diff --git a/src/components/common/swagger-sandbox.scss b/src/components/common/swagger-sandbox.scss index b35b8aa0d..4024983d8 100644 --- a/src/components/common/swagger-sandbox.scss +++ b/src/components/common/swagger-sandbox.scss @@ -1,21 +1,93 @@ -.swagger-ui { - pre.microlight { - line-height: 1rem; - } - .download-contents { - font-size: .7rem; - line-height: 1.2rem; - } +@import '../../scss/colors.module.scss'; +@import '../../scss/breakpoints.module.scss'; - td { - font-size:.8rem; - } +#swaggerWrapper { + .swagger-ui { + pre.microlight { + line-height: 1rem; + } - tr { - line-height: 1.5rem; - } + .wrapper { + padding: 0px; + } + + .download-contents { + font-size: 0.7rem; + line-height: 1.2rem; + } + + td { + font-size: 0.8rem; + } + + tr { + line-height: 1.5rem; + } + + ul { + margin: auto; + } + + .url { + display: none; + } + + .scheme-container { + box-shadow: none; + padding-top: 0px; + margin-top: 0px; + } + + select.content-type { + border-color: $color-plum-600; + } + + .opblock-title span:after, + .opblock-summary-method { + background-color: $color-plum-600; + } + + .btn.execute { + background-color: $color-plum-600; + border-color: $color-plum-600; + } + + .btn.execute:active, + .btn.execute:hover { + background-color: $color-plum-700; + } + + .response-control-media-type__accept-message, + .model .prop-type { + color: $color-plum-600; + } + + .opblock-summary, + .opblock-get { + background-color: $color-plum-200; + border-color: $color-plum-300; + border-radius: 2px; + } + + @media (max-width: $viewport-ms) { + .responses-table, + .model { + table-layout: fixed; + } + .col_header.response-col_description { + width: 55%; + } + + .model td { + display: block; + padding: 0px; + max-width: 100%; + } - ul { - margin: auto; + .model td:nth-child(2) { + margin-bottom: 50px; + border-bottom: 0px; + } + } } -} \ No newline at end of file +} diff --git a/src/pages/data/api-sandbox.js b/src/pages/data/api-sandbox.js index f8944afcd..30f3d4b8c 100644 --- a/src/pages/data/api-sandbox.js +++ b/src/pages/data/api-sandbox.js @@ -8,6 +8,8 @@ export default ({ data }) => ( title="API Sandbox" navigation={data.allContentfulNavigationGroup.edges[0].node.pages} > + Below, you can explore each of our endpoints, try out API requests, and + learn about our schema. ) diff --git a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json index 051a79a03..62c9728e4 100644 --- a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json +++ b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json @@ -1,8 +1,7 @@ { "openapi" : "3.0.1", "info" : { - "title" : "COVID Tracking API", - "description" : "API documentation.", + "title" : "COVID Tracking API Sandbox", "version" : "1.0" }, "servers" : [ { @@ -13,11 +12,14 @@ "paths" : { "/api/v1/states/daily.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "States historical data. Entries saved each day at 4 pm ET.", "parameters" : [ { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -42,19 +44,24 @@ }, "/api/v1/states/{state}/daily.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "State historical data. Entries saved each day at 4 pm ET.", "parameters" : [ { - "in" : "path", "name" : "state", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "CA" } }, { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -79,27 +86,34 @@ }, "/api/v1/states/{state}/{date}.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "State historical data for a given date.", "parameters" : [ { - "in" : "path", "name" : "state", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "CA" } }, { - "in" : "path", "name" : "date", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", - "example" : 20200408 + "example" : "20200408" } }, { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -121,11 +135,14 @@ }, "/api/v1/states/current.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "States current values.", "parameters" : [ { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -150,11 +167,14 @@ }, "/api/v1/states/info.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "States information.", "parameters" : [ { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -179,11 +199,14 @@ }, "/api/v1/us/current.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "US current values.", "parameters" : [ { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -208,11 +231,14 @@ }, "/api/v1/us/daily.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "US historical data. Entries saved each day at 4 pm ET.", "parameters" : [ { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -237,19 +263,24 @@ }, "/api/v1/us/{date}.{format}" : { "get" : { + "tags" : [ "Endpoints" ], "description" : "US historical data for a given date.", "parameters" : [ { - "in" : "path", "name" : "date", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", - "example" : 20200408 + "example" : "20200408" } }, { - "in" : "path", "name" : "format", + "in" : "path", "required" : true, + "style" : "simple", + "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -277,8 +308,8 @@ "properties" : { "positive" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative positive test results." + "description" : "Total cumulative positive test results.", + "nullable" : true }, "positiveIncrease" : { "type" : "integer", @@ -290,48 +321,48 @@ }, "negative" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative negative test results." + "description" : "Total cumulative negative test results.", + "nullable" : true }, "pending" : { "type" : "integer", - "nullable" : true, - "description" : "Tests that have been submitted to a lab but no results have been reported yet." + "description" : "Tests that have been submitted to a lab but no results have been reported yet.", + "nullable" : true }, "hospitalizedCurrently" : { "type" : "integer", - "nullable" : true, - "description" : "Number of people currently hospitalized." + "description" : "Number of people currently hospitalized.", + "nullable" : true }, "hospitalizedCumulative" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people hospitalized." + "description" : "Total cumulative number of people hospitalized.", + "nullable" : true }, "inIcuCurrently" : { "type" : "integer", - "nullable" : true, - "description" : "Number of people currently in ICU." + "description" : "Number of people currently in ICU.", + "nullable" : true }, "inIcuCumulative" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people in ICU." + "description" : "Total cumulative number of people in ICU.", + "nullable" : true }, "onVentilatorCurrently" : { "type" : "integer", - "nullable" : true, - "description" : "Number of people currently on a ventilator." + "description" : "Number of people currently on a ventilator.", + "nullable" : true }, "onVentilatorCumulative" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people on ventilators." + "description" : "Total cumulative number of people on ventilators.", + "nullable" : true }, "recovered" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people recovered." + "description" : "Total cumulative number of people recovered.", + "nullable" : true }, "hash" : { "type" : "string", @@ -340,8 +371,8 @@ }, "totalTestResults" : { "type" : "integer", - "nullable" : true, - "description" : "Calculated value (positive + negative) of total test results." + "description" : "Calculated value (positive + negative) of total test results.", + "nullable" : true }, "totalTestResultsIncrease" : { "type" : "integer", @@ -349,13 +380,13 @@ }, "hospitalized" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people hospitalized." + "description" : "Total cumulative number of people hospitalized.", + "nullable" : true }, "death" : { "type" : "integer", - "nullable" : true, - "description" : "Total cumulative number of people that have died." + "description" : "Total cumulative number of people that have died.", + "nullable" : true }, "deathIncrease" : { "type" : "integer", @@ -367,20 +398,17 @@ }, "posNeg" : { "type" : "integer", - "nullable" : true, - "description" : "DEPRECATED. Renamed to totalTestResults." + "description" : "DEPRECATED. Renamed to totalTestResults.", + "nullable" : true }, "total" : { "type" : "integer", - "nullable" : true, - "description" : "DEPRECATED. Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals." + "description" : "DEPRECATED. Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals.", + "nullable" : true } } }, "USData" : { - "allOf" : [ { - "$ref" : "#/components/schemas/BasicData" - } ], "example" : { "positive" : 426757, "negative" : 1807168, @@ -399,9 +427,15 @@ "lastModified" : "2020-04-09T15:27:17.861Z", "posNeg" : 2233925, "total" : 2250858 - } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + } ] }, "USDataWithDate" : { + "example" : { + "date" : 20200408 + }, "allOf" : [ { "$ref" : "#/components/schemas/USData" }, { @@ -412,38 +446,9 @@ "description" : "YYMMDD of the time we saved/visited their website." } } - } ], - "example" : { - "date" : 20200408 - } + } ] }, "StateData" : { - "allOf" : [ { - "$ref" : "#/components/schemas/BasicData" - }, { - "type" : "object", - "properties" : { - "date" : { - "type" : "integer", - "nullable" : false - }, - "state" : { - "type" : "string", - "nullable" : false, - "description" : "State or territory postal code abbreviation." - }, - "dateChecked" : { - "type" : "string", - "nullable" : false, - "description" : "ISO 8601 date of the time we saved/visited their website." - }, - "fips" : { - "type" : "string", - "nullable" : false, - "description" : "Federal Information Processing Standard state code." - } - } - } ], "example" : { "date" : 20200408, "state" : "CA", @@ -451,16 +456,10 @@ "negative" : 127307, "pending" : 14600, "hospitalizedCurrently" : 2714, - "hospitalizedCumulative" : null, "inIcuCurrently" : 1154, - "inIcuCumulative" : null, - "onVentilatorCurrently" : null, - "onVentilatorCumulative" : null, - "recovered" : null, "hash" : "c597c8b5b77b179c9e590a881c97d79fea2bd2db", "dateChecked" : "2020-04-08T20:00:00Z", "death" : 442, - "hospitalized" : null, "total" : 158864, "totalTestResults" : 144264, "posNeg" : 144264, @@ -470,21 +469,47 @@ "negativeIncrease" : 11943, "positiveIncrease" : 1092, "totalTestResultsIncrease" : 1303 - } + }, + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + }, { + "type" : "object", + "properties" : { + "date" : { + "type" : "integer", + "nullable" : false + }, + "state" : { + "type" : "string", + "description" : "State or territory postal code abbreviation.", + "nullable" : false + }, + "dateChecked" : { + "type" : "string", + "description" : "ISO 8601 date of the time we saved/visited their website.", + "nullable" : false + }, + "fips" : { + "type" : "string", + "description" : "Federal Information Processing Standard state code.", + "nullable" : false + } + } + } ] }, "StateInfo" : { "type" : "object", "properties" : { "state" : { "type" : "string", - "nullable" : false, "description" : "State or territory postal code abbreviation.", + "nullable" : false, "example" : "CA" }, "name" : { "type" : "string", - "nullable" : false, "description" : "Full state or territory name.", + "nullable" : false, "example" : "California" }, "covid19SiteOld" : { @@ -494,21 +519,21 @@ }, "covid19Site" : { "type" : "string", + "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL.", "nullable" : true, - "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx", - "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL." + "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx" }, "covid19SiteSecondary" : { "type" : "string", + "description" : "Typically more informational.", "nullable" : true, - "example" : "https://www.cdph.ca.gov/Programs/OPA/Pages/New-Release-2020.aspx", - "description" : "Typically more informational." + "example" : "https://www.cdph.ca.gov/Programs/OPA/Pages/New-Release-2020.aspx" }, "twitter" : { "type" : "string", - "example" : "@CAPublicHealth", + "description" : "Twitter for the State Health Department.", "nullable" : true, - "description" : "Twitter for the State Health Department." + "example" : "@CAPublicHealth" }, "pui" : { "type" : "string", @@ -518,21 +543,21 @@ }, "pum" : { "type" : "boolean", + "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states.", "nullable" : false, - "example" : false, - "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states." + "example" : false }, "notes" : { "type" : "string", - "nullable" : true, "description" : "Notes about the information available and how we collect or record it.", + "nullable" : true, "example" : "The state has been inconsistent in its timing of reporting, so we used faster updating sources until 4/1, when we standardized on [California's new data dashboards](https://public.tableau.com/views/COVID-19PublicDashboard/Covid-19Public?:embed=y&:display_count=no&:showVizHome=no). This led to a drop in cases and deaths, as the state's data lags some other sources. We assume that \"tests conducted\" = \"people tested.\" The state also reported a huge batch of negative tests 4/4. Negative, pending, and total test reporting tend to lag positive test reporting by one day." }, "fips" : { "type" : "string", + "description" : "Federal Information Processing Standard state code.", "nullable" : false, - "example" : "06", - "description" : "Federal Information Processing Standard state code." + "example" : "06" } } } From 63dee0f5e322aaa35a3ae90e23807b6580765084 Mon Sep 17 00:00:00 2001 From: friej715 Date: Sun, 26 Apr 2020 21:15:42 -0400 Subject: [PATCH 10/12] fix(docs): fixing table borders --- src/components/common/swagger-sandbox.scss | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/common/swagger-sandbox.scss b/src/components/common/swagger-sandbox.scss index 4024983d8..65cef94d3 100644 --- a/src/components/common/swagger-sandbox.scss +++ b/src/components/common/swagger-sandbox.scss @@ -16,6 +16,27 @@ line-height: 1.2rem; } + .model { + border:0px; + + td, tr { + border-top: none; + border-bottom: none; + padding-top:20px; + padding-bottom:20px; + } + + tbody tr { + border-top:1px solid rgb(200, 200, 200); + } + } + + table, th, td { + border-color: rgb(175, 175, 175); + border-left: none; + border-right: none; + } + td { font-size: 0.8rem; } @@ -85,7 +106,7 @@ } .model td:nth-child(2) { - margin-bottom: 50px; + margin-bottom: 30px; border-bottom: 0px; } } From efae555babe518f7f7ea8f8297eecdc1ee9a08e9 Mon Sep 17 00:00:00 2001 From: Kevin Miller Date: Tue, 28 Apr 2020 09:33:46 -0400 Subject: [PATCH 11/12] chore: Make swagger load in component only --- gatsby-browser.js | 4 ---- gatsby-node.js | 16 ++++++++++++- src/components/common/swagger-sandbox.js | 29 +++++++++++------------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/gatsby-browser.js b/gatsby-browser.js index 9fa5f2f65..8eaec5cf7 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,9 +1,5 @@ -const SwaggerUI = require('swagger-ui') - exports.onClientEntry = () => { window.addEventListener('load', () => { document.body.className = document.body.className.replace(/\bno-js\b/, '') }) } - -window.SwaggerUI = SwaggerUI diff --git a/gatsby-node.js b/gatsby-node.js index 1dcccac0c..68886f91b 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -78,7 +78,8 @@ exports.createPages = async ({ graphql, actions }) => { }) } -exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { +exports.onCreateWebpackConfig = ({ stage, actions, loaders, getConfig }) => { + const { setWebpackConfig } = actions if (stage === 'build-javascript') { const config = getConfig() const miniCssExtractPlugin = config.plugins.find( @@ -89,4 +90,17 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { } actions.replaceWebpackConfig(config) } + + if (stage === 'build-html') { + setWebpackConfig({ + module: { + rules: [ + { + test: /swagger-ui/, + use: loaders.null(), + }, + ], + }, + }) + } } diff --git a/src/components/common/swagger-sandbox.js b/src/components/common/swagger-sandbox.js index 9025a04f3..665f7c81c 100644 --- a/src/components/common/swagger-sandbox.js +++ b/src/components/common/swagger-sandbox.js @@ -1,27 +1,24 @@ -import React from 'react' +import React, { useEffect, useRef } from 'react' import 'swagger-ui/dist/swagger-ui.css' import './swagger-sandbox.scss' +import SwaggerUI from 'swagger-ui' -class SwaggerSandbox extends React.Component { - componentDidMount() { - window.SwaggerUI({ - domNode: this.swaggerWrapper, +const SwaggerSandbox = () => { + const swaggerRef = useRef(null) + + useEffect(() => { + if (typeof window === 'undefined') { + return + } + SwaggerUI({ + domNode: swaggerRef.current, url: '/api-docs/COVID-tracking-endpoints-1.0-docs.json', defaultModelExpandDepth: 10, docExpansion: 'list', }) - } + }, []) - render() { - return ( -
{ - this.swaggerWrapper = ref - }} - id="swaggerWrapper" - /> - ) - } + return
} export default SwaggerSandbox From 11bf4721991ef2147e7703b851dd6b737da0a28b Mon Sep 17 00:00:00 2001 From: friej715 Date: Wed, 29 Apr 2020 22:59:30 -0400 Subject: [PATCH 12/12] fix(docs): updating for current endpoints --- .../COVID-tracking-endpoints-1.0-docs.json | 808 ++++++++++++------ 1 file changed, 556 insertions(+), 252 deletions(-) diff --git a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json index 62c9728e4..6fba9e04d 100644 --- a/static/api-docs/COVID-tracking-endpoints-1.0-docs.json +++ b/static/api-docs/COVID-tracking-endpoints-1.0-docs.json @@ -1,25 +1,21 @@ { - "openapi" : "3.0.1", + "openapi" : "3.0.0", "info" : { "title" : "COVID Tracking API Sandbox", "version" : "1.0" }, "servers" : [ { - "url" : "http://covidtracking.com" - }, { "url" : "https://covidtracking.com" } ], "paths" : { - "/api/v1/states/daily.{format}" : { + "/api/v1/us/current.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "States historical data. Entries saved each day at 4 pm ET.", + "tags" : [ "US Current and Historical Data" ], + "description" : "US current values.", "parameters" : [ { - "name" : "format", "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -33,7 +29,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/StateData" + "$ref" : "#/components/schemas/USData" } } } @@ -42,26 +38,14 @@ } } }, - "/api/v1/states/{state}/daily.{format}" : { + "/api/v1/us/daily.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "State historical data. Entries saved each day at 4 pm ET.", + "description" : "US historical data. Entries saved each day at 4 pm ET.", + "tags" : [ "US Current and Historical Data" ], "parameters" : [ { - "name" : "state", "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string", - "example" : "CA" - } - }, { "name" : "format", - "in" : "path", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -75,7 +59,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/StateData" + "$ref" : "#/components/schemas/USHistoricalData" } } } @@ -84,36 +68,22 @@ } } }, - "/api/v1/states/{state}/{date}.{format}" : { + "/api/v1/us/{date}.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "State historical data for a given date.", + "tags" : [ "US Current and Historical Data" ], + "description" : "US historical data for a given date.", "parameters" : [ { - "name" : "state", "in" : "path", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string", - "example" : "CA" - } - }, { "name" : "date", - "in" : "path", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", - "example" : "20200408" + "example" : 20200408 } }, { - "name" : "format", "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -125,7 +95,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/StateData" + "$ref" : "#/components/schemas/USHistoricalData" } } } @@ -135,14 +105,12 @@ }, "/api/v1/states/current.{format}" : { "get" : { - "tags" : [ "Endpoints" ], + "tags" : [ "States Current and Historical Data" ], "description" : "States current values.", "parameters" : [ { - "name" : "format", "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -165,20 +133,26 @@ } } }, - "/api/v1/states/info.{format}" : { + "/api/v1/states/{state}/current.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "States information.", + "tags" : [ "States Current and Historical Data" ], + "description" : "States current values.", "parameters" : [ { - "name" : "format", "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" } + }, { + "in" : "path", + "name" : "state", + "required" : true, + "schema" : { + "type" : "string", + "example" : "CA" + } } ], "responses" : { "200" : { @@ -186,10 +160,7 @@ "content" : { "application/json" : { "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StateInfo" - } + "$ref" : "#/components/schemas/StateData" } } } @@ -197,16 +168,14 @@ } } }, - "/api/v1/us/current.{format}" : { + "/api/v1/states/daily.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "US current values.", + "description" : "States historical data. Entries saved each day at 4 pm ET.", + "tags" : [ "States Current and Historical Data" ], "parameters" : [ { - "name" : "format", "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -220,7 +189,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/USData" + "$ref" : "#/components/schemas/StateHistoricalData" } } } @@ -229,16 +198,22 @@ } } }, - "/api/v1/us/daily.{format}" : { + "/api/v1/states/{state}/daily.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "US historical data. Entries saved each day at 4 pm ET.", + "description" : "State historical data. Entries saved each day at 4 pm ET.", + "tags" : [ "States Current and Historical Data" ], "parameters" : [ { - "name" : "format", "in" : "path", + "name" : "state", + "required" : true, + "schema" : { + "type" : "string", + "example" : "CA" + } + }, { + "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -252,7 +227,7 @@ "schema" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/USDataWithDate" + "$ref" : "#/components/schemas/StateHistoricalData" } } } @@ -261,26 +236,57 @@ } } }, - "/api/v1/us/{date}.{format}" : { + "/api/v1/states/{state}/{date}.{format}" : { "get" : { - "tags" : [ "Endpoints" ], - "description" : "US historical data for a given date.", + "tags" : [ "States Current and Historical Data" ], + "description" : "State historical data for a given date.", "parameters" : [ { - "name" : "date", "in" : "path", + "name" : "state", + "required" : true, + "schema" : { + "type" : "string", + "example" : "CA" + } + }, { + "in" : "path", + "name" : "date", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", - "example" : "20200408" + "example" : 20200408 } }, { + "in" : "path", "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StateHistoricalData" + } + } + } + } + } + } + }, + "/api/v1/states/info.{format}" : { + "get" : { + "tags" : [ "Additional Endpoints" ], + "description" : "States information.", + "parameters" : [ { "in" : "path", + "name" : "format", "required" : true, - "style" : "simple", - "explode" : false, "schema" : { "type" : "string", "example" : "json" @@ -292,7 +298,103 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/USDataWithDate" + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StateInfo" + } + } + } + } + } + } + } + }, + "/api/v1/counties.{format}" : { + "get" : { + "tags" : [ "Additional Endpoints" ], + "description" : "County information.", + "parameters" : [ { + "in" : "path", + "name" : "format", + "required" : true, + "schema" : { + "type" : "string", + "example" : "json" + } + } ], + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CountyInfo" + } + } + } + } + } + } + } + }, + "/api/v1/cdc/daily.json" : { + "get" : { + "tags" : [ "Additional Endpoints" ], + "description" : "The table found on the 'CDC Testing in U.S.' webpage is available via this endpoint. Please visit the CDC's website to learn more.", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CDCData" + } + } + } + } + } + } + } + }, + "/api/v1/urls.json" : { + "get" : { + "tags" : [ "Additional Endpoints" ], + "description" : "Tracker URLs.", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TrackerInfo" + } + } + } + } + } + } + } + }, + "/api/v1/states/screenshots.json" : { + "get" : { + "tags" : [ "Additional Endpoints" ], + "description" : "State website screenshots.", + "responses" : { + "200" : { + "description" : "OK", + "content" : { + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ScreenshotInfo" + } } } } @@ -303,25 +405,341 @@ }, "components" : { "schemas" : { - "BasicData" : { + "USData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + } ] + }, + "USHistoricalData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicHistoricalData" + }, { + "type" : "object", + "properties" : { + "states" : { + "type" : "integer", + "description" : "Quantity of states and territories that are reporting data." + }, + "dateChecked" : { + "type" : "string", + "nullable" : false, + "description" : "ISO 8601 date of when these values were valid.", + "example" : "2020-04-29T20:00:00Z" + } + } + } ] + }, + "StateData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicData" + }, { + "type" : "object", + "properties" : { + "state" : { + "example" : "AK", + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation." + }, + "positiveScore" : { + "example" : 1, + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED +1 for reporting positives reliably." + }, + "negativeScore" : { + "example" : 1, + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED +1 for reporting negatives sometimes." + }, + "negativeRegularScore" : { + "example" : 1, + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED +1 for reporting negatives reliably." + }, + "commercialScore" : { + "example" : 1, + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED +1 for reporting all commercial tests." + }, + "grade" : { + "example" : "A", + "type" : "string", + "nullable" : true, + "description" : "DEPRECATED Letter grade based on score." + }, + "score" : { + "example" : 4, + "type" : "integer", + "nullable" : true, + "description" : "DEPRECATED Total reporting quality score." + }, + "notes" : { + "example" : "Please stop using the \"total\" field. Use \"totalTestResults\" instead. As of 4/24/20, \"grade\" is deprecated. Please use \"dataQualityGrade\" instead.", + "type" : "string", + "nullable" : true + }, + "dataQualityGrade" : { + "example" : "B", + "type" : "string", + "nullable" : true, + "description" : "Letter grade based on our state grading." + }, + "lastUpdateEt" : { + "example" : "4/28 14:50", + "type" : "string", + "nullable" : true + }, + "checkTimeEt" : { + "example" : "4/29 16:30", + "type" : "string", + "nullable" : true + }, + "fips" : { + "example" : "02", + "type" : "string", + "nullable" : true, + "description" : "Federal Information Processing Standard state code" + }, + "dateModified" : { + "example" : "2020-04-28T18:50:00Z", + "type" : "string", + "nullable" : true, + "description" : "ISO 8601 date of the time the data was last updated by the state." + }, + "dateChecked" : { + "example" : "2020-04-29T20:30:00Z", + "type" : "string", + "nullable" : true, + "description" : "ISO 8601 date of the time we last visited their website." + } + } + } ] + }, + "StateHistoricalData" : { + "allOf" : [ { + "$ref" : "#/components/schemas/BasicHistoricalData" + }, { + "type" : "object", + "properties" : { + "state" : { + "example" : "AK", + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation." + }, + "dateChecked" : { + "example" : "2020-04-29T20:30:00Z", + "type" : "string", + "nullable" : true, + "description" : "ISO 8601 date of the time we last visited their website." + }, + "fips" : { + "example" : "02", + "type" : "string", + "nullable" : true, + "description" : "Federal Information Processing Standard state code" + } + } + } ] + }, + "CDCData" : { "type" : "object", "properties" : { - "positive" : { + "dateCollected" : { + "type" : "string", + "nullable" : false, + "example" : "1/26" + }, + "cdcLabs" : { "type" : "integer", - "description" : "Total cumulative positive test results.", - "nullable" : true + "nullable" : false, + "example" : 310 + }, + "usPubHealthLabs" : { + "type" : "integer", + "nullable" : false, + "example" : 1 }, - "positiveIncrease" : { + "dailyTotal" : { "type" : "integer", + "nullable" : false, + "example" : 311 + }, + "lag" : { + "type" : "integer", + "nullable" : false, + "example" : 0 + } + } + }, + "CountyInfo" : { + "type" : "object", + "properties" : { + "state" : { + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation." + }, + "county" : { + "type" : "string", + "nullable" : false, + "description" : "County name." + }, + "covid19Site" : { + "type" : "string", + "nullable" : true + }, + "dataSite" : { + "type" : "string", + "nullable" : true + }, + "mainSite" : { + "type" : "string", + "nullable" : true + }, + "twitter" : { + "type" : "string", + "nullable" : true + }, + "pui" : { + "type" : "string", + "nullable" : true, + "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.", + "example" : "Only positives" + } + } + }, + "StateInfo" : { + "type" : "object", + "properties" : { + "state" : { + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation.", + "example" : "CA" + }, + "name" : { + "type" : "string", + "nullable" : false, + "description" : "Full state or territory name.", + "example" : "California" + }, + "covid19SiteOld" : { + "type" : "string", "nullable" : true }, - "negativeIncrease" : { + "covid19Site" : { + "type" : "string", + "nullable" : true, + "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL." + }, + "covid19SiteSecondary" : { + "type" : "string", + "nullable" : true, + "description" : "Typically more informational." + }, + "twitter" : { + "type" : "string", + "example" : "@CAPublicHealth", + "nullable" : true, + "description" : "Twitter for the State Health Department." + }, + "pui" : { + "type" : "string", + "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.", + "nullable" : true, + "example" : "Only positives" + }, + "pum" : { + "type" : "boolean", + "nullable" : false, + "example" : false, + "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states." + }, + "notes" : { + "type" : "string", + "nullable" : true, + "description" : "Notes about the information available and how we collect or record it." + }, + "fips" : { + "type" : "string", + "nullable" : false, + "example" : "06", + "description" : "Federal Information Processing Standard state code." + } + } + }, + "ScreenshotInfo" : { + "type" : "object", + "properties" : { + "state" : { + "type" : "string", + "nullable" : false, + "description" : "State abbreviation.", + "example" : "AK" + }, + "url" : { + "type" : "string", + "nullable" : false, + "description" : "URL of screenshot on covidtracking.com." + }, + "dateChecked" : { + "type" : "string", + "nullable" : false + }, + "secondary" : { + "type" : "boolean", + "nullable" : false + }, + "date" : { + "type" : "string", + "nullable" : false + }, + "size" : { + "type" : "integer", + "nullable" : false + } + } + }, + "TrackerInfo" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string", + "nullable" : false, + "description" : "State name." + }, + "stateId" : { + "type" : "string", + "nullable" : false, + "description" : "State or territory postal code abbreviation." + }, + "url" : { + "type" : "string" + }, + "kind" : { + "type" : "string" + }, + "filter" : { + "type" : "string" + } + } + }, + "BasicData" : { + "type" : "object", + "properties" : { + "positive" : { "type" : "integer", + "description" : "Total cumulative positive test results.", "nullable" : true }, "negative" : { "type" : "integer", - "description" : "Total cumulative negative test results.", + "description" : "Total cumulative negative test results", "nullable" : true }, "pending" : { @@ -331,51 +749,54 @@ }, "hospitalizedCurrently" : { "type" : "integer", - "description" : "Number of people currently hospitalized.", + "description" : "Number of individuals currently hospitalized.", "nullable" : true }, "hospitalizedCumulative" : { "type" : "integer", - "description" : "Total cumulative number of people hospitalized.", + "description" : "Total number of individuals that have been hospitalized, including those that have been discharged.", "nullable" : true }, "inIcuCurrently" : { "type" : "integer", - "description" : "Number of people currently in ICU.", + "description" : "Number of individuals currently in an ICU.", "nullable" : true }, "inIcuCumulative" : { "type" : "integer", - "description" : "Total cumulative number of people in ICU.", + "description" : "Total number of individuals that have been in the ICU.", "nullable" : true }, "onVentilatorCurrently" : { "type" : "integer", - "description" : "Number of people currently on a ventilator.", + "description" : "Number of individuals currently on a ventilator.", "nullable" : true }, "onVentilatorCumulative" : { "type" : "integer", - "description" : "Total cumulative number of people on ventilators.", + "description" : "Total number of individuals that have been on a ventilator.", "nullable" : true }, "recovered" : { "type" : "integer", - "description" : "Total cumulative number of people recovered.", + "description" : "Total number of individuals that have tested negative after a previous positive test.", "nullable" : true }, "hash" : { + "example" : "3c87534fcc1b6850241042317032bbc4b3708878", "type" : "string", "description" : "A unique ID changed every time the data updates. Survives a cache reset.", - "example" : "c385c4550994322e9818445fdc90e934dd027d4e" + "nullable" : true }, - "totalTestResults" : { - "type" : "integer", - "description" : "Calculated value (positive + negative) of total test results.", + "lastModified" : { + "example" : "2020-04-30T00:14:51.862Z", + "type" : "string", + "description" : " The date the API cache was last updated. Even if the values didn’t change but the cache was manually cleared or reset the date will reflect that time of reset and doesn’t necessarily indicate an update was made. Manual cache clearing is rare however.", "nullable" : true }, - "totalTestResultsIncrease" : { + "death" : { "type" : "integer", + "description" : "Total cumulative number of people that have died.", "nullable" : true }, "hospitalized" : { @@ -383,183 +804,66 @@ "description" : "Total cumulative number of people hospitalized.", "nullable" : true }, - "death" : { + "total" : { "type" : "integer", - "description" : "Total cumulative number of people that have died.", + "description" : "DEPRECATED Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals.", "nullable" : true }, - "deathIncrease" : { + "totalTestResults" : { "type" : "integer", + "description" : "Calculated value (positive + negative) of total test results.", "nullable" : true }, - "lastModified" : { - "type" : "string", - "description" : "The date the API cache was last updated. Even if the values didn't change but the cache was manually cleared or reset the date will reflect that time of reset and doesn't necessarily indicate an update was made. Manual cache clearing is rare however." - }, "posNeg" : { "type" : "integer", - "description" : "DEPRECATED. Renamed to totalTestResults.", + "description" : "DEPRECATED Renamed to totalTestResults.", "nullable" : true }, - "total" : { - "type" : "integer", - "description" : "DEPRECATED. Will be removed in the future. (positive + negative + pending). Pending has been an unstable value and should not count in any totals.", + "notes" : { + "example" : "NOTE: \"total\", \"posNeg\", \"hospitalized\" will be removed in the future.", + "type" : "string", "nullable" : true } } }, - "USData" : { - "example" : { - "positive" : 426757, - "negative" : 1807168, - "pending" : 16933, - "hospitalizedCurrently" : 41264, - "hospitalizedCumulative" : 46803, - "inIcuCurrently" : 10215, - "inIcuCumulative" : 873, - "onVentilatorCurrently" : 4416, - "onVentilatorCumulative" : 108, - "recovered" : 19417, - "hash" : "c385c4550994322e9818445fdc90e934dd027d4e", - "totalTestResults" : 2233925, - "hospitalized" : 46803, - "death" : 14705, - "lastModified" : "2020-04-09T15:27:17.861Z", - "posNeg" : 2233925, - "total" : 2250858 - }, + "BasicHistoricalData" : { "allOf" : [ { "$ref" : "#/components/schemas/BasicData" - } ] - }, - "USDataWithDate" : { - "example" : { - "date" : 20200408 - }, - "allOf" : [ { - "$ref" : "#/components/schemas/USData" }, { "type" : "object", "properties" : { "date" : { "type" : "integer", - "description" : "YYMMDD of the time we saved/visited their website." - } - } - } ] - }, - "StateData" : { - "example" : { - "date" : 20200408, - "state" : "CA", - "positive" : 16957, - "negative" : 127307, - "pending" : 14600, - "hospitalizedCurrently" : 2714, - "inIcuCurrently" : 1154, - "hash" : "c597c8b5b77b179c9e590a881c97d79fea2bd2db", - "dateChecked" : "2020-04-08T20:00:00Z", - "death" : 442, - "total" : 158864, - "totalTestResults" : 144264, - "posNeg" : 144264, - "fips" : "06", - "deathIncrease" : 68, - "hospitalizedIncrease" : 0, - "negativeIncrease" : 11943, - "positiveIncrease" : 1092, - "totalTestResultsIncrease" : 1303 - }, - "allOf" : [ { - "$ref" : "#/components/schemas/BasicData" - }, { - "type" : "object", - "properties" : { - "date" : { + "nullable" : false, + "example" : 20200429 + }, + "deathIncrease" : { "type" : "integer", - "nullable" : false + "nullable" : true, + "description" : "Increase from the day before." }, - "state" : { - "type" : "string", - "description" : "State or territory postal code abbreviation.", - "nullable" : false + "hospitalizedIncrease" : { + "type" : "integer", + "nullable" : true, + "description" : "Increase from the day before." }, - "dateChecked" : { - "type" : "string", - "description" : "ISO 8601 date of the time we saved/visited their website.", - "nullable" : false + "negativeIncrease" : { + "type" : "integer", + "nullable" : true, + "description" : "Increase from the day before." }, - "fips" : { - "type" : "string", - "description" : "Federal Information Processing Standard state code.", - "nullable" : false + "positiveIncrease" : { + "type" : "integer", + "nullable" : true, + "description" : "Increase from the day before." + }, + "totalTestResultsIncrease" : { + "type" : "integer", + "nullable" : true, + "description" : "Increase from the day before." } } } ] - }, - "StateInfo" : { - "type" : "object", - "properties" : { - "state" : { - "type" : "string", - "description" : "State or territory postal code abbreviation.", - "nullable" : false, - "example" : "CA" - }, - "name" : { - "type" : "string", - "description" : "Full state or territory name.", - "nullable" : false, - "example" : "California" - }, - "covid19SiteOld" : { - "type" : "string", - "nullable" : true, - "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx" - }, - "covid19Site" : { - "type" : "string", - "description" : "Webpage dedicated to making results available to the public. More likely to contain numbers. We make regular screenshots of this URL.", - "nullable" : true, - "example" : "https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/Immunization/ncov2019.aspx" - }, - "covid19SiteSecondary" : { - "type" : "string", - "description" : "Typically more informational.", - "nullable" : true, - "example" : "https://www.cdph.ca.gov/Programs/OPA/Pages/New-Release-2020.aspx" - }, - "twitter" : { - "type" : "string", - "description" : "Twitter for the State Health Department.", - "nullable" : true, - "example" : "@CAPublicHealth" - }, - "pui" : { - "type" : "string", - "description" : "Person Under Investigation; it is meant to capture positive, negative, and pending test results.", - "nullable" : true, - "example" : "Only positives" - }, - "pum" : { - "type" : "boolean", - "description" : "Person Under Monitoring; we don’t collect these numbers as they are reported far less consistently across states.", - "nullable" : false, - "example" : false - }, - "notes" : { - "type" : "string", - "description" : "Notes about the information available and how we collect or record it.", - "nullable" : true, - "example" : "The state has been inconsistent in its timing of reporting, so we used faster updating sources until 4/1, when we standardized on [California's new data dashboards](https://public.tableau.com/views/COVID-19PublicDashboard/Covid-19Public?:embed=y&:display_count=no&:showVizHome=no). This led to a drop in cases and deaths, as the state's data lags some other sources. We assume that \"tests conducted\" = \"people tested.\" The state also reported a huge batch of negative tests 4/4. Negative, pending, and total test reporting tend to lag positive test reporting by one day." - }, - "fips" : { - "type" : "string", - "description" : "Federal Information Processing Standard state code.", - "nullable" : false, - "example" : "06" - } - } } } }