feat: expose plugins and presets on SwaggerUI global symbol (#9189)
Part of this commit is also: - complete plugins consolidation - complete presets consolidation - build system consolidation Refs #9188
This commit is contained in:
10
.browserslistrc
Normal file
10
.browserslistrc
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[production]
|
||||||
|
> 1%
|
||||||
|
last 2 versions
|
||||||
|
Firefox ESR
|
||||||
|
not dead
|
||||||
|
|
||||||
|
[development]
|
||||||
|
last 1 chrome version
|
||||||
|
last 1 firefox version
|
||||||
|
last 1 safari version
|
||||||
178
babel.config.js
178
babel.config.js
@@ -1,74 +1,14 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"env": {
|
"env": {
|
||||||
"commonjs": {
|
"esm": {
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"debug": false,
|
|
||||||
"modules": "commonjs",
|
|
||||||
"targets": {
|
|
||||||
"node": "8"
|
|
||||||
},
|
|
||||||
"forceAllTransforms": false,
|
|
||||||
"ignoreBrowserslistConfig": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@babel/preset-react",
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
[
|
|
||||||
"@babel/plugin-transform-modules-commonjs",
|
|
||||||
{
|
|
||||||
"loose": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@babel/proposal-class-properties",
|
|
||||||
"@babel/proposal-object-rest-spread",
|
|
||||||
"@babel/plugin-proposal-optional-chaining",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"es": {
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/preset-env",
|
|
||||||
{
|
|
||||||
"debug": false,
|
|
||||||
"modules": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@babel/preset-react",
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
[
|
|
||||||
"@babel/plugin-transform-runtime",
|
|
||||||
{
|
|
||||||
"absoluteRuntime": false,
|
|
||||||
"corejs": 3,
|
|
||||||
"version": "^7.11.2"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@babel/proposal-class-properties",
|
|
||||||
"@babel/proposal-object-rest-spread",
|
|
||||||
"@babel/plugin-proposal-optional-chaining",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"development": {
|
|
||||||
"presets": [
|
"presets": [
|
||||||
[
|
[
|
||||||
"@babel/env",
|
"@babel/env",
|
||||||
{
|
{
|
||||||
"targets": {
|
"debug": true,
|
||||||
"browsers": [
|
"modules": false,
|
||||||
/* benefit of C/S/FF/Edge only? */
|
"ignoreBrowserslistConfig": false,
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"Firefox ESR",
|
|
||||||
"not dead"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"useBuiltIns": false,
|
"useBuiltIns": false,
|
||||||
"corejs": { version: 3 },
|
|
||||||
"include": [
|
"include": [
|
||||||
"@babel/plugin-proposal-logical-assignment-operators"
|
"@babel/plugin-proposal-logical-assignment-operators"
|
||||||
]
|
]
|
||||||
@@ -85,8 +25,6 @@ module.exports = {
|
|||||||
"version": "^7.11.2"
|
"version": "^7.11.2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@babel/plugin-proposal-class-properties",
|
|
||||||
"@babel/plugin-proposal-optional-chaining",
|
|
||||||
[
|
[
|
||||||
"transform-react-remove-prop-types",
|
"transform-react-remove-prop-types",
|
||||||
{
|
{
|
||||||
@@ -100,13 +38,7 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
"alias": {
|
"alias": {
|
||||||
"root": ".",
|
"root": ".",
|
||||||
"components": "./src/core/components",
|
|
||||||
"containers": "./src/core/containers",
|
|
||||||
"core": "./src/core",
|
"core": "./src/core",
|
||||||
"plugins": "./src/plugins",
|
|
||||||
"img": "./src/img",
|
|
||||||
"corePlugins": "./src/core/plugins",
|
|
||||||
"less": "./src/less"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -118,10 +50,10 @@ module.exports = {
|
|||||||
"@babel/env",
|
"@babel/env",
|
||||||
{
|
{
|
||||||
"targets": {
|
"targets": {
|
||||||
"node": "10"
|
"node": "16.13.2"
|
||||||
},
|
},
|
||||||
|
"ignoreBrowserslistConfig": true,
|
||||||
"useBuiltIns": false,
|
"useBuiltIns": false,
|
||||||
"corejs": { version: 3 }
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@babel/preset-react"
|
"@babel/preset-react"
|
||||||
@@ -135,8 +67,6 @@ module.exports = {
|
|||||||
"version": "^7.11.2"
|
"version": "^7.11.2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@babel/plugin-proposal-class-properties",
|
|
||||||
"@babel/plugin-proposal-optional-chaining",
|
|
||||||
[
|
[
|
||||||
"transform-react-remove-prop-types",
|
"transform-react-remove-prop-types",
|
||||||
{
|
{
|
||||||
@@ -150,18 +80,100 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
"alias": {
|
"alias": {
|
||||||
"root": ".",
|
"root": ".",
|
||||||
"components": "./src/core/components",
|
|
||||||
"containers": "./src/core/containers",
|
|
||||||
"core": "./src/core",
|
"core": "./src/core",
|
||||||
"plugins": "./src/plugins",
|
|
||||||
"img": "./src/img",
|
|
||||||
"corePlugins": "./src/core/plugins",
|
|
||||||
"less": "./src/less"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"development": {
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/env",
|
||||||
|
{
|
||||||
|
"ignoreBrowserslistConfig": false,
|
||||||
|
"useBuiltIns": false,
|
||||||
|
"include": [
|
||||||
|
"@babel/plugin-proposal-logical-assignment-operators"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/preset-react"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"@babel/plugin-transform-runtime",
|
||||||
|
{
|
||||||
|
"corejs": 3,
|
||||||
|
"absoluteRuntime": false,
|
||||||
|
"version": "^7.11.2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"transform-react-remove-prop-types",
|
||||||
|
{
|
||||||
|
"additionalLibraries": [
|
||||||
|
"react-immutable-proptypes"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"babel-plugin-module-resolver",
|
||||||
|
{
|
||||||
|
"alias": {
|
||||||
|
"root": ".",
|
||||||
|
"core": "./src/core",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"production": {
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/env",
|
||||||
|
{
|
||||||
|
"ignoreBrowserslistConfig": false,
|
||||||
|
"useBuiltIns": false,
|
||||||
|
"include": [
|
||||||
|
"@babel/plugin-proposal-logical-assignment-operators"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/preset-react"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"@babel/plugin-transform-class-properties",
|
||||||
|
"@babel/plugin-transform-nullish-coalescing-operator",
|
||||||
|
"@babel/plugin-transform-object-rest-spread",
|
||||||
|
"@babel/plugin-transform-optional-chaining",
|
||||||
|
[
|
||||||
|
"@babel/plugin-transform-runtime",
|
||||||
|
{
|
||||||
|
"corejs": 3,
|
||||||
|
"absoluteRuntime": false,
|
||||||
|
"version": "^7.11.2"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"transform-react-remove-prop-types",
|
||||||
|
{
|
||||||
|
"additionalLibraries": [
|
||||||
|
"react-immutable-proptypes"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"babel-plugin-module-resolver",
|
||||||
|
{
|
||||||
|
"alias": {
|
||||||
|
"root": ".",
|
||||||
|
"core": "./src/core",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ module.exports = {
|
|||||||
'<rootDir>/test/unit/components/online-validator-badge.jsx',
|
'<rootDir>/test/unit/components/online-validator-badge.jsx',
|
||||||
'<rootDir>/test/unit/components/live-response.jsx',
|
'<rootDir>/test/unit/components/live-response.jsx',
|
||||||
],
|
],
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^.+\\.svg$': 'jest-transform-stub'
|
||||||
|
},
|
||||||
transformIgnorePatterns: ['/node_modules/(?!(sinon)/)'],
|
transformIgnorePatterns: ['/node_modules/(?!(sinon)/)'],
|
||||||
silent: true, // set to `false` to allow console.* calls to be printed
|
silent: true, // set to `false` to allow console.* calls to be printed
|
||||||
};
|
};
|
||||||
|
|||||||
27309
dist/swagger-ui-es-bundle-core.js
vendored
27309
dist/swagger-ui-es-bundle-core.js
vendored
File diff suppressed because one or more lines are too long
@@ -17,6 +17,8 @@ Welcome to the Swagger UI documentation!
|
|||||||
- [Overview](customization/overview.md)
|
- [Overview](customization/overview.md)
|
||||||
- [Plugin API](customization/plugin-api.md)
|
- [Plugin API](customization/plugin-api.md)
|
||||||
- [Custom layout](customization/custom-layout.md)
|
- [Custom layout](customization/custom-layout.md)
|
||||||
|
- [Adding plugin](customization/add-plugin.md)
|
||||||
|
- [Plug-Points](customization/plug-points.md)
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
|||||||
206
package-lock.json
generated
206
package-lock.json
generated
@@ -51,11 +51,10 @@
|
|||||||
"@babel/cli": "=7.22.10",
|
"@babel/cli": "=7.22.10",
|
||||||
"@babel/core": "=7.22.11",
|
"@babel/core": "=7.22.11",
|
||||||
"@babel/eslint-parser": "=7.22.11",
|
"@babel/eslint-parser": "=7.22.11",
|
||||||
"@babel/plugin-proposal-class-properties": "=7.18.6",
|
"@babel/plugin-transform-class-properties": "=7.22.5",
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": "=7.18.6",
|
"@babel/plugin-transform-nullish-coalescing-operator": "=7.22.11",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "=7.20.7",
|
"@babel/plugin-transform-object-rest-spread": "=7.22.15",
|
||||||
"@babel/plugin-proposal-optional-chaining": "=7.21.0",
|
"@babel/plugin-transform-optional-chaining": "=7.22.15",
|
||||||
"@babel/plugin-transform-modules-commonjs": "=7.22.11",
|
|
||||||
"@babel/plugin-transform-runtime": "=7.22.10",
|
"@babel/plugin-transform-runtime": "=7.22.10",
|
||||||
"@babel/preset-env": "=7.22.14",
|
"@babel/preset-env": "=7.22.14",
|
||||||
"@babel/preset-react": "=7.22.5",
|
"@babel/preset-react": "=7.22.5",
|
||||||
@@ -96,6 +95,7 @@
|
|||||||
"inspectpack": "=4.7.1",
|
"inspectpack": "=4.7.1",
|
||||||
"jest": "=29.6.3",
|
"jest": "=29.6.3",
|
||||||
"jest-environment-jsdom": "=29.6.4",
|
"jest-environment-jsdom": "=29.6.4",
|
||||||
|
"jest-transform-stub": "=2.0.0",
|
||||||
"jsdom": "=22.1.0",
|
"jsdom": "=22.1.0",
|
||||||
"json-loader": "^0.5.7",
|
"json-loader": "^0.5.7",
|
||||||
"json-merger": "^1.1.10",
|
"json-merger": "^1.1.10",
|
||||||
@@ -309,13 +309,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/helper-compilation-targets": {
|
"node_modules/@babel/helper-compilation-targets": {
|
||||||
"version": "7.22.10",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz",
|
||||||
"integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==",
|
"integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/compat-data": "^7.22.9",
|
"@babel/compat-data": "^7.22.9",
|
||||||
"@babel/helper-validator-option": "^7.22.5",
|
"@babel/helper-validator-option": "^7.22.15",
|
||||||
"browserslist": "^4.21.9",
|
"browserslist": "^4.21.9",
|
||||||
"lru-cache": "^5.1.1",
|
"lru-cache": "^5.1.1",
|
||||||
"semver": "^6.3.1"
|
"semver": "^6.3.1"
|
||||||
@@ -567,9 +567,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/helper-validator-option": {
|
"node_modules/@babel/helper-validator-option": {
|
||||||
"version": "7.22.5",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz",
|
||||||
"integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==",
|
"integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
@@ -661,74 +661,6 @@
|
|||||||
"@babel/core": "^7.13.0"
|
"@babel/core": "^7.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-proposal-class-properties": {
|
|
||||||
"version": "7.18.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz",
|
|
||||||
"integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/helper-create-class-features-plugin": "^7.18.6",
|
|
||||||
"@babel/helper-plugin-utils": "^7.18.6"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.9.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@babel/core": "^7.0.0-0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@babel/plugin-proposal-nullish-coalescing-operator": {
|
|
||||||
"version": "7.18.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz",
|
|
||||||
"integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/helper-plugin-utils": "^7.18.6",
|
|
||||||
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.9.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@babel/core": "^7.0.0-0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@babel/plugin-proposal-object-rest-spread": {
|
|
||||||
"version": "7.20.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz",
|
|
||||||
"integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/compat-data": "^7.20.5",
|
|
||||||
"@babel/helper-compilation-targets": "^7.20.7",
|
|
||||||
"@babel/helper-plugin-utils": "^7.20.2",
|
|
||||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
|
||||||
"@babel/plugin-transform-parameters": "^7.20.7"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.9.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@babel/core": "^7.0.0-0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@babel/plugin-proposal-optional-chaining": {
|
|
||||||
"version": "7.21.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz",
|
|
||||||
"integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/helper-plugin-utils": "^7.20.2",
|
|
||||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.20.0",
|
|
||||||
"@babel/plugin-syntax-optional-chaining": "^7.8.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.9.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@babel/core": "^7.0.0-0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@babel/plugin-proposal-private-property-in-object": {
|
"node_modules/@babel/plugin-proposal-private-property-in-object": {
|
||||||
"version": "7.21.0-placeholder-for-preset-env.2",
|
"version": "7.21.0-placeholder-for-preset-env.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
||||||
@@ -1489,16 +1421,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-transform-object-rest-spread": {
|
"node_modules/@babel/plugin-transform-object-rest-spread": {
|
||||||
"version": "7.22.11",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.11.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz",
|
||||||
"integrity": "sha512-nX8cPFa6+UmbepISvlf5jhQyaC7ASs/7UxHmMkuJ/k5xSHvDPPaibMo+v3TXwU/Pjqhep/nFNpd3zn4YR59pnw==",
|
"integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/compat-data": "^7.22.9",
|
"@babel/compat-data": "^7.22.9",
|
||||||
"@babel/helper-compilation-targets": "^7.22.10",
|
"@babel/helper-compilation-targets": "^7.22.15",
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.22.5",
|
||||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
||||||
"@babel/plugin-transform-parameters": "^7.22.5"
|
"@babel/plugin-transform-parameters": "^7.22.15"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
@@ -1540,9 +1472,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-transform-optional-chaining": {
|
"node_modules/@babel/plugin-transform-optional-chaining": {
|
||||||
"version": "7.22.12",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.12.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz",
|
||||||
"integrity": "sha512-7XXCVqZtyFWqjDsYDY4T45w4mlx1rf7aOgkc/Ww76xkgBiOlmjPkx36PBLHa1k1rwWvVgYMPsbuVnIamx2ZQJw==",
|
"integrity": "sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.22.5",
|
||||||
@@ -1557,9 +1489,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/plugin-transform-parameters": {
|
"node_modules/@babel/plugin-transform-parameters": {
|
||||||
"version": "7.22.5",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz",
|
||||||
"integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==",
|
"integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/helper-plugin-utils": "^7.22.5"
|
"@babel/helper-plugin-utils": "^7.22.5"
|
||||||
@@ -17312,6 +17244,12 @@
|
|||||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/jest-transform-stub": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/jest-util": {
|
"node_modules/jest-util": {
|
||||||
"version": "29.6.3",
|
"version": "29.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz",
|
||||||
@@ -30129,13 +30067,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/helper-compilation-targets": {
|
"@babel/helper-compilation-targets": {
|
||||||
"version": "7.22.10",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz",
|
||||||
"integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==",
|
"integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/compat-data": "^7.22.9",
|
"@babel/compat-data": "^7.22.9",
|
||||||
"@babel/helper-validator-option": "^7.22.5",
|
"@babel/helper-validator-option": "^7.22.15",
|
||||||
"browserslist": "^4.21.9",
|
"browserslist": "^4.21.9",
|
||||||
"lru-cache": "^5.1.1",
|
"lru-cache": "^5.1.1",
|
||||||
"semver": "^6.3.1"
|
"semver": "^6.3.1"
|
||||||
@@ -30315,9 +30253,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@babel/helper-validator-option": {
|
"@babel/helper-validator-option": {
|
||||||
"version": "7.22.5",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz",
|
||||||
"integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==",
|
"integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@babel/helper-wrap-function": {
|
"@babel/helper-wrap-function": {
|
||||||
@@ -30379,50 +30317,6 @@
|
|||||||
"@babel/plugin-transform-optional-chaining": "^7.22.5"
|
"@babel/plugin-transform-optional-chaining": "^7.22.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-proposal-class-properties": {
|
|
||||||
"version": "7.18.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz",
|
|
||||||
"integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/helper-create-class-features-plugin": "^7.18.6",
|
|
||||||
"@babel/helper-plugin-utils": "^7.18.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": {
|
|
||||||
"version": "7.18.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz",
|
|
||||||
"integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/helper-plugin-utils": "^7.18.6",
|
|
||||||
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/plugin-proposal-object-rest-spread": {
|
|
||||||
"version": "7.20.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz",
|
|
||||||
"integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/compat-data": "^7.20.5",
|
|
||||||
"@babel/helper-compilation-targets": "^7.20.7",
|
|
||||||
"@babel/helper-plugin-utils": "^7.20.2",
|
|
||||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
|
||||||
"@babel/plugin-transform-parameters": "^7.20.7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/plugin-proposal-optional-chaining": {
|
|
||||||
"version": "7.21.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz",
|
|
||||||
"integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@babel/helper-plugin-utils": "^7.20.2",
|
|
||||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.20.0",
|
|
||||||
"@babel/plugin-syntax-optional-chaining": "^7.8.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@babel/plugin-proposal-private-property-in-object": {
|
"@babel/plugin-proposal-private-property-in-object": {
|
||||||
"version": "7.21.0-placeholder-for-preset-env.2",
|
"version": "7.21.0-placeholder-for-preset-env.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
||||||
@@ -30917,16 +30811,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-transform-object-rest-spread": {
|
"@babel/plugin-transform-object-rest-spread": {
|
||||||
"version": "7.22.11",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.11.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz",
|
||||||
"integrity": "sha512-nX8cPFa6+UmbepISvlf5jhQyaC7ASs/7UxHmMkuJ/k5xSHvDPPaibMo+v3TXwU/Pjqhep/nFNpd3zn4YR59pnw==",
|
"integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/compat-data": "^7.22.9",
|
"@babel/compat-data": "^7.22.9",
|
||||||
"@babel/helper-compilation-targets": "^7.22.10",
|
"@babel/helper-compilation-targets": "^7.22.15",
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.22.5",
|
||||||
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
|
||||||
"@babel/plugin-transform-parameters": "^7.22.5"
|
"@babel/plugin-transform-parameters": "^7.22.15"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-transform-object-super": {
|
"@babel/plugin-transform-object-super": {
|
||||||
@@ -30950,9 +30844,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-transform-optional-chaining": {
|
"@babel/plugin-transform-optional-chaining": {
|
||||||
"version": "7.22.12",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.12.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz",
|
||||||
"integrity": "sha512-7XXCVqZtyFWqjDsYDY4T45w4mlx1rf7aOgkc/Ww76xkgBiOlmjPkx36PBLHa1k1rwWvVgYMPsbuVnIamx2ZQJw==",
|
"integrity": "sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/helper-plugin-utils": "^7.22.5",
|
"@babel/helper-plugin-utils": "^7.22.5",
|
||||||
@@ -30961,9 +30855,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/plugin-transform-parameters": {
|
"@babel/plugin-transform-parameters": {
|
||||||
"version": "7.22.5",
|
"version": "7.22.15",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz",
|
||||||
"integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==",
|
"integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/helper-plugin-utils": "^7.22.5"
|
"@babel/helper-plugin-utils": "^7.22.5"
|
||||||
@@ -42495,6 +42389,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"jest-transform-stub": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"jest-util": {
|
"jest-util": {
|
||||||
"version": "29.6.3",
|
"version": "29.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz",
|
||||||
|
|||||||
34
package.json
34
package.json
@@ -39,28 +39,28 @@
|
|||||||
"automated-release": "release-it -VV --config ./release/.release-it.json",
|
"automated-release": "release-it -VV --config ./release/.release-it.json",
|
||||||
"build": "npm run build-stylesheets && rimraf ./dist/swagger-ui.js ./dist/swagger-ui.js.map && npm run build-all-bundles",
|
"build": "npm run build-stylesheets && rimraf ./dist/swagger-ui.js ./dist/swagger-ui.js.map && npm run build-all-bundles",
|
||||||
"build-all-bundles": "run-p --aggregate-output build:core build:bundle build:standalone build:es:bundle build:es:bundle:core",
|
"build-all-bundles": "run-p --aggregate-output build:core build:bundle build:standalone build:es:bundle build:es:bundle:core",
|
||||||
"build-stylesheets": "webpack --color --config webpack/stylesheets.babel.js",
|
"build-stylesheets": "cross-env NODE_ENV=production webpack --color --config webpack/stylesheets.js",
|
||||||
"build:bundle": "webpack --color --config webpack/bundle.babel.js",
|
"build:bundle": "cross-env NODE_ENV=production webpack --color --config webpack/bundle.js",
|
||||||
"build:core": "webpack --color --config webpack/core.babel.js",
|
"build:core": "cross-env NODE_ENV=production webpack --color --config webpack/core.js",
|
||||||
"build:standalone": "webpack --color --config webpack/standalone.babel.js",
|
"build:standalone": "cross-env NODE_ENV=production webpack --color --config webpack/standalone.js",
|
||||||
"build:es:bundle": "webpack --color --config webpack/es-bundle.babel.js",
|
"build:es:bundle": "cross-env NODE_ENV=production webpack --color --config webpack/es-bundle.js",
|
||||||
"build:es:bundle:core": "webpack --color --config webpack/es-bundle-core.babel.js",
|
"build:es:bundle:core": "cross-env NODE_ENV=production BABEL_ENV=esm webpack --color --config webpack/es-bundle-core.js",
|
||||||
"clean": "rimraf ./dist",
|
"clean": "rimraf ./dist",
|
||||||
"postinstall": "patch-package",
|
"postinstall": "patch-package",
|
||||||
"dev": "webpack serve --config webpack/dev.babel.js",
|
"dev": "cross-env NODE_ENV=development webpack serve --config webpack/dev.js",
|
||||||
"deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv",
|
"deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv",
|
||||||
"deps-size": "webpack -p --config webpack/bundle.babel.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt",
|
"deps-size": "cross-env NODE_ENV=development webpack -p --config webpack/bundle.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt",
|
||||||
"deps-check": "run-s deps-license deps-size",
|
"deps-check": "run-s deps-license deps-size",
|
||||||
"lint": "eslint --ext \".js,.jsx\" src test dev-helpers flavors",
|
"lint": "eslint --ext \".js,.jsx\" src test dev-helpers flavors",
|
||||||
"lint-errors": "eslint --quiet --ext \".js,.jsx\" src test dev-helpers flavors",
|
"lint-errors": "eslint --quiet --ext \".js,.jsx\" src test dev-helpers flavors",
|
||||||
"lint-fix": "eslint --ext \".js,.jsx\" src test dev-helpers flavors --fix",
|
"lint-fix": "eslint --ext \".js,.jsx\" src test dev-helpers flavors --fix",
|
||||||
"test": "run-s lint-errors just-test-in-node test:unit-jest cy:ci",
|
"test": "run-s lint-errors just-test-in-node test:unit-jest cy:ci",
|
||||||
"test-in-node": "run-s lint-errors just-test-in-node",
|
"test-in-node": "run-s lint-errors just-test-in-node",
|
||||||
"just-test-in-node": "cross-env BABEL_ENV=test mocha \"test/mocha/**/*.{js,jsx}\"",
|
"just-test-in-node": "cross-env NODE_ENV=test mocha \"test/mocha/**/*.{js,jsx}\"",
|
||||||
"test:artifact": "jest --config ./config/jest/jest.artifact.config.js",
|
"test:artifact": "cross-env NODE_ENV=production jest --config ./config/jest/jest.artifact.config.js",
|
||||||
"test:unit-jest": "cross-env BABEL_ENV=test jest --config ./config/jest/jest.unit.config.js",
|
"test:unit-jest": "cross-env NODE_ENV=test jest --config ./config/jest/jest.unit.config.js",
|
||||||
"cy:mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204",
|
"cy:mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204",
|
||||||
"cy:server": "webpack serve --config webpack/dev-e2e.babel.js",
|
"cy:server": "cross-env NODE_ENV=production webpack serve --config webpack/dev-e2e.js",
|
||||||
"cy:start": "run-p -r cy:server cy:mock-api",
|
"cy:start": "run-p -r cy:server cy:mock-api",
|
||||||
"cy:open": "cypress open",
|
"cy:open": "cypress open",
|
||||||
"cy:run": "cypress run",
|
"cy:run": "cypress run",
|
||||||
@@ -115,11 +115,10 @@
|
|||||||
"@babel/cli": "=7.22.10",
|
"@babel/cli": "=7.22.10",
|
||||||
"@babel/core": "=7.22.11",
|
"@babel/core": "=7.22.11",
|
||||||
"@babel/eslint-parser": "=7.22.11",
|
"@babel/eslint-parser": "=7.22.11",
|
||||||
"@babel/plugin-proposal-class-properties": "=7.18.6",
|
"@babel/plugin-transform-class-properties": "=7.22.5",
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": "=7.18.6",
|
"@babel/plugin-transform-nullish-coalescing-operator": "=7.22.11",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "=7.20.7",
|
"@babel/plugin-transform-object-rest-spread": "=7.22.15",
|
||||||
"@babel/plugin-proposal-optional-chaining": "=7.21.0",
|
"@babel/plugin-transform-optional-chaining": "=7.22.15",
|
||||||
"@babel/plugin-transform-modules-commonjs": "=7.22.11",
|
|
||||||
"@babel/plugin-transform-runtime": "=7.22.10",
|
"@babel/plugin-transform-runtime": "=7.22.10",
|
||||||
"@babel/preset-env": "=7.22.14",
|
"@babel/preset-env": "=7.22.14",
|
||||||
"@babel/preset-react": "=7.22.5",
|
"@babel/preset-react": "=7.22.5",
|
||||||
@@ -160,6 +159,7 @@
|
|||||||
"inspectpack": "=4.7.1",
|
"inspectpack": "=4.7.1",
|
||||||
"jest": "=29.6.3",
|
"jest": "=29.6.3",
|
||||||
"jest-environment-jsdom": "=29.6.4",
|
"jest-environment-jsdom": "=29.6.4",
|
||||||
|
"jest-transform-stub": "=2.0.0",
|
||||||
"jsdom": "=22.1.0",
|
"jsdom": "=22.1.0",
|
||||||
"json-loader": "^0.5.7",
|
"json-loader": "^0.5.7",
|
||||||
"json-merger": "^1.1.10",
|
"json-merger": "^1.1.10",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 734 B |
@@ -1,6 +0,0 @@
|
|||||||
/* global ace */
|
|
||||||
ace.define("ace/snippets/yaml",
|
|
||||||
["require","exports","module"], function(e,t,n){ // eslint-disable-line no-unused-vars
|
|
||||||
t.snippetText=undefined
|
|
||||||
t.scope="yaml"
|
|
||||||
})
|
|
||||||
@@ -3,6 +3,8 @@ import ImmutablePureComponent from "react-immutable-pure-component"
|
|||||||
import ImPropTypes from "react-immutable-proptypes"
|
import ImPropTypes from "react-immutable-proptypes"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
|
|
||||||
|
import RollingLoadSVG from "core/assets/rolling-load.svg"
|
||||||
|
|
||||||
const decodeRefName = uri => {
|
const decodeRefName = uri => {
|
||||||
const unescaped = uri.replace(/~1/g, "/").replace(/~0/g, "~")
|
const unescaped = uri.replace(/~1/g, "/").replace(/~0/g, "~")
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ export default class Model extends ImmutablePureComponent {
|
|||||||
if(!schema) {
|
if(!schema) {
|
||||||
return <span className="model model-title">
|
return <span className="model model-title">
|
||||||
<span className="model-title__text">{ displayName || name }</span>
|
<span className="model-title__text">{ displayName || name }</span>
|
||||||
<img src={require("core/../img/rolling-load.svg")} height={"20px"} width={"20px"} />
|
<img src={RollingLoadSVG} height={"20px"} width={"20px"} />
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { safeBuildUrl } from "core/utils/url"
|
|||||||
import { Iterable, List } from "immutable"
|
import { Iterable, List } from "immutable"
|
||||||
import ImPropTypes from "react-immutable-proptypes"
|
import ImPropTypes from "react-immutable-proptypes"
|
||||||
|
|
||||||
|
import RollingLoadSVG from "core/assets/rolling-load.svg"
|
||||||
|
|
||||||
export default class Operation extends PureComponent {
|
export default class Operation extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@@ -122,7 +123,7 @@ export default class Operation extends PureComponent {
|
|||||||
<Collapse isOpened={isShown}>
|
<Collapse isOpened={isShown}>
|
||||||
<div className="opblock-body">
|
<div className="opblock-body">
|
||||||
{ (operation && operation.size) || operation === null ? null :
|
{ (operation && operation.size) || operation === null ? null :
|
||||||
<img height={"32px"} width={"32px"} src={require("core/../img/rolling-load.svg")} className="opblock-loading-animation" />
|
<img height={"32px"} width={"32px"} src={RollingLoadSVG} className="opblock-loading-animation" />
|
||||||
}
|
}
|
||||||
{ deprecated && <h4 className="opblock-title_normal"> Warning: Deprecated</h4>}
|
{ deprecated && <h4 className="opblock-title_normal"> Warning: Deprecated</h4>}
|
||||||
{ description &&
|
{ description &&
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import PropTypes from "prop-types"
|
|||||||
import ImPropTypes from "react-immutable-proptypes"
|
import ImPropTypes from "react-immutable-proptypes"
|
||||||
import win from "core/window"
|
import win from "core/window"
|
||||||
import { getExtensions, getCommonExtensions, numberToString, stringify, isEmptyValue } from "core/utils"
|
import { getExtensions, getCommonExtensions, numberToString, stringify, isEmptyValue } from "core/utils"
|
||||||
import getParameterSchema from "../../helpers/get-parameter-schema.js"
|
import getParameterSchema from "core/utils/get-parameter-schema.js"
|
||||||
|
|
||||||
export default class ParameterRow extends Component {
|
export default class ParameterRow extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { fromJS, Iterable } from "immutable"
|
|||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
import ImPropTypes from "react-immutable-proptypes"
|
import ImPropTypes from "react-immutable-proptypes"
|
||||||
import { defaultStatusCode, getAcceptControllingResponse } from "core/utils"
|
import { defaultStatusCode, getAcceptControllingResponse } from "core/utils"
|
||||||
import createHtmlReadyId from "../../helpers/create-html-ready-id"
|
import createHtmlReadyId from "core/utils/create-html-ready-id"
|
||||||
|
|
||||||
export default class Responses extends React.Component {
|
export default class Responses extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|||||||
@@ -1,8 +1,31 @@
|
|||||||
import deepExtend from "deep-extend"
|
import deepExtend from "deep-extend"
|
||||||
|
|
||||||
import System from "./system"
|
import System from "./system"
|
||||||
|
// presets
|
||||||
|
import BasePreset from "./presets/base"
|
||||||
import ApisPreset from "./presets/apis"
|
import ApisPreset from "./presets/apis"
|
||||||
import AllPlugins from "./plugins/all"
|
// plugins
|
||||||
|
import AuthPlugin from "./plugins/auth/"
|
||||||
|
import ConfigsPlugin from "./plugins/configs"
|
||||||
|
import DeepLinkingPlugin from "./plugins/deep-linking"
|
||||||
|
import ErrPlugin from "./plugins/err"
|
||||||
|
import FilterPlugin from "./plugins/filter"
|
||||||
|
import IconsPlugin from "./plugins/icons"
|
||||||
|
import JSONSchema202012Plugin from "./plugins/json-schema-2020-12"
|
||||||
|
import LayoutPlugin from "./plugins/layout"
|
||||||
|
import LogsPlugin from "./plugins/logs"
|
||||||
|
import OpenAPI30Plugin from "./plugins/oas3"
|
||||||
|
import OpenAPI31Plugin from "./plugins/oas3"
|
||||||
|
import OnCompletePlugin from "./plugins/on-complete"
|
||||||
|
import RequestSnippetsPlugin from "./plugins/request-snippets"
|
||||||
|
import SamplesPlugin from "./plugins/samples"
|
||||||
|
import SpecPlugin from "./plugins/spec"
|
||||||
|
import SwaggerClientPlugin from "./plugins/swagger-client"
|
||||||
|
import UtilPlugin from "./plugins/util"
|
||||||
|
import ViewPlugin from "./plugins/view"
|
||||||
|
import DownloadUrlPlugin from "./plugins/download-url"
|
||||||
|
import SafeRenderPlugin from "./plugins/safe-render"
|
||||||
|
|
||||||
import { parseSearch } from "./utils"
|
import { parseSearch } from "./utils"
|
||||||
import win from "./window"
|
import win from "./window"
|
||||||
|
|
||||||
@@ -216,10 +239,30 @@ export default function SwaggerUI(opts) {
|
|||||||
return system
|
return system
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add presets
|
|
||||||
SwaggerUI.presets = {
|
SwaggerUI.presets = {
|
||||||
|
base: BasePreset,
|
||||||
apis: ApisPreset,
|
apis: ApisPreset,
|
||||||
}
|
}
|
||||||
|
|
||||||
// All Plugins
|
SwaggerUI.plugins = {
|
||||||
SwaggerUI.plugins = AllPlugins
|
Auth: AuthPlugin,
|
||||||
|
Configs: ConfigsPlugin,
|
||||||
|
DeepLining: DeepLinkingPlugin,
|
||||||
|
Err: ErrPlugin,
|
||||||
|
Filter: FilterPlugin,
|
||||||
|
Icons: IconsPlugin,
|
||||||
|
JSONSchema202012: JSONSchema202012Plugin,
|
||||||
|
Layout: LayoutPlugin,
|
||||||
|
Logs: LogsPlugin,
|
||||||
|
OpenAPI30: OpenAPI30Plugin,
|
||||||
|
OpenAPI31: OpenAPI31Plugin,
|
||||||
|
OnComplete: OnCompletePlugin,
|
||||||
|
RequestSnippets: RequestSnippetsPlugin,
|
||||||
|
Samples: SamplesPlugin,
|
||||||
|
Spec: SpecPlugin,
|
||||||
|
SwaggerClient: SwaggerClientPlugin,
|
||||||
|
Util: UtilPlugin,
|
||||||
|
View: ViewPlugin,
|
||||||
|
DownloadUrl: DownloadUrlPlugin,
|
||||||
|
SafeRender: SafeRenderPlugin,
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import { pascalCaseFilename } from "core/utils"
|
|
||||||
import SafeRender from "core/plugins/safe-render"
|
|
||||||
|
|
||||||
const request = require.context(".", true, /\.jsx?$/)
|
|
||||||
|
|
||||||
const allPlugins = {}
|
|
||||||
|
|
||||||
export default allPlugins
|
|
||||||
|
|
||||||
request.keys().forEach( function( key ){
|
|
||||||
if( key === "./index.js" ) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// if( key.slice(2).indexOf("/") > -1) {
|
|
||||||
// // skip files in subdirs
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
let mod = request(key)
|
|
||||||
allPlugins[pascalCaseFilename(key)] = mod.default ? mod.default : mod
|
|
||||||
})
|
|
||||||
|
|
||||||
allPlugins.SafeRender = SafeRender
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
import { createSelector } from "reselect"
|
|
||||||
import { Map } from "immutable"
|
|
||||||
import win from "../window"
|
|
||||||
|
|
||||||
export default function downloadUrlPlugin (toolbox) {
|
|
||||||
let { fn } = toolbox
|
|
||||||
|
|
||||||
const actions = {
|
|
||||||
download: (url)=> ({ errActions, specSelectors, specActions, getConfigs }) => {
|
|
||||||
let { fetch } = fn
|
|
||||||
const config = getConfigs()
|
|
||||||
url = url || specSelectors.url()
|
|
||||||
specActions.updateLoadingStatus("loading")
|
|
||||||
errActions.clear({source: "fetch"})
|
|
||||||
fetch({
|
|
||||||
url,
|
|
||||||
loadSpec: true,
|
|
||||||
requestInterceptor: config.requestInterceptor || (a => a),
|
|
||||||
responseInterceptor: config.responseInterceptor || (a => a),
|
|
||||||
credentials: "same-origin",
|
|
||||||
headers: {
|
|
||||||
"Accept": "application/json,*/*"
|
|
||||||
}
|
|
||||||
}).then(next,next)
|
|
||||||
|
|
||||||
function next(res) {
|
|
||||||
if(res instanceof Error || res.status >= 400) {
|
|
||||||
specActions.updateLoadingStatus("failed")
|
|
||||||
errActions.newThrownErr(Object.assign( new Error((res.message || res.statusText) + " " + url), {source: "fetch"}))
|
|
||||||
// Check if the failure was possibly due to CORS or mixed content
|
|
||||||
if (!res.status && res instanceof Error) checkPossibleFailReasons()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
specActions.updateLoadingStatus("success")
|
|
||||||
specActions.updateSpec(res.text)
|
|
||||||
if(specSelectors.url() !== url) {
|
|
||||||
specActions.updateUrl(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkPossibleFailReasons() {
|
|
||||||
try {
|
|
||||||
let specUrl
|
|
||||||
|
|
||||||
if("URL" in win ) {
|
|
||||||
specUrl = new URL(url)
|
|
||||||
} else {
|
|
||||||
// legacy browser, use <a href> to parse the URL
|
|
||||||
specUrl = document.createElement("a")
|
|
||||||
specUrl.href = url
|
|
||||||
}
|
|
||||||
|
|
||||||
if(specUrl.protocol !== "https:" && win.location.protocol === "https:") {
|
|
||||||
const error = Object.assign(
|
|
||||||
new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${specUrl.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),
|
|
||||||
{source: "fetch"}
|
|
||||||
)
|
|
||||||
errActions.newThrownErr(error)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(specUrl.origin !== win.location.origin) {
|
|
||||||
const error = Object.assign(
|
|
||||||
new Error(`Possible cross-origin (CORS) issue? The URL origin (${specUrl.origin}) does not match the page (${win.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),
|
|
||||||
{source: "fetch"}
|
|
||||||
)
|
|
||||||
errActions.newThrownErr(error)
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
updateLoadingStatus: (status) => {
|
|
||||||
let enums = [null, "loading", "failed", "success", "failedConfig"]
|
|
||||||
if(enums.indexOf(status) === -1) {
|
|
||||||
console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
type: "spec_update_loading_status",
|
|
||||||
payload: status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let reducers = {
|
|
||||||
"spec_update_loading_status": (state, action) => {
|
|
||||||
return (typeof action.payload === "string")
|
|
||||||
? state.set("loadingStatus", action.payload)
|
|
||||||
: state
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let selectors = {
|
|
||||||
loadingStatus: createSelector(
|
|
||||||
state => {
|
|
||||||
return state || Map()
|
|
||||||
},
|
|
||||||
spec => spec.get("loadingStatus") || null
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
statePlugins: {
|
|
||||||
spec: { actions, reducers, selectors }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
126
src/core/plugins/download-url/index.js
Normal file
126
src/core/plugins/download-url/index.js
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import { createSelector } from "reselect"
|
||||||
|
import { Map } from "immutable"
|
||||||
|
import win from "core/window"
|
||||||
|
|
||||||
|
export default function downloadUrlPlugin(toolbox) {
|
||||||
|
let { fn } = toolbox
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
download:
|
||||||
|
(url) =>
|
||||||
|
({ errActions, specSelectors, specActions, getConfigs }) => {
|
||||||
|
let { fetch } = fn
|
||||||
|
const config = getConfigs()
|
||||||
|
url = url || specSelectors.url()
|
||||||
|
specActions.updateLoadingStatus("loading")
|
||||||
|
errActions.clear({ source: "fetch" })
|
||||||
|
fetch({
|
||||||
|
url,
|
||||||
|
loadSpec: true,
|
||||||
|
requestInterceptor: config.requestInterceptor || ((a) => a),
|
||||||
|
responseInterceptor: config.responseInterceptor || ((a) => a),
|
||||||
|
credentials: "same-origin",
|
||||||
|
headers: {
|
||||||
|
Accept: "application/json,*/*",
|
||||||
|
},
|
||||||
|
}).then(next, next)
|
||||||
|
|
||||||
|
function next(res) {
|
||||||
|
if (res instanceof Error || res.status >= 400) {
|
||||||
|
specActions.updateLoadingStatus("failed")
|
||||||
|
errActions.newThrownErr(
|
||||||
|
Object.assign(
|
||||||
|
new Error((res.message || res.statusText) + " " + url),
|
||||||
|
{ source: "fetch" }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
// Check if the failure was possibly due to CORS or mixed content
|
||||||
|
if (!res.status && res instanceof Error) checkPossibleFailReasons()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
specActions.updateLoadingStatus("success")
|
||||||
|
specActions.updateSpec(res.text)
|
||||||
|
if (specSelectors.url() !== url) {
|
||||||
|
specActions.updateUrl(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPossibleFailReasons() {
|
||||||
|
try {
|
||||||
|
let specUrl
|
||||||
|
|
||||||
|
if ("URL" in win) {
|
||||||
|
specUrl = new URL(url)
|
||||||
|
} else {
|
||||||
|
// legacy browser, use <a href> to parse the URL
|
||||||
|
specUrl = document.createElement("a")
|
||||||
|
specUrl.href = url
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
specUrl.protocol !== "https:" &&
|
||||||
|
win.location.protocol === "https:"
|
||||||
|
) {
|
||||||
|
const error = Object.assign(
|
||||||
|
new Error(
|
||||||
|
`Possible mixed-content issue? The page was loaded over https:// but a ${specUrl.protocol}// URL was specified. Check that you are not attempting to load mixed content.`
|
||||||
|
),
|
||||||
|
{ source: "fetch" }
|
||||||
|
)
|
||||||
|
errActions.newThrownErr(error)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (specUrl.origin !== win.location.origin) {
|
||||||
|
const error = Object.assign(
|
||||||
|
new Error(
|
||||||
|
`Possible cross-origin (CORS) issue? The URL origin (${specUrl.origin}) does not match the page (${win.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`
|
||||||
|
),
|
||||||
|
{ source: "fetch" }
|
||||||
|
)
|
||||||
|
errActions.newThrownErr(error)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
updateLoadingStatus: (status) => {
|
||||||
|
let enums = [null, "loading", "failed", "success", "failedConfig"]
|
||||||
|
if (enums.indexOf(status) === -1) {
|
||||||
|
console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: "spec_update_loading_status",
|
||||||
|
payload: status,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
let reducers = {
|
||||||
|
spec_update_loading_status: (state, action) => {
|
||||||
|
return typeof action.payload === "string"
|
||||||
|
? state.set("loadingStatus", action.payload)
|
||||||
|
: state
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
let selectors = {
|
||||||
|
loadingStatus: createSelector(
|
||||||
|
(state) => {
|
||||||
|
return state || Map()
|
||||||
|
},
|
||||||
|
(spec) => spec.get("loadingStatus") || null
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
statePlugins: {
|
||||||
|
spec: { actions, reducers, selectors },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ import isEmpty from "lodash/isEmpty"
|
|||||||
import isPlainObject from "lodash/isPlainObject"
|
import isPlainObject from "lodash/isPlainObject"
|
||||||
|
|
||||||
import { objectify, normalizeArray } from "core/utils"
|
import { objectify, normalizeArray } from "core/utils"
|
||||||
import memoizeN from "../../../../../helpers/memoizeN"
|
import memoizeN from "core/utils/memoizeN"
|
||||||
import typeMap from "./types/index"
|
import typeMap from "./types/index"
|
||||||
import { getType } from "./core/type"
|
import { getType } from "./core/type"
|
||||||
import { typeCast } from "./core/utils"
|
import { typeCast } from "./core/utils"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { OrderedMap, Map, List } from "immutable"
|
|||||||
import { createSelector } from "reselect"
|
import { createSelector } from "reselect"
|
||||||
|
|
||||||
import { getDefaultRequestBodyValue } from "./components/request-body"
|
import { getDefaultRequestBodyValue } from "./components/request-body"
|
||||||
import { stringify } from "../../utils"
|
import { stringify } from "core/utils"
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import win from "../../window"
|
|
||||||
import { Map } from "immutable"
|
import { Map } from "immutable"
|
||||||
|
import win from "../../window"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if duplicate key name existed from FormData entries,
|
* if duplicate key name existed from FormData entries,
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import XML from "xml"
|
|||||||
import RandExp from "randexp"
|
import RandExp from "randexp"
|
||||||
import isEmpty from "lodash/isEmpty"
|
import isEmpty from "lodash/isEmpty"
|
||||||
import { objectify, isFunc, normalizeArray, deeplyStripKey } from "core/utils"
|
import { objectify, isFunc, normalizeArray, deeplyStripKey } from "core/utils"
|
||||||
|
import memoizeN from "core/utils/memoizeN"
|
||||||
import memoizeN from "../../../../helpers/memoizeN"
|
|
||||||
|
|
||||||
const generateStringFromRegex = (pattern) => {
|
const generateStringFromRegex = (pattern) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
import reducers from "./reducers"
|
import reducers from "./reducers"
|
||||||
import * as actions from "./actions"
|
import * as actions from "./actions"
|
||||||
import * as selectors from "./selectors"
|
import * as selectors from "./selectors"
|
||||||
import * as wrapActions from "./wrap-actions"
|
import * as wrapActions from "./wrap-actions"
|
||||||
|
|
||||||
export default function() {
|
const SpecPlugin = () => ({
|
||||||
return {
|
statePlugins: {
|
||||||
statePlugins: {
|
spec: {
|
||||||
spec: {
|
wrapActions: { ...wrapActions },
|
||||||
wrapActions,
|
reducers: { ...reducers },
|
||||||
reducers,
|
actions: { ...actions },
|
||||||
actions,
|
selectors: { ...selectors },
|
||||||
selectors
|
},
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
export default SpecPlugin
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { fromJS, List } from "immutable"
|
import { fromJS, List } from "immutable"
|
||||||
import { fromJSOrdered, validateParam, paramToValue } from "core/utils"
|
import { fromJSOrdered, validateParam, paramToValue, paramToIdentifier } from "core/utils"
|
||||||
import win from "../../window"
|
import win from "core/window"
|
||||||
|
|
||||||
// selector-in-reducer is suboptimal, but `operationWithMeta` is more of a helper
|
// selector-in-reducer is suboptimal, but `operationWithMeta` is more of a helper
|
||||||
import {
|
import {
|
||||||
@@ -27,7 +27,6 @@ import {
|
|||||||
CLEAR_VALIDATE_PARAMS,
|
CLEAR_VALIDATE_PARAMS,
|
||||||
SET_SCHEME
|
SET_SCHEME
|
||||||
} from "./actions"
|
} from "./actions"
|
||||||
import { paramToIdentifier } from "../../utils"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { createSelector } from "reselect"
|
import { createSelector } from "reselect"
|
||||||
import { sorters } from "core/utils"
|
import { sorters, paramToIdentifier } from "core/utils"
|
||||||
import { fromJS, Set, Map, OrderedMap, List } from "immutable"
|
import { fromJS, Set, Map, OrderedMap, List } from "immutable"
|
||||||
import { paramToIdentifier } from "../../utils"
|
|
||||||
|
|
||||||
const DEFAULT_TAG = "default"
|
const DEFAULT_TAG = "default"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { memoize } from "core/utils"
|
import { memoize } from "core/utils"
|
||||||
|
|
||||||
|
import memoizeN from "core/utils/memoizeN"
|
||||||
import { getComponent, render, withMappedContainer } from "./root-injects"
|
import { getComponent, render, withMappedContainer } from "./root-injects"
|
||||||
import { getDisplayName } from "./fn"
|
import { getDisplayName } from "./fn"
|
||||||
import memoizeN from "../../../helpers/memoizeN"
|
|
||||||
|
|
||||||
const memoizeForGetComponent = (fn) => {
|
const memoizeForGetComponent = (fn) => {
|
||||||
const resolver = (...args) => JSON.stringify(args)
|
const resolver = (...args) => JSON.stringify(args)
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
/**
|
|
||||||
* @prettier
|
|
||||||
*/
|
|
||||||
import BasePreset from "./base"
|
|
||||||
import OAS3Plugin from "../plugins/oas3"
|
|
||||||
import OAS31Plugin from "../plugins/oas31"
|
|
||||||
import JSONSchema202012Plugin from "../plugins/json-schema-2020-12"
|
|
||||||
|
|
||||||
export default function PresetApis() {
|
|
||||||
return [BasePreset, OAS3Plugin, JSONSchema202012Plugin, OAS31Plugin]
|
|
||||||
}
|
|
||||||
11
src/core/presets/apis/index.js
Normal file
11
src/core/presets/apis/index.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import BasePreset from "core/presets/base"
|
||||||
|
import OpenAPI30Plugin from "core/plugins/oas3"
|
||||||
|
import OpenAPI31Plugin from "core/plugins/oas31"
|
||||||
|
import JSONSchema202012Plugin from "core/plugins/json-schema-2020-12"
|
||||||
|
|
||||||
|
export default function PresetApis() {
|
||||||
|
return [BasePreset, OpenAPI30Plugin, JSONSchema202012Plugin, OpenAPI31Plugin]
|
||||||
|
}
|
||||||
49
src/core/presets/base/index.js
Normal file
49
src/core/presets/base/index.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import AuthPlugin from "core/plugins/auth/"
|
||||||
|
import ConfigsPlugin from "core/plugins/configs"
|
||||||
|
import DeepLinkingPlugin from "core/plugins/deep-linking"
|
||||||
|
import ErrPlugin from "core/plugins/err"
|
||||||
|
import FilterPlugin from "core/plugins/filter"
|
||||||
|
import IconsPlugin from "core/plugins/icons"
|
||||||
|
import LayoutPlugin from "core/plugins/layout"
|
||||||
|
import LogsPlugin from "core/plugins/logs"
|
||||||
|
import OnCompletePlugin from "core/plugins/on-complete"
|
||||||
|
import RequestSnippetsPlugin from "core/plugins/request-snippets"
|
||||||
|
import SamplesPlugin from "core/plugins/samples"
|
||||||
|
import SpecPlugin from "core/plugins/spec"
|
||||||
|
import SwaggerClientPlugin from "core/plugins/swagger-client"
|
||||||
|
import UtilPlugin from "core/plugins/util"
|
||||||
|
import ViewPlugin from "core/plugins/view"
|
||||||
|
import DownloadUrlPlugin from "core/plugins/download-url"
|
||||||
|
import SafeRenderPlugin from "core/plugins/safe-render"
|
||||||
|
// ad-hoc plugins
|
||||||
|
import CoreComponentsPlugin from "core/presets/base/plugins/core-components"
|
||||||
|
import FormComponentsPlugin from "core/presets/base/plugins/form-components"
|
||||||
|
import JSONSchemaComponentsPlugin from "core/presets/base/plugins/json-schema-components"
|
||||||
|
|
||||||
|
const BasePreset = () => [
|
||||||
|
ConfigsPlugin,
|
||||||
|
UtilPlugin,
|
||||||
|
LogsPlugin,
|
||||||
|
ViewPlugin,
|
||||||
|
SpecPlugin,
|
||||||
|
ErrPlugin,
|
||||||
|
IconsPlugin,
|
||||||
|
LayoutPlugin,
|
||||||
|
SamplesPlugin,
|
||||||
|
CoreComponentsPlugin,
|
||||||
|
FormComponentsPlugin,
|
||||||
|
SwaggerClientPlugin,
|
||||||
|
JSONSchemaComponentsPlugin,
|
||||||
|
AuthPlugin,
|
||||||
|
DownloadUrlPlugin,
|
||||||
|
DeepLinkingPlugin,
|
||||||
|
FilterPlugin,
|
||||||
|
OnCompletePlugin,
|
||||||
|
RequestSnippetsPlugin,
|
||||||
|
SafeRenderPlugin(),
|
||||||
|
]
|
||||||
|
|
||||||
|
export default BasePreset
|
||||||
@@ -1,26 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @prettier
|
* @prettier
|
||||||
*/
|
*/
|
||||||
import err from "core/plugins/err"
|
|
||||||
import layout from "core/plugins/layout"
|
|
||||||
import spec from "core/plugins/spec"
|
|
||||||
import view from "core/plugins/view"
|
|
||||||
import samples from "core/plugins/samples"
|
|
||||||
import requestSnippets from "core/plugins/request-snippets"
|
|
||||||
import logs from "core/plugins/logs"
|
|
||||||
import swaggerJs from "core/plugins/swagger-js"
|
|
||||||
import auth from "core/plugins/auth"
|
|
||||||
import util from "core/plugins/util"
|
|
||||||
import downloadUrlPlugin from "core/plugins/download-url"
|
|
||||||
import configsPlugin from "core/plugins/configs"
|
|
||||||
import deepLinkingPlugin from "core/plugins/deep-linking"
|
|
||||||
import filter from "core/plugins/filter"
|
|
||||||
import onComplete from "core/plugins/on-complete"
|
|
||||||
import safeRender from "core/plugins/safe-render"
|
|
||||||
import iconsPlugin from "core/plugins/icons"
|
|
||||||
|
|
||||||
import OperationContainer from "core/containers/OperationContainer"
|
|
||||||
|
|
||||||
import App from "core/components/app"
|
import App from "core/components/app"
|
||||||
import AuthorizationPopup from "core/components/auth/authorization-popup"
|
import AuthorizationPopup from "core/components/auth/authorization-popup"
|
||||||
import AuthorizeBtn from "core/components/auth/authorize-btn"
|
import AuthorizeBtn from "core/components/auth/authorize-btn"
|
||||||
@@ -41,6 +21,7 @@ import OnlineValidatorBadge from "core/components/online-validator-badge"
|
|||||||
import Operations from "core/components/operations"
|
import Operations from "core/components/operations"
|
||||||
import OperationTag from "core/components/operation-tag"
|
import OperationTag from "core/components/operation-tag"
|
||||||
import Operation from "core/components/operation"
|
import Operation from "core/components/operation"
|
||||||
|
import OperationContainer from "core/containers/OperationContainer"
|
||||||
import OperationSummary from "core/components/operation-summary"
|
import OperationSummary from "core/components/operation-summary"
|
||||||
import OperationSummaryMethod from "core/components/operation-summary-method"
|
import OperationSummaryMethod from "core/components/operation-summary-method"
|
||||||
import OperationSummaryPath from "core/components/operation-summary-path"
|
import OperationSummaryPath from "core/components/operation-summary-path"
|
||||||
@@ -91,116 +72,83 @@ import DeepLink from "core/components/deep-link"
|
|||||||
import SvgAssets from "core/components/svg-assets"
|
import SvgAssets from "core/components/svg-assets"
|
||||||
import Markdown from "core/components/providers/markdown"
|
import Markdown from "core/components/providers/markdown"
|
||||||
import BaseLayout from "core/components/layouts/base"
|
import BaseLayout from "core/components/layouts/base"
|
||||||
import * as LayoutUtils from "core/components/layout-utils"
|
|
||||||
import * as JsonSchemaComponents from "core/json-schema-components"
|
|
||||||
|
|
||||||
export default function () {
|
const CoreComponentsPlugin = () => ({
|
||||||
let coreComponents = {
|
components: {
|
||||||
components: {
|
App,
|
||||||
App,
|
authorizationPopup: AuthorizationPopup,
|
||||||
authorizationPopup: AuthorizationPopup,
|
authorizeBtn: AuthorizeBtn,
|
||||||
authorizeBtn: AuthorizeBtn,
|
AuthorizeBtnContainer,
|
||||||
AuthorizeBtnContainer,
|
authorizeOperationBtn: AuthorizeOperationBtn,
|
||||||
authorizeOperationBtn: AuthorizeOperationBtn,
|
auths: Auths,
|
||||||
auths: Auths,
|
AuthItem: AuthItem,
|
||||||
AuthItem: AuthItem,
|
authError: AuthError,
|
||||||
authError: AuthError,
|
oauth2: Oauth2,
|
||||||
oauth2: Oauth2,
|
apiKeyAuth: ApiKeyAuth,
|
||||||
apiKeyAuth: ApiKeyAuth,
|
basicAuth: BasicAuth,
|
||||||
basicAuth: BasicAuth,
|
clear: Clear,
|
||||||
clear: Clear,
|
liveResponse: LiveResponse,
|
||||||
liveResponse: LiveResponse,
|
InitializedInput,
|
||||||
InitializedInput,
|
info: Info,
|
||||||
info: Info,
|
InfoContainer,
|
||||||
InfoContainer,
|
InfoUrl,
|
||||||
InfoUrl,
|
InfoBasePath,
|
||||||
InfoBasePath,
|
Contact,
|
||||||
Contact,
|
License,
|
||||||
License,
|
JumpToPath,
|
||||||
JumpToPath,
|
CopyToClipboardBtn,
|
||||||
CopyToClipboardBtn,
|
onlineValidatorBadge: OnlineValidatorBadge,
|
||||||
onlineValidatorBadge: OnlineValidatorBadge,
|
operations: Operations,
|
||||||
operations: Operations,
|
operation: Operation,
|
||||||
operation: Operation,
|
OperationSummary,
|
||||||
OperationSummary,
|
OperationSummaryMethod,
|
||||||
OperationSummaryMethod,
|
OperationSummaryPath,
|
||||||
OperationSummaryPath,
|
highlightCode: HighlightCode,
|
||||||
highlightCode: HighlightCode,
|
responses: Responses,
|
||||||
responses: Responses,
|
response: Response,
|
||||||
response: Response,
|
ResponseExtension: ResponseExtension,
|
||||||
ResponseExtension: ResponseExtension,
|
responseBody: ResponseBody,
|
||||||
responseBody: ResponseBody,
|
parameters: Parameters,
|
||||||
parameters: Parameters,
|
parameterRow: ParameterRow,
|
||||||
parameterRow: ParameterRow,
|
execute: Execute,
|
||||||
execute: Execute,
|
headers: Headers,
|
||||||
headers: Headers,
|
errors: Errors,
|
||||||
errors: Errors,
|
contentType: ContentType,
|
||||||
contentType: ContentType,
|
overview: Overview,
|
||||||
overview: Overview,
|
footer: Footer,
|
||||||
footer: Footer,
|
FilterContainer,
|
||||||
FilterContainer,
|
ParamBody: ParamBody,
|
||||||
ParamBody: ParamBody,
|
curl: Curl,
|
||||||
curl: Curl,
|
schemes: Schemes,
|
||||||
schemes: Schemes,
|
SchemesContainer,
|
||||||
SchemesContainer,
|
modelExample: ModelExample,
|
||||||
modelExample: ModelExample,
|
ModelWrapper,
|
||||||
ModelWrapper,
|
ModelCollapse,
|
||||||
ModelCollapse,
|
Model,
|
||||||
Model,
|
Models,
|
||||||
Models,
|
EnumModel,
|
||||||
EnumModel,
|
ObjectModel,
|
||||||
ObjectModel,
|
ArrayModel,
|
||||||
ArrayModel,
|
PrimitiveModel,
|
||||||
PrimitiveModel,
|
Property,
|
||||||
Property,
|
TryItOutButton,
|
||||||
TryItOutButton,
|
Markdown,
|
||||||
Markdown,
|
BaseLayout,
|
||||||
BaseLayout,
|
VersionPragmaFilter,
|
||||||
VersionPragmaFilter,
|
VersionStamp,
|
||||||
VersionStamp,
|
OperationExt,
|
||||||
OpenAPIVersion,
|
OperationExtRow,
|
||||||
OperationExt,
|
ParameterExt,
|
||||||
OperationExtRow,
|
ParameterIncludeEmpty,
|
||||||
ParameterExt,
|
OperationTag,
|
||||||
ParameterIncludeEmpty,
|
OperationContainer,
|
||||||
OperationTag,
|
OpenAPIVersion,
|
||||||
OperationContainer,
|
DeepLink,
|
||||||
DeepLink,
|
SvgAssets,
|
||||||
SvgAssets,
|
Example,
|
||||||
Example,
|
ExamplesSelect,
|
||||||
ExamplesSelect,
|
ExamplesSelectValueRetainer,
|
||||||
ExamplesSelectValueRetainer,
|
},
|
||||||
},
|
})
|
||||||
}
|
|
||||||
|
|
||||||
let formComponents = {
|
export default CoreComponentsPlugin
|
||||||
components: LayoutUtils,
|
|
||||||
}
|
|
||||||
|
|
||||||
let jsonSchemaComponents = {
|
|
||||||
components: JsonSchemaComponents,
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
configsPlugin,
|
|
||||||
util,
|
|
||||||
logs,
|
|
||||||
view,
|
|
||||||
spec,
|
|
||||||
err,
|
|
||||||
layout,
|
|
||||||
samples,
|
|
||||||
coreComponents,
|
|
||||||
formComponents,
|
|
||||||
swaggerJs,
|
|
||||||
jsonSchemaComponents,
|
|
||||||
auth,
|
|
||||||
downloadUrlPlugin,
|
|
||||||
deepLinkingPlugin,
|
|
||||||
filter,
|
|
||||||
onComplete,
|
|
||||||
requestSnippets,
|
|
||||||
iconsPlugin,
|
|
||||||
safeRender(),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
10
src/core/presets/base/plugins/form-components/index.js
Normal file
10
src/core/presets/base/plugins/form-components/index.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import * as LayoutUtils from "core/components/layout-utils"
|
||||||
|
|
||||||
|
const FormComponentsPlugin = () => ({
|
||||||
|
components: { ...LayoutUtils },
|
||||||
|
})
|
||||||
|
|
||||||
|
export default FormComponentsPlugin
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import * as JSONSchemaComponents from "core/components/json-schema-components"
|
||||||
|
|
||||||
|
const JSONSchemaComponentsPlugin = () => ({
|
||||||
|
components: { ...JSONSchemaComponents },
|
||||||
|
})
|
||||||
|
|
||||||
|
export default JSONSchemaComponentsPlugin
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import PropTypes from "prop-types"
|
|
||||||
|
|
||||||
// Takes a list and proptype, and returns a PropType.shape({ [item]: propType })
|
|
||||||
const mapListToPropTypeShape = (list, propType) => PropTypes.shape(
|
|
||||||
list.reduce((shape, propName) => {
|
|
||||||
shape[propName] = propType
|
|
||||||
return shape
|
|
||||||
}, {}))
|
|
||||||
|
|
||||||
|
|
||||||
export const arrayOrString = PropTypes.oneOfType([
|
|
||||||
PropTypes.arrayOf(PropTypes.string),
|
|
||||||
PropTypes.string,
|
|
||||||
])
|
|
||||||
|
|
||||||
export const objectWithFuncs = list => mapListToPropTypeShape(list, PropTypes.func.isRequired)
|
|
||||||
@@ -5,7 +5,7 @@ import deepExtend from "deep-extend"
|
|||||||
import { combineReducers } from "redux-immutable"
|
import { combineReducers } from "redux-immutable"
|
||||||
import { serializeError } from "serialize-error"
|
import { serializeError } from "serialize-error"
|
||||||
import merge from "lodash/merge"
|
import merge from "lodash/merge"
|
||||||
import { NEW_THROWN_ERR } from "corePlugins/err/actions"
|
import { NEW_THROWN_ERR } from "core/plugins/err/actions"
|
||||||
import win from "core/window"
|
import win from "core/window"
|
||||||
|
|
||||||
import { systemThunkMiddleware, isFn, objMap, objReduce, isObject, isArray, isFunc } from "core/utils"
|
import { systemThunkMiddleware, isFn, objMap, objReduce, isObject, isArray, isFunc } from "core/utils"
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ import find from "lodash/find"
|
|||||||
import some from "lodash/some"
|
import some from "lodash/some"
|
||||||
import eq from "lodash/eq"
|
import eq from "lodash/eq"
|
||||||
import isFunction from "lodash/isFunction"
|
import isFunction from "lodash/isFunction"
|
||||||
import win from "./window"
|
|
||||||
import cssEscape from "css.escape"
|
import cssEscape from "css.escape"
|
||||||
import getParameterSchema from "../helpers/get-parameter-schema"
|
|
||||||
import randomBytes from "randombytes"
|
import randomBytes from "randombytes"
|
||||||
import shaJs from "sha.js"
|
import shaJs from "sha.js"
|
||||||
|
import win from "core/window"
|
||||||
|
import getParameterSchema from "core/utils/get-parameter-schema"
|
||||||
|
|
||||||
|
|
||||||
const DEFAULT_RESPONSE_KEY = "default"
|
const DEFAULT_RESPONSE_KEY = "default"
|
||||||
|
|
||||||
@@ -117,11 +118,11 @@ export function createObjWithHashedKeys (fdObj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function bindToState(obj, state) {
|
export function bindToState(obj, state) {
|
||||||
var newObj = {}
|
var newObj = {}
|
||||||
Object.keys(obj)
|
Object.keys(obj)
|
||||||
.filter(key => typeof obj[key] === "function")
|
.filter(key => typeof obj[key] === "function")
|
||||||
.forEach(key => newObj[key] = obj[key].bind(null, state))
|
.forEach(key => newObj[key] = obj[key].bind(null, state))
|
||||||
return newObj
|
return newObj
|
||||||
}
|
}
|
||||||
|
|
||||||
export function normalizeArray(arr) {
|
export function normalizeArray(arr) {
|
||||||
@@ -344,21 +345,21 @@ export const validateString = ( val ) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const validateDateTime = (val) => {
|
export const validateDateTime = (val) => {
|
||||||
if (isNaN(Date.parse(val))) {
|
if (isNaN(Date.parse(val))) {
|
||||||
return "Value must be a DateTime"
|
return "Value must be a DateTime"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const validateGuid = (val) => {
|
export const validateGuid = (val) => {
|
||||||
val = val.toString().toLowerCase()
|
val = val.toString().toLowerCase()
|
||||||
if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(val)) {
|
if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(val)) {
|
||||||
return "Value must be a Guid"
|
return "Value must be a Guid"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const validateMaxLength = (val, max) => {
|
export const validateMaxLength = (val, max) => {
|
||||||
if (val.length > max) {
|
if (val.length > max) {
|
||||||
return `Value must be no longer than ${max} character${max !== 1 ? "s" : ""}`
|
return `Value must be no longer than ${max} character${max !== 1 ? "s" : ""}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +387,7 @@ export const validateUniqueItems = (val, uniqueItems) => {
|
|||||||
|
|
||||||
export const validateMinItems = (val, min) => {
|
export const validateMinItems = (val, min) => {
|
||||||
if (!val && min >= 1 || val && val.length < min) {
|
if (!val && min >= 1 || val && val.length < min) {
|
||||||
return `Array must contain at least ${min} item${min === 1 ? "" : "s"}`
|
return `Array must contain at least ${min} item${min === 1 ? "" : "s"}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,14 +399,14 @@ export const validateMaxItems = (val, max) => {
|
|||||||
|
|
||||||
export const validateMinLength = (val, min) => {
|
export const validateMinLength = (val, min) => {
|
||||||
if (val.length < min) {
|
if (val.length < min) {
|
||||||
return `Value must be at least ${min} character${min !== 1 ? "s" : ""}`
|
return `Value must be at least ${min} character${min !== 1 ? "s" : ""}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const validatePattern = (val, rxPattern) => {
|
export const validatePattern = (val, rxPattern) => {
|
||||||
var patt = new RegExp(rxPattern)
|
var patt = new RegExp(rxPattern)
|
||||||
if (!patt.test(val)) {
|
if (!patt.test(val)) {
|
||||||
return "Value must follow pattern " + rxPattern
|
return "Value must follow pattern " + rxPattern
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -823,10 +824,10 @@ export function generateCodeVerifier() {
|
|||||||
|
|
||||||
export function createCodeChallenge(codeVerifier) {
|
export function createCodeChallenge(codeVerifier) {
|
||||||
return b64toB64UrlEncoded(
|
return b64toB64UrlEncoded(
|
||||||
shaJs("sha256")
|
shaJs("sha256")
|
||||||
.update(codeVerifier)
|
.update(codeVerifier)
|
||||||
.digest("base64")
|
.digest("base64")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function b64toB64UrlEncoded(str) {
|
function b64toB64UrlEncoded(str) {
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 581 B |
@@ -1,7 +0,0 @@
|
|||||||
import Configs from "./configs"
|
|
||||||
import Topbar from "./topbar"
|
|
||||||
|
|
||||||
export default {
|
|
||||||
Configs,
|
|
||||||
Topbar
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import Topbar from "./topbar"
|
|
||||||
import Logo from "./logo"
|
|
||||||
|
|
||||||
export default function () {
|
|
||||||
return {
|
|
||||||
components: {
|
|
||||||
Topbar,
|
|
||||||
Logo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import React from "react"
|
|
||||||
import SwaggerUILogo from "./logo_small.svg"
|
|
||||||
|
|
||||||
export const Logo = () => (
|
|
||||||
<img height="40" src={ SwaggerUILogo } alt="Swagger UI"/>
|
|
||||||
)
|
|
||||||
|
|
||||||
export default Logo
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import StandaloneLayout from "./layout"
|
|
||||||
import TopbarPlugin from "plugins/topbar"
|
|
||||||
import ConfigsPlugin from "corePlugins/configs"
|
|
||||||
import SafeRenderPlugin from "core/plugins/safe-render"
|
|
||||||
|
|
||||||
// the Standalone preset
|
|
||||||
|
|
||||||
export default [
|
|
||||||
TopbarPlugin,
|
|
||||||
ConfigsPlugin,
|
|
||||||
() => {
|
|
||||||
return {
|
|
||||||
components: { StandaloneLayout }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
SafeRenderPlugin({
|
|
||||||
fullOverride: true,
|
|
||||||
componentList: [
|
|
||||||
"Topbar",
|
|
||||||
"StandaloneLayout",
|
|
||||||
"onlineValidatorBadge"
|
|
||||||
]
|
|
||||||
})
|
|
||||||
]
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
|
|
||||||
export default class StandaloneLayout extends React.Component {
|
class StandaloneLayout extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
errSelectors: PropTypes.object.isRequired,
|
errSelectors: PropTypes.object.isRequired,
|
||||||
@@ -36,3 +36,5 @@ export default class StandaloneLayout extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default StandaloneLayout
|
||||||
12
src/standalone/plugins/stadalone-layout/index.js
Normal file
12
src/standalone/plugins/stadalone-layout/index.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import StandaloneLayout from "./components/StandaloneLayout"
|
||||||
|
|
||||||
|
const StandaloneLayoutPlugin = () => ({
|
||||||
|
components: {
|
||||||
|
StandaloneLayout,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
export default StandaloneLayoutPlugin
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
9
src/standalone/plugins/top-bar/components/Logo.jsx
Normal file
9
src/standalone/plugins/top-bar/components/Logo.jsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import React from "react"
|
||||||
|
import SwaggerUILogo from "../assets/logo_small.svg"
|
||||||
|
|
||||||
|
const Logo = () => <img height="40" src={SwaggerUILogo} alt="Swagger UI" />
|
||||||
|
|
||||||
|
export default Logo
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
import React, { cloneElement } from "react"
|
import React, { cloneElement } from "react"
|
||||||
import PropTypes from "prop-types"
|
import PropTypes from "prop-types"
|
||||||
|
|
||||||
//import "./topbar.less"
|
import {parseSearch, serializeSearch} from "core/utils"
|
||||||
import {parseSearch, serializeSearch} from "../../core/utils"
|
|
||||||
|
|
||||||
export default class Topbar extends React.Component {
|
class TopBar extends React.Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
layoutActions: PropTypes.object.isRequired,
|
layoutActions: PropTypes.object.isRequired,
|
||||||
@@ -163,9 +162,11 @@ export default class Topbar extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Topbar.propTypes = {
|
TopBar.propTypes = {
|
||||||
specSelectors: PropTypes.object.isRequired,
|
specSelectors: PropTypes.object.isRequired,
|
||||||
specActions: PropTypes.object.isRequired,
|
specActions: PropTypes.object.isRequired,
|
||||||
getComponent: PropTypes.func.isRequired,
|
getComponent: PropTypes.func.isRequired,
|
||||||
getConfigs: PropTypes.func.isRequired
|
getConfigs: PropTypes.func.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TopBar
|
||||||
11
src/standalone/plugins/top-bar/index.js
Normal file
11
src/standalone/plugins/top-bar/index.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import TopBar from "./components/TopBar"
|
||||||
|
import Logo from "./components/Logo"
|
||||||
|
|
||||||
|
const TopBarPlugin = () => ({
|
||||||
|
components: { Topbar: TopBar, Logo },
|
||||||
|
})
|
||||||
|
|
||||||
|
export default TopBarPlugin
|
||||||
19
src/standalone/presets/standalone/index.js
Normal file
19
src/standalone/presets/standalone/index.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/**
|
||||||
|
* @prettier
|
||||||
|
*/
|
||||||
|
import StandaloneLayoutPlugin from "standalone/plugins/stadalone-layout"
|
||||||
|
import TopBarPlugin from "standalone/plugins/top-bar"
|
||||||
|
import ConfigsPlugin from "core/plugins/configs"
|
||||||
|
import SafeRenderPlugin from "core/plugins/safe-render"
|
||||||
|
|
||||||
|
const StandalonePreset = [
|
||||||
|
TopBarPlugin,
|
||||||
|
ConfigsPlugin,
|
||||||
|
StandaloneLayoutPlugin,
|
||||||
|
SafeRenderPlugin({
|
||||||
|
fullOverride: true,
|
||||||
|
componentList: ["Topbar", "StandaloneLayout", "onlineValidatorBadge"],
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
|
||||||
|
export default StandalonePreset
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import expect from "expect"
|
import expect from "expect"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import HighlightCode from "components/highlight-code"
|
import HighlightCode from "core/components/highlight-code"
|
||||||
|
|
||||||
const fakeGetConfigs = () => ({syntaxHighlight: {activated: true, theme: "agate"}})
|
const fakeGetConfigs = () => ({syntaxHighlight: {activated: true, theme: "agate"}})
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import expect from "expect"
|
import expect from "expect"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import ResponseBody from "components/response-body"
|
import ResponseBody from "core/components/response-body"
|
||||||
|
|
||||||
describe("<ResponseBody />", function() {
|
describe("<ResponseBody />", function() {
|
||||||
const highlightCodeComponent = () => null
|
const highlightCodeComponent = () => null
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { fromJSOrdered } from "core/utils"
|
|||||||
import sinon from "sinon"
|
import sinon from "sinon"
|
||||||
import expect from "expect"
|
import expect from "expect"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import LiveResponse from "components/live-response"
|
import LiveResponse from "core/components/live-response"
|
||||||
import ResponseBody from "components/response-body"
|
import ResponseBody from "core/components/response-body"
|
||||||
import RequestSnippets from "core/plugins/request-snippets/request-snippets"
|
import RequestSnippets from "core/plugins/request-snippets/request-snippets"
|
||||||
|
|
||||||
describe("<LiveResponse/>", function () {
|
describe("<LiveResponse/>", function () {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from "react"
|
|||||||
import expect from "expect"
|
import expect from "expect"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import { fromJS, Map } from "immutable"
|
import { fromJS, Map } from "immutable"
|
||||||
import OnlineValidatorBadge from "components/online-validator-badge"
|
import OnlineValidatorBadge from "core/components/online-validator-badge"
|
||||||
|
|
||||||
describe("<OnlineValidatorBadge/>", function () {
|
describe("<OnlineValidatorBadge/>", function () {
|
||||||
it("should render a validator link and image correctly for the default validator", function () {
|
it("should render a validator link and image correctly for the default validator", function () {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from "react"
|
|||||||
import expect from "expect"
|
import expect from "expect"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import { fromJS, Map } from "immutable"
|
import { fromJS, Map } from "immutable"
|
||||||
import OnlineValidatorBadge from "components/online-validator-badge"
|
import OnlineValidatorBadge from "core/components/online-validator-badge"
|
||||||
|
|
||||||
describe("<OnlineValidatorBadge/> Anchor Target Safety", function () {
|
describe("<OnlineValidatorBadge/> Anchor Target Safety", function () {
|
||||||
it("should render a validator link with safe `rel` attributes", function () {
|
it("should render a validator link with safe `rel` attributes", function () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
import Markdown from "components/providers/markdown"
|
import Markdown from "core/components/providers/markdown"
|
||||||
|
|
||||||
describe("UI-3199: Sanitized Markdown causing code examples to be double escaped", function(){
|
describe("UI-3199: Sanitized Markdown causing code examples to be double escaped", function(){
|
||||||
it("should single-escape quotes", function(){
|
it("should single-escape quotes", function(){
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
import Markdown from "components/providers/markdown"
|
import Markdown from "core/components/providers/markdown"
|
||||||
|
|
||||||
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
|
describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){
|
||||||
it("should return no text for `null` as source input", function(){
|
it("should return no text for `null` as source input", function(){
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React from "react"
|
|||||||
import { List, fromJS } from "immutable"
|
import { List, fromJS } from "immutable"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
|
|
||||||
import ParameterRow from "components/parameter-row"
|
import ParameterRow from "core/components/parameter-row"
|
||||||
import {
|
import {
|
||||||
memoizedSampleFromSchema,
|
memoizedSampleFromSchema,
|
||||||
memoizedCreateXMLExample,
|
memoizedCreateXMLExample,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import FilterContainer from "containers/filter"
|
import FilterContainer from "core/containers/filter"
|
||||||
import { Col } from "components/layout-utils"
|
import { Col } from "core/components/layout-utils"
|
||||||
|
|
||||||
describe("<FilterContainer/>", function(){
|
describe("<FilterContainer/>", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import InfoContainer from "containers/info"
|
import InfoContainer from "core/containers/info"
|
||||||
|
|
||||||
describe("<InfoContainer/>", function () {
|
describe("<InfoContainer/>", function () {
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import Immutable, { List } from "immutable"
|
import Immutable, { List } from "immutable"
|
||||||
import { Select, Input, TextArea } from "components/layout-utils"
|
import { Select, Input, TextArea } from "core/components/layout-utils"
|
||||||
import { mount, render } from "enzyme"
|
import { mount, render } from "enzyme"
|
||||||
import * as JsonSchemaComponents from "core/json-schema-components"
|
import * as JsonSchemaComponents from "core/components/json-schema-components"
|
||||||
import { JsonSchemaForm } from "core/json-schema-components"
|
|
||||||
|
|
||||||
const components = {...JsonSchemaComponents, Select, Input, TextArea}
|
const components = {...JsonSchemaComponents, Select, Input, TextArea}
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ const getComponentStub = (name) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("<JsonSchemaForm/>", function(){
|
describe("<JsonSchemaComponents.JsonSchemaForm/>", function(){
|
||||||
describe("strings", function() {
|
describe("strings", function() {
|
||||||
it("should render the correct options for a string enum parameter", function(){
|
it("should render the correct options for a string enum parameter", function(){
|
||||||
|
|
||||||
@@ -29,7 +28,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("option").length).toEqual(3)
|
expect(wrapper.find("option").length).toEqual(3)
|
||||||
@@ -53,7 +52,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
disabled: true
|
disabled: true
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.attr("disabled")).toEqual("disabled")
|
expect(wrapper.attr("disabled")).toEqual("disabled")
|
||||||
})
|
})
|
||||||
@@ -74,7 +73,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("select option").length).toEqual(2)
|
expect(wrapper.find("select option").length).toEqual(2)
|
||||||
@@ -96,7 +95,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("select option").length).toEqual(3)
|
expect(wrapper.find("select option").length).toEqual(3)
|
||||||
@@ -120,7 +119,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("select option").length).toEqual(2)
|
expect(wrapper.find("select option").length).toEqual(2)
|
||||||
@@ -143,7 +142,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("select option").length).toEqual(3)
|
expect(wrapper.find("select option").length).toEqual(3)
|
||||||
@@ -168,7 +167,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.get(0).name).toEqual("select")
|
expect(wrapper.get(0).name).toEqual("select")
|
||||||
expect(wrapper.find("select option").length).toEqual(1)
|
expect(wrapper.find("select option").length).toEqual(1)
|
||||||
@@ -200,7 +199,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
let wrapper = mount(<JsonSchemaForm {...props}/>)
|
let wrapper = mount(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
updateQueue.forEach(newProps => wrapper.setProps(newProps))
|
updateQueue.forEach(newProps => wrapper.setProps(newProps))
|
||||||
|
|
||||||
@@ -223,7 +222,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.length).toEqual(1)
|
expect(wrapper.length).toEqual(1)
|
||||||
expect(wrapper.get(0).name).toEqual("input")
|
expect(wrapper.get(0).name).toEqual("input")
|
||||||
@@ -246,7 +245,7 @@ describe("<JsonSchemaForm/>", function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let wrapper = render(<JsonSchemaForm {...props}/>)
|
let wrapper = render(<JsonSchemaComponents.JsonSchemaForm {...props}/>)
|
||||||
|
|
||||||
expect(wrapper.length).toEqual(1)
|
expect(wrapper.length).toEqual(1)
|
||||||
expect(wrapper.get(0).name).toEqual("input")
|
expect(wrapper.get(0).name).toEqual("input")
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { fromJSOrdered } from "core/utils"
|
import { fromJSOrdered } from "core/utils"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import Curl from "components/curl"
|
import Curl from "core/components/curl"
|
||||||
import LiveResponse from "components/live-response"
|
import LiveResponse from "core/components/live-response"
|
||||||
import ResponseBody from "components/response-body"
|
import ResponseBody from "core/components/response-body"
|
||||||
|
|
||||||
describe("<LiveResponse/>", function(){
|
describe("<LiveResponse/>", function(){
|
||||||
let request = fromJSOrdered({
|
let request = fromJSOrdered({
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
import Markdown from "components/providers/markdown"
|
import Markdown from "core/components/providers/markdown"
|
||||||
import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.jsx"
|
import { Markdown as OAS3Markdown } from "core/plugins/oas3/wrap-components/markdown.jsx"
|
||||||
|
|
||||||
describe("Markdown component", function () {
|
describe("Markdown component", function () {
|
||||||
describe("Swagger 2.0", function () {
|
describe("Swagger 2.0", function () {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import ModelExample from "components/model-example"
|
import ModelExample from "core/components/model-example"
|
||||||
import ModelComponent from "components/model-wrapper"
|
import ModelComponent from "core/components/model-wrapper"
|
||||||
|
|
||||||
describe("<ModelExample/>", function(){
|
describe("<ModelExample/>", function(){
|
||||||
let components, props
|
let components, props
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import { fromJS, Map } from "immutable"
|
import { fromJS, Map } from "immutable"
|
||||||
import Models from "components/models"
|
import Models from "core/components/models"
|
||||||
import ModelCollapse from "components/model-collapse"
|
import ModelCollapse from "core/components/model-collapse"
|
||||||
import ModelComponent from "components/model-wrapper"
|
import ModelComponent from "core/components/model-wrapper"
|
||||||
|
|
||||||
describe("<Models/>", function(){
|
describe("<Models/>", function(){
|
||||||
const dummyComponent = () => null
|
const dummyComponent = () => null
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import { List } from "immutable"
|
import { List } from "immutable"
|
||||||
import ObjectModel from "components/object-model"
|
import ObjectModel from "core/components/object-model"
|
||||||
// import ModelExample from "components/model-example"
|
// import ModelExample from "core/components/model-example"
|
||||||
import Immutable from "immutable"
|
import Immutable from "immutable"
|
||||||
import Model from "components/model"
|
import Model from "core/components/model"
|
||||||
import ModelCollapse from "components/model-collapse"
|
import ModelCollapse from "core/components/model-collapse"
|
||||||
import Property from "components/property"
|
import Property from "core/components/property"
|
||||||
// import { inferSchema } from "corePlugins/samples/fn"
|
// import { inferSchema } from "core/plugins/samples/fn"
|
||||||
|
|
||||||
describe("<ObjectModel />", function() {
|
describe("<ObjectModel />", function() {
|
||||||
const dummyComponent = () => null
|
const dummyComponent = () => null
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import OnlineValidatorBadge from "components/online-validator-badge"
|
import OnlineValidatorBadge from "core/components/online-validator-badge"
|
||||||
|
|
||||||
describe("<OnlineValidatorBadge/>", function () {
|
describe("<OnlineValidatorBadge/>", function () {
|
||||||
it("should render a validator link and image correctly for the default validator", function () {
|
it("should render a validator link and image correctly for the default validator", function () {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import OperationTag from "components/operation-tag"
|
import OperationTag from "core/components/operation-tag"
|
||||||
import Im from "immutable"
|
import Im from "immutable"
|
||||||
import { Link } from "components/layout-utils"
|
import { Link } from "core/components/layout-utils"
|
||||||
|
|
||||||
describe("<OperationTag/>", function(){
|
describe("<OperationTag/>", function(){
|
||||||
it("render externalDocs URL for swagger v2", function(){
|
it("render externalDocs URL for swagger v2", function(){
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import Operation from "components/operation"
|
import Operation from "core/components/operation"
|
||||||
|
|
||||||
describe("<Operation/>", function(){
|
describe("<Operation/>", function(){
|
||||||
it.skip("blanket tests", function(){
|
it.skip("blanket tests", function(){
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import DeepLink from "components/deep-link"
|
import DeepLink from "core/components/deep-link"
|
||||||
import Operations from "components/operations"
|
import Operations from "core/components/operations"
|
||||||
import {Collapse} from "components/layout-utils"
|
import {Collapse} from "core/components/layout-utils"
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
Collapse,
|
Collapse,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React from "react"
|
|||||||
import { List, fromJS } from "immutable"
|
import { List, fromJS } from "immutable"
|
||||||
import { render } from "enzyme"
|
import { render } from "enzyme"
|
||||||
|
|
||||||
import ParameterRow from "components/parameter-row"
|
import ParameterRow from "core/components/parameter-row"
|
||||||
import {
|
import {
|
||||||
memoizedSampleFromSchema,
|
memoizedSampleFromSchema,
|
||||||
memoizedCreateXMLExample,
|
memoizedCreateXMLExample,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import PrimitiveModel from "components/primitive-model"
|
import PrimitiveModel from "core/components/primitive-model"
|
||||||
import ModelCollapse from "components/model-collapse"
|
import ModelCollapse from "core/components/model-collapse"
|
||||||
|
|
||||||
describe("<PrimitiveModel/>", function () {
|
describe("<PrimitiveModel/>", function () {
|
||||||
const dummyComponent = () => null
|
const dummyComponent = () => null
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import ResponseBody from "components/response-body"
|
import ResponseBody from "core/components/response-body"
|
||||||
|
|
||||||
describe("<ResponseBody />", function () {
|
describe("<ResponseBody />", function () {
|
||||||
const highlightCodeComponent = () => null
|
const highlightCodeComponent = () => null
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import React from "react"
|
|||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import { fromJS, List } from "immutable"
|
import { fromJS, List } from "immutable"
|
||||||
|
|
||||||
import Response from "components/response"
|
import Response from "core/components/response"
|
||||||
import ModelExample from "components/model-example"
|
import ModelExample from "core/components/model-example"
|
||||||
import {
|
import {
|
||||||
inferSchema,
|
inferSchema,
|
||||||
memoizedSampleFromSchema,
|
memoizedSampleFromSchema,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { mount } from "enzyme"
|
import { mount } from "enzyme"
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import SchemesContainer from "containers/schemes"
|
import SchemesContainer from "core/containers/schemes"
|
||||||
import Schemes from "components/schemes"
|
import Schemes from "core/components/schemes"
|
||||||
import { Col } from "components/layout-utils"
|
import { Col } from "core/components/layout-utils"
|
||||||
|
|
||||||
describe("<SchemesContainer/>", function(){
|
describe("<SchemesContainer/>", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import Schemes from "components/schemes"
|
import Schemes from "core/components/schemes"
|
||||||
|
|
||||||
describe("<Schemes/>", function(){
|
describe("<Schemes/>", function(){
|
||||||
it("calls props.specActions.setScheme() when no currentScheme is selected", function(){
|
it("calls props.specActions.setScheme() when no currentScheme is selected", function(){
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import { shallow } from "enzyme"
|
import { shallow } from "enzyme"
|
||||||
import VersionPragmaFilter from "components/version-pragma-filter"
|
import VersionPragmaFilter from "core/components/version-pragma-filter"
|
||||||
|
|
||||||
describe("<VersionPragmaFilter/>", function(){
|
describe("<VersionPragmaFilter/>", function(){
|
||||||
it("renders children for a Swagger 2 definition", function(){
|
it("renders children for a Swagger 2 definition", function(){
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import getParameterSchema from "../../../../src/helpers/get-parameter-schema"
|
import getParameterSchema from "../../../../src/core/utils/get-parameter-schema"
|
||||||
|
|
||||||
describe("getParameterSchema", () => {
|
describe("getParameterSchema", () => {
|
||||||
it("should return an empty Map when given no parameters", () => {
|
it("should return an empty Map when given no parameters", () => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
authorizeOauth2WithPersistOption,
|
authorizeOauth2WithPersistOption,
|
||||||
logoutWithPersistOption,
|
logoutWithPersistOption,
|
||||||
persistAuthorizationIfNeeded
|
persistAuthorizationIfNeeded
|
||||||
} from "corePlugins/auth/actions"
|
} from "core/plugins/auth/actions"
|
||||||
import {authorizeAccessCodeWithBasicAuthentication, authPopup} from "../../../../../src/core/plugins/auth/actions"
|
import {authorizeAccessCodeWithBasicAuthentication, authPopup} from "../../../../../src/core/plugins/auth/actions"
|
||||||
|
|
||||||
describe("auth plugin - actions", () => {
|
describe("auth plugin - actions", () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loaded } from "corePlugins/auth/configs-extensions/wrap-actions"
|
import { loaded } from "core/plugins/auth/configs-extensions/wrap-actions"
|
||||||
|
|
||||||
describe("loaded hook", () => {
|
describe("loaded hook", () => {
|
||||||
describe("authorization data restoration", () => {
|
describe("authorization data restoration", () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { preauthorizeBasic, preauthorizeApiKey } from "corePlugins/auth"
|
import { preauthorizeBasic, preauthorizeApiKey } from "core/plugins/auth"
|
||||||
import { authorize } from "corePlugins/auth/actions"
|
import { authorize } from "core/plugins/auth/actions"
|
||||||
|
|
||||||
const S2_SYSTEM = {
|
const S2_SYSTEM = {
|
||||||
authActions: {
|
authActions: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { definitionsToAuthorize, definitionsForRequirements } from "corePlugins/auth/selectors"
|
import { definitionsToAuthorize, definitionsForRequirements } from "core/plugins/auth/selectors"
|
||||||
|
|
||||||
describe("auth plugin - selectors", () => {
|
describe("auth plugin - selectors", () => {
|
||||||
describe("definitionsToAuthorize", () => {
|
describe("definitionsToAuthorize", () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { execute } from "corePlugins/auth/spec-extensions/wrap-actions"
|
import { execute } from "core/plugins/auth/spec-extensions/wrap-actions"
|
||||||
|
|
||||||
describe("spec plugin - actions", function(){
|
describe("spec plugin - actions", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @prettier
|
* @prettier
|
||||||
*/
|
*/
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { authorize, logout } from "corePlugins/auth/wrap-actions"
|
import { authorize, logout } from "core/plugins/auth/wrap-actions"
|
||||||
|
|
||||||
describe("Cookie based apiKey persistence in document.cookie", () => {
|
describe("Cookie based apiKey persistence in document.cookie", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { downloadConfig } from "corePlugins/configs/spec-actions"
|
import { downloadConfig } from "core/plugins/configs/spec-actions"
|
||||||
|
|
||||||
describe("configs plugin - actions", () => {
|
describe("configs plugin - actions", () => {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Map, List } from "immutable"
|
import { Map, List } from "immutable"
|
||||||
import { transform } from "corePlugins/err/error-transformers/transformers/not-of-type"
|
import { transform } from "core/plugins/err/error-transformers/transformers/not-of-type"
|
||||||
|
|
||||||
describe("err plugin - tranformers - not of type", () => {
|
describe("err plugin - tranformers - not of type", () => {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-useless-escape */
|
/* eslint-disable no-useless-escape */
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { transform } from "corePlugins/err/error-transformers/transformers/parameter-oneof"
|
import { transform } from "core/plugins/err/error-transformers/transformers/parameter-oneof"
|
||||||
|
|
||||||
describe.skip("err plugin - tranformers - parameter oneof", () => {
|
describe.skip("err plugin - tranformers - parameter oneof", () => {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Map } from "immutable"
|
import { Map } from "immutable"
|
||||||
import opsFilter from "corePlugins/filter/opsFilter"
|
import opsFilter from "core/plugins/filter/opsFilter"
|
||||||
|
|
||||||
describe("opsFilter", function() {
|
describe("opsFilter", function() {
|
||||||
const taggedOps = Map([["pet"], ["store"], ["user"]])
|
const taggedOps = Map([["pet"], ["store"], ["user"]])
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { isOAS30, isSwagger2 } from "corePlugins/oas3/helpers"
|
import { isOAS30, isSwagger2 } from "core/plugins/oas3/helpers"
|
||||||
|
|
||||||
const isOAS3Shorthand = (version) => isOAS30(fromJS({
|
const isOAS3Shorthand = (version) => isOAS30(fromJS({
|
||||||
openapi: version
|
openapi: version
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import reducer from "corePlugins/oas3/reducers"
|
import reducer from "core/plugins/oas3/reducers"
|
||||||
|
|
||||||
describe("oas3 plugin - reducer", function () {
|
describe("oas3 plugin - reducer", function () {
|
||||||
describe("SET_REQUEST_BODY_VALIDATE_ERROR", () => {
|
describe("SET_REQUEST_BODY_VALIDATE_ERROR", () => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { mount } from "enzyme"
|
|||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import ServersContainer from "core/plugins/oas3/components/servers-container"
|
import ServersContainer from "core/plugins/oas3/components/servers-container"
|
||||||
import Servers from "core/plugins/oas3/components/servers"
|
import Servers from "core/plugins/oas3/components/servers"
|
||||||
import { Col } from "components/layout-utils"
|
import { Col } from "core/components/layout-utils"
|
||||||
|
|
||||||
describe("<ServersContainer/>", function(){
|
describe("<ServersContainer/>", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import {
|
|||||||
serverVariableValue,
|
serverVariableValue,
|
||||||
serverVariables,
|
serverVariables,
|
||||||
serverEffectiveValue
|
serverEffectiveValue
|
||||||
} from "corePlugins/oas3/selectors"
|
} from "core/plugins/oas3/selectors"
|
||||||
|
|
||||||
import reducers from "corePlugins/oas3/reducers"
|
import reducers from "core/plugins/oas3/reducers"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setSelectedServer,
|
setSelectedServer,
|
||||||
setServerVariableValue,
|
setServerVariableValue,
|
||||||
} from "corePlugins/oas3/actions"
|
} from "core/plugins/oas3/actions"
|
||||||
|
|
||||||
describe("OAS3 plugin - state", function() {
|
describe("OAS3 plugin - state", function() {
|
||||||
describe("action + reducer + selector integration", function() {
|
describe("action + reducer + selector integration", function() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { fromJS, Map } from "immutable"
|
import { fromJS, Map } from "immutable"
|
||||||
import {
|
import {
|
||||||
definitionsToAuthorize
|
definitionsToAuthorize
|
||||||
} from "corePlugins/oas3/auth-extensions/wrap-selectors"
|
} from "core/plugins/oas3/auth-extensions/wrap-selectors"
|
||||||
|
|
||||||
describe("oas3 plugin - auth extensions - wrapSelectors", function(){
|
describe("oas3 plugin - auth extensions - wrapSelectors", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { definitions } from "corePlugins/oas3/spec-extensions/wrap-selectors"
|
import { definitions } from "core/plugins/oas3/spec-extensions/wrap-selectors"
|
||||||
|
|
||||||
describe("oas3 plugin - spec extensions - wrapSelectors", function(){
|
describe("oas3 plugin - spec extensions - wrapSelectors", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { createXMLExample, sampleFromSchema, memoizedCreateXMLExample, memoizedSampleFromSchema } from "corePlugins/samples/fn/index"
|
import { createXMLExample, sampleFromSchema, memoizedCreateXMLExample, memoizedSampleFromSchema } from "core/plugins/samples/fn/index"
|
||||||
|
|
||||||
describe("sampleFromSchema", () => {
|
describe("sampleFromSchema", () => {
|
||||||
it("handles Immutable.js objects for nested schemas", function () {
|
it("handles Immutable.js objects for nested schemas", function () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { execute, executeRequest, changeParamByIdentity, updateEmptyParamInclusion } from "corePlugins/spec/actions"
|
import { execute, executeRequest, changeParamByIdentity, updateEmptyParamInclusion } from "core/plugins/spec/actions"
|
||||||
|
|
||||||
describe("spec plugin - actions", function(){
|
describe("spec plugin - actions", function(){
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import reducer from "corePlugins/spec/reducers"
|
import reducer from "core/plugins/spec/reducers"
|
||||||
|
|
||||||
describe("spec plugin - reducer", function(){
|
describe("spec plugin - reducer", function(){
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user