@upendra19/swagger-ui-custom 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -0
- package/dist/swagger-ui-bundle.js +1 -1
- package/dist/swagger-ui-es-bundle-core.js +1 -1
- package/dist/swagger-ui-es-bundle-core.js.map +1 -1
- package/dist/swagger-ui-es-bundle.js +1 -1
- package/dist/swagger-ui.css +15 -1
- package/dist/swagger-ui.css.map +1 -1
- package/dist/swagger-ui.js +1 -1
- package/dist/swagger-ui.js.map +1 -1
- package/package.json +8 -17
- package/.agignore +0 -1
- package/.browserslistrc +0 -29
- package/.dockerignore +0 -8
- package/.editorconfig +0 -10
- package/.eslintrc.js +0 -78
- package/.lintstagedrc +0 -4
- package/.nvmrc +0 -1
- package/.prettierrc.yaml +0 -5
- package/.releaserc +0 -26
- package/AUTHORIZATION_CONFIG.md +0 -350
- package/Dockerfile +0 -39
- package/babel.config.js +0 -140
- package/composer.json +0 -40
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/index.css +0 -16
- package/dist/index.html +0 -19
- package/dist/log.bundle-sizes.swagger-ui.txt +0 -114
- package/dist/log.es-bundle-core-sizes.swagger-ui.txt +0 -14
- package/dist/log.es-bundle-sizes.swagger-ui.txt +0 -114
- package/dist/swagger-initializer.js +0 -20
- package/dist/swagger-ui-bundle.js.LICENSE.txt +0 -106
- package/dist/swagger-ui-bundle.js.map +0 -1
- package/dist/swagger-ui-es-bundle-core.js.LICENSE.txt +0 -35
- package/dist/swagger-ui-es-bundle.js.LICENSE.txt +0 -106
- package/dist/swagger-ui-es-bundle.js.map +0 -1
- package/dist/swagger-ui-standalone-preset.js.LICENSE.txt +0 -22
- package/dist/swagger-ui-standalone-preset.js.map +0 -1
- package/docker/configurator/helpers.js +0 -13
- package/docker/configurator/index.js +0 -52
- package/docker/configurator/oauth.js +0 -55
- package/docker/configurator/translator.js +0 -111
- package/docker/configurator/variables.js +0 -125
- package/docker/cors.conf +0 -14
- package/docker/default.conf.template +0 -43
- package/docker/docker-entrypoint.d/40-swagger-ui.sh +0 -52
- package/docker/embedding.conf +0 -5
- package/snapcraft.yaml +0 -28
- package/src/core/assets/rolling-load.svg +0 -1
- package/src/core/components/app.jsx +0 -30
- package/src/core/components/auth/api-key-auth.jsx +0 -93
- package/src/core/components/auth/auth-item.jsx +0 -60
- package/src/core/components/auth/authorization-popup.jsx +0 -59
- package/src/core/components/auth/authorize-btn.jsx +0 -30
- package/src/core/components/auth/authorize-operation-btn.jsx +0 -35
- package/src/core/components/auth/auths.jsx +0 -124
- package/src/core/components/auth/basic-auth.jsx +0 -110
- package/src/core/components/auth/error.jsx +0 -24
- package/src/core/components/auth/oauth2.jsx +0 -283
- package/src/core/components/clear.jsx +0 -25
- package/src/core/components/contact.jsx +0 -44
- package/src/core/components/content-type.jsx +0 -64
- package/src/core/components/copy-to-clipboard-btn.jsx +0 -29
- package/src/core/components/curl.jsx +0 -38
- package/src/core/components/debug.jsx +0 -50
- package/src/core/components/deep-link.jsx +0 -20
- package/src/core/components/errors.jsx +0 -132
- package/src/core/components/example.jsx +0 -43
- package/src/core/components/examples-select-value-retainer.jsx +0 -254
- package/src/core/components/examples-select.jsx +0 -139
- package/src/core/components/execute.jsx +0 -103
- package/src/core/components/footer.jsx +0 -9
- package/src/core/components/headers.jsx +0 -58
- package/src/core/components/info.jsx +0 -169
- package/src/core/components/initialized-input.jsx +0 -36
- package/src/core/components/jump-to-path.jsx +0 -9
- package/src/core/components/layout-utils.jsx +0 -265
- package/src/core/components/layouts/base.jsx +0 -156
- package/src/core/components/layouts/xpane.jsx +0 -73
- package/src/core/components/license.jsx +0 -40
- package/src/core/components/live-response.jsx +0 -133
- package/src/core/components/online-validator-badge.jsx +0 -120
- package/src/core/components/openapi-version.jsx +0 -15
- package/src/core/components/operation-extension-row.jsx +0 -17
- package/src/core/components/operation-extensions.jsx +0 -35
- package/src/core/components/operation-summary-method.jsx +0 -25
- package/src/core/components/operation-summary-path.jsx +0 -54
- package/src/core/components/operation-summary.jsx +0 -102
- package/src/core/components/operation-tag.jsx +0 -121
- package/src/core/components/operation.jsx +0 -259
- package/src/core/components/operations.jsx +0 -100
- package/src/core/components/overview.jsx +0 -119
- package/src/core/components/param-body.jsx +0 -156
- package/src/core/components/parameter-extension.jsx +0 -12
- package/src/core/components/parameter-include-empty.jsx +0 -59
- package/src/core/components/parameter-row.jsx +0 -438
- package/src/core/components/parameters/index.js +0 -1
- package/src/core/components/parameters/parameters.jsx +0 -287
- package/src/core/components/property.jsx +0 -17
- package/src/core/components/providers/README.md +0 -6
- package/src/core/components/providers/markdown.jsx +0 -72
- package/src/core/components/response-body.jsx +0 -170
- package/src/core/components/response-extension.jsx +0 -12
- package/src/core/components/response.jsx +0 -276
- package/src/core/components/responses.jsx +0 -170
- package/src/core/components/svg-assets.jsx +0 -48
- package/src/core/components/system-wrapper.jsx +0 -0
- package/src/core/components/try-it-out-button.jsx +0 -41
- package/src/core/components/version-pragma-filter.jsx +0 -54
- package/src/core/components/version-stamp.jsx +0 -12
- package/src/core/containers/OperationContainer.jsx +0 -267
- package/src/core/containers/authorize-btn.jsx +0 -31
- package/src/core/containers/filter.jsx +0 -44
- package/src/core/containers/info.jsx +0 -35
- package/src/core/index.js +0 -174
- package/src/core/oauth2-authorize.js +0 -137
- package/src/core/plugins/auth/actions.js +0 -286
- package/src/core/plugins/auth/components/lock-auth-icon.jsx +0 -27
- package/src/core/plugins/auth/components/unlock-auth-icon.jsx +0 -27
- package/src/core/plugins/auth/configs-extensions/wrap-actions.js +0 -19
- package/src/core/plugins/auth/index.js +0 -94
- package/src/core/plugins/auth/reducers.js +0 -77
- package/src/core/plugins/auth/selectors.js +0 -121
- package/src/core/plugins/auth/spec-extensions/wrap-actions.js +0 -10
- package/src/core/plugins/auth/wrap-actions.js +0 -66
- package/src/core/plugins/configs/actions.js +0 -58
- package/src/core/plugins/configs/fn.js +0 -12
- package/src/core/plugins/configs/index.js +0 -16
- package/src/core/plugins/configs/reducers.js +0 -20
- package/src/core/plugins/configs/selectors.js +0 -4
- package/src/core/plugins/deep-linking/README.md +0 -1
- package/src/core/plugins/deep-linking/helpers.js +0 -7
- package/src/core/plugins/deep-linking/index.js +0 -24
- package/src/core/plugins/deep-linking/layout.js +0 -209
- package/src/core/plugins/deep-linking/operation-tag-wrapper.jsx +0 -25
- package/src/core/plugins/deep-linking/operation-wrapper.jsx +0 -27
- package/src/core/plugins/download-url/index.js +0 -126
- package/src/core/plugins/err/actions.js +0 -60
- package/src/core/plugins/err/error-transformers/README.md +0 -31
- package/src/core/plugins/err/error-transformers/hook.js +0 -38
- package/src/core/plugins/err/error-transformers/transformers/not-of-type.js +0 -29
- package/src/core/plugins/err/error-transformers/transformers/parameter-oneof.js +0 -59
- package/src/core/plugins/err/index.js +0 -15
- package/src/core/plugins/err/reducers.js +0 -100
- package/src/core/plugins/err/selectors.js +0 -15
- package/src/core/plugins/filter/index.js +0 -9
- package/src/core/plugins/filter/opsFilter.js +0 -3
- package/src/core/plugins/icons/components/arrow-down.jsx +0 -28
- package/src/core/plugins/icons/components/arrow-up.jsx +0 -28
- package/src/core/plugins/icons/components/arrow.jsx +0 -28
- package/src/core/plugins/icons/components/close.jsx +0 -28
- package/src/core/plugins/icons/components/copy.jsx +0 -34
- package/src/core/plugins/icons/components/lock.jsx +0 -28
- package/src/core/plugins/icons/components/unlock.jsx +0 -28
- package/src/core/plugins/icons/index.js +0 -24
- package/src/core/plugins/json-schema-2020-12/components/Accordion/Accordion.jsx +0 -45
- package/src/core/plugins/json-schema-2020-12/components/Accordion/_accordion.scss +0 -33
- package/src/core/plugins/json-schema-2020-12/components/ExpandDeepButton/ExpandDeepButton.jsx +0 -31
- package/src/core/plugins/json-schema-2020-12/components/ExpandDeepButton/_expand-deep-button.scss +0 -10
- package/src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx +0 -227
- package/src/core/plugins/json-schema-2020-12/components/JSONSchema/_json-schema.scss +0 -34
- package/src/core/plugins/json-schema-2020-12/components/JSONViewer/JSONViewer.jsx +0 -153
- package/src/core/plugins/json-schema-2020-12/components/JSONViewer/_json-viewer.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/_all.scss +0 -4
- package/src/core/plugins/json-schema-2020-12/components/_mixins.scss +0 -82
- package/src/core/plugins/json-schema-2020-12/components/icons/ChevronRight.jsx +0 -17
- package/src/core/plugins/json-schema-2020-12/components/keywords/$anchor.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$comment.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$defs.jsx +0 -93
- package/src/core/plugins/json-schema-2020-12/components/keywords/$dynamicAnchor.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$dynamicRef.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$id.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$ref.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$schema.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/$vocabulary/$vocabulary.jsx +0 -66
- package/src/core/plugins/json-schema-2020-12/components/keywords/$vocabulary/_$vocabulary.scss +0 -17
- package/src/core/plugins/json-schema-2020-12/components/keywords/AdditionalProperties.jsx +0 -55
- package/src/core/plugins/json-schema-2020-12/components/keywords/AllOf.jsx +0 -105
- package/src/core/plugins/json-schema-2020-12/components/keywords/AnyOf.jsx +0 -105
- package/src/core/plugins/json-schema-2020-12/components/keywords/Const/Const.jsx +0 -28
- package/src/core/plugins/json-schema-2020-12/components/keywords/Const/_const.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/keywords/Constraint/Constraint.jsx +0 -38
- package/src/core/plugins/json-schema-2020-12/components/keywords/Constraint/_constraint.scss +0 -16
- package/src/core/plugins/json-schema-2020-12/components/keywords/Contains.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/ContentSchema.jsx +0 -39
- package/src/core/plugins/json-schema-2020-12/components/keywords/Default/Default.jsx +0 -28
- package/src/core/plugins/json-schema-2020-12/components/keywords/Default/_default.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/keywords/DependentRequired/DependentRequired.jsx +0 -37
- package/src/core/plugins/json-schema-2020-12/components/keywords/DependentRequired/_dependent-required.scss +0 -12
- package/src/core/plugins/json-schema-2020-12/components/keywords/DependentSchemas.jsx +0 -97
- package/src/core/plugins/json-schema-2020-12/components/keywords/Deprecated.jsx +0 -22
- package/src/core/plugins/json-schema-2020-12/components/keywords/Description/Description.jsx +0 -24
- package/src/core/plugins/json-schema-2020-12/components/keywords/Description/_description.scss +0 -9
- package/src/core/plugins/json-schema-2020-12/components/keywords/Else.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/Enum/Enum.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/Enum/_enum.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/keywords/Examples/Examples.jsx +0 -30
- package/src/core/plugins/json-schema-2020-12/components/keywords/Examples/_examples.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/keywords/ExtensionKeywords/ExtensionKeywords.jsx +0 -103
- package/src/core/plugins/json-schema-2020-12/components/keywords/ExtensionKeywords/_extension-keywords.scss +0 -11
- package/src/core/plugins/json-schema-2020-12/components/keywords/If.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/Items.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/Not.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/OneOf.jsx +0 -105
- package/src/core/plugins/json-schema-2020-12/components/keywords/PatternProperties/PatternProperties.jsx +0 -41
- package/src/core/plugins/json-schema-2020-12/components/keywords/PatternProperties/_pattern-properties.scss +0 -21
- package/src/core/plugins/json-schema-2020-12/components/keywords/PrefixItems.jsx +0 -105
- package/src/core/plugins/json-schema-2020-12/components/keywords/Properties/Properties.jsx +0 -61
- package/src/core/plugins/json-schema-2020-12/components/keywords/Properties/_properties.scss +0 -24
- package/src/core/plugins/json-schema-2020-12/components/keywords/PropertyNames.jsx +0 -38
- package/src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly.jsx +0 -22
- package/src/core/plugins/json-schema-2020-12/components/keywords/Then.jsx +0 -35
- package/src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx +0 -24
- package/src/core/plugins/json-schema-2020-12/components/keywords/Title/_title.scss +0 -26
- package/src/core/plugins/json-schema-2020-12/components/keywords/Type.jsx +0 -27
- package/src/core/plugins/json-schema-2020-12/components/keywords/UnevaluatedItems.jsx +0 -39
- package/src/core/plugins/json-schema-2020-12/components/keywords/UnevaluatedProperties.jsx +0 -39
- package/src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly.jsx +0 -22
- package/src/core/plugins/json-schema-2020-12/components/keywords/_all.scss +0 -43
- package/src/core/plugins/json-schema-2020-12/context.js +0 -14
- package/src/core/plugins/json-schema-2020-12/enum.js +0 -10
- package/src/core/plugins/json-schema-2020-12/fn.js +0 -527
- package/src/core/plugins/json-schema-2020-12/hoc.jsx +0 -296
- package/src/core/plugins/json-schema-2020-12/hooks.js +0 -144
- package/src/core/plugins/json-schema-2020-12/index.js +0 -153
- package/src/core/plugins/json-schema-2020-12/prop-types.js +0 -10
- package/src/core/plugins/json-schema-2020-12-samples/fn/api/encoderAPI.js +0 -20
- package/src/core/plugins/json-schema-2020-12-samples/fn/api/formatAPI.js +0 -20
- package/src/core/plugins/json-schema-2020-12-samples/fn/api/mediaTypeAPI.js +0 -27
- package/src/core/plugins/json-schema-2020-12-samples/fn/api/optionAPI.js +0 -17
- package/src/core/plugins/json-schema-2020-12-samples/fn/class/EncoderRegistry.js +0 -33
- package/src/core/plugins/json-schema-2020-12-samples/fn/class/FormatRegistry.js +0 -65
- package/src/core/plugins/json-schema-2020-12-samples/fn/class/MediaTypeRegistry.js +0 -27
- package/src/core/plugins/json-schema-2020-12-samples/fn/class/OptionRegistry.js +0 -16
- package/src/core/plugins/json-schema-2020-12-samples/fn/class/Registry.js +0 -24
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/constants.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/example.js +0 -57
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/merge.js +0 -83
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/predicates.js +0 -16
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/random.js +0 -46
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/type.js +0 -156
- package/src/core/plugins/json-schema-2020-12-samples/fn/core/utils.js +0 -23
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/7bit.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/8bit.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/base16.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/base32.js +0 -34
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/base64.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/base64url.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/binary.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/encoders/quoted-printable.js +0 -38
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/date-time.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/date.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/double.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/duration.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/email.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/float.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/hostname.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/idn-email.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/idn-hostname.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/int32.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/int64.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/ipv4.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/ipv6.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/iri-reference.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/iri.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/json-pointer.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/media-types/application.js +0 -17
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/media-types/audio.js +0 -10
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/media-types/image.js +0 -10
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/media-types/text.js +0 -17
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/media-types/video.js +0 -10
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/password.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/regex.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/relative-json-pointer.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/time.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/uri-reference.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/uri-template.js +0 -7
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/uri.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/generators/uuid.js +0 -6
- package/src/core/plugins/json-schema-2020-12-samples/fn/get-json-sample-schema.js +0 -36
- package/src/core/plugins/json-schema-2020-12-samples/fn/get-sample-schema.js +0 -39
- package/src/core/plugins/json-schema-2020-12-samples/fn/get-xml-sample-schema.js +0 -35
- package/src/core/plugins/json-schema-2020-12-samples/fn/get-yaml-sample-schema.js +0 -34
- package/src/core/plugins/json-schema-2020-12-samples/fn/index.js +0 -16
- package/src/core/plugins/json-schema-2020-12-samples/fn/main.js +0 -562
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/array.js +0 -52
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/boolean.js +0 -9
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/index.js +0 -30
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/integer.js +0 -43
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/null.js +0 -9
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/number.js +0 -65
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/object.js +0 -9
- package/src/core/plugins/json-schema-2020-12-samples/fn/types/string.js +0 -80
- package/src/core/plugins/json-schema-2020-12-samples/index.js +0 -51
- package/src/core/plugins/json-schema-5/components/array-model.jsx +0 -80
- package/src/core/plugins/json-schema-5/components/enum-model.jsx +0 -19
- package/src/core/plugins/json-schema-5/components/json-schema-components.jsx +0 -441
- package/src/core/plugins/json-schema-5/components/model-collapse.jsx +0 -99
- package/src/core/plugins/json-schema-5/components/model-example.jsx +0 -160
- package/src/core/plugins/json-schema-5/components/model-extensions.jsx +0 -28
- package/src/core/plugins/json-schema-5/components/model-wrapper.jsx +0 -44
- package/src/core/plugins/json-schema-5/components/model.jsx +0 -136
- package/src/core/plugins/json-schema-5/components/models.jsx +0 -139
- package/src/core/plugins/json-schema-5/components/object-model.jsx +0 -340
- package/src/core/plugins/json-schema-5/components/primitive-model.jsx +0 -137
- package/src/core/plugins/json-schema-5/components/schemes.jsx +0 -53
- package/src/core/plugins/json-schema-5/containers/schemes.jsx +0 -30
- package/src/core/plugins/json-schema-5/fn.js +0 -51
- package/src/core/plugins/json-schema-5/index.js +0 -41
- package/src/core/plugins/json-schema-5-samples/fn/get-json-sample-schema.js +0 -32
- package/src/core/plugins/json-schema-5-samples/fn/get-sample-schema.js +0 -30
- package/src/core/plugins/json-schema-5-samples/fn/get-xml-sample-schema.js +0 -31
- package/src/core/plugins/json-schema-5-samples/fn/get-yaml-sample-schema.js +0 -34
- package/src/core/plugins/json-schema-5-samples/fn/index.js +0 -653
- package/src/core/plugins/json-schema-5-samples/index.js +0 -56
- package/src/core/plugins/layout/actions.js +0 -39
- package/src/core/plugins/layout/index.js +0 -19
- package/src/core/plugins/layout/reducers.js +0 -32
- package/src/core/plugins/layout/selectors.js +0 -24
- package/src/core/plugins/layout/spec-extensions/wrap-selector.js +0 -22
- package/src/core/plugins/logs/index.js +0 -28
- package/src/core/plugins/oas3/actions.js +0 -99
- package/src/core/plugins/oas3/auth-extensions/wrap-selectors.js +0 -92
- package/src/core/plugins/oas3/components/auth/http-auth.jsx +0 -157
- package/src/core/plugins/oas3/components/callbacks.jsx +0 -51
- package/src/core/plugins/oas3/components/index.js +0 -19
- package/src/core/plugins/oas3/components/operation-link.jsx +0 -43
- package/src/core/plugins/oas3/components/operation-servers.jsx +0 -102
- package/src/core/plugins/oas3/components/request-body-editor.jsx +0 -103
- package/src/core/plugins/oas3/components/request-body.jsx +0 -338
- package/src/core/plugins/oas3/components/servers-container.jsx +0 -33
- package/src/core/plugins/oas3/components/servers.jsx +0 -153
- package/src/core/plugins/oas3/fn.js +0 -35
- package/src/core/plugins/oas3/helpers.jsx +0 -48
- package/src/core/plugins/oas3/index.js +0 -39
- package/src/core/plugins/oas3/reducers.js +0 -111
- package/src/core/plugins/oas3/selectors.js +0 -308
- package/src/core/plugins/oas3/spec-extensions/selectors.js +0 -100
- package/src/core/plugins/oas3/spec-extensions/wrap-selectors.js +0 -71
- package/src/core/plugins/oas3/wrap-components/auth/auth-item.jsx +0 -25
- package/src/core/plugins/oas3/wrap-components/index.js +0 -15
- package/src/core/plugins/oas3/wrap-components/json-schema-string.jsx +0 -27
- package/src/core/plugins/oas3/wrap-components/markdown.jsx +0 -45
- package/src/core/plugins/oas3/wrap-components/model.jsx +0 -40
- package/src/core/plugins/oas3/wrap-components/online-validator-badge.js +0 -5
- package/src/core/plugins/oas3/wrap-components/openapi-version.jsx +0 -7
- package/src/core/plugins/oas31/after-load.js +0 -72
- package/src/core/plugins/oas31/auth-extensions/wrap-selectors.js +0 -28
- package/src/core/plugins/oas31/components/_all.scss +0 -2
- package/src/core/plugins/oas31/components/auth/auths.jsx +0 -186
- package/src/core/plugins/oas31/components/auth/mutual-tls-auth.jsx +0 -32
- package/src/core/plugins/oas31/components/contact.jsx +0 -43
- package/src/core/plugins/oas31/components/info.jsx +0 -99
- package/src/core/plugins/oas31/components/json-schema-dialect.jsx +0 -60
- package/src/core/plugins/oas31/components/license.jsx +0 -38
- package/src/core/plugins/oas31/components/model/_model.scss +0 -23
- package/src/core/plugins/oas31/components/model/model.jsx +0 -54
- package/src/core/plugins/oas31/components/models/_models.scss +0 -11
- package/src/core/plugins/oas31/components/models/models.jsx +0 -141
- package/src/core/plugins/oas31/components/version-pragma-filter.jsx +0 -73
- package/src/core/plugins/oas31/components/webhooks.jsx +0 -49
- package/src/core/plugins/oas31/fn.js +0 -124
- package/src/core/plugins/oas31/index.js +0 -166
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Description.jsx +0 -27
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/Discriminator.jsx +0 -118
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/DiscriminatorMapping.jsx +0 -32
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Example.jsx +0 -28
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/ExternalDocs.jsx +0 -143
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/OpenAPIExtensions.jsx +0 -33
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Properties.jsx +0 -60
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Xml.jsx +0 -162
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/fn.js +0 -57
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Description.jsx +0 -9
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Examples.jsx +0 -31
- package/src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Properties.jsx +0 -9
- package/src/core/plugins/oas31/oas3-extensions/fn.js +0 -46
- package/src/core/plugins/oas31/selectors.js +0 -26
- package/src/core/plugins/oas31/spec-extensions/selectors.js +0 -198
- package/src/core/plugins/oas31/spec-extensions/wrap-selectors.js +0 -18
- package/src/core/plugins/oas31/wrap-components/auth/auth-item.jsx +0 -22
- package/src/core/plugins/oas31/wrap-components/auths.jsx +0 -17
- package/src/core/plugins/oas31/wrap-components/contact.jsx +0 -15
- package/src/core/plugins/oas31/wrap-components/info.jsx +0 -15
- package/src/core/plugins/oas31/wrap-components/license.jsx +0 -15
- package/src/core/plugins/oas31/wrap-components/model.jsx +0 -44
- package/src/core/plugins/oas31/wrap-components/models.jsx +0 -47
- package/src/core/plugins/oas31/wrap-components/version-pragma-filter.jsx +0 -16
- package/src/core/plugins/on-complete/index.js +0 -28
- package/src/core/plugins/request-snippets/fn.js +0 -169
- package/src/core/plugins/request-snippets/index.js +0 -21
- package/src/core/plugins/request-snippets/request-snippets.jsx +0 -163
- package/src/core/plugins/request-snippets/selectors.js +0 -45
- package/src/core/plugins/safe-render/components/error-boundary.jsx +0 -52
- package/src/core/plugins/safe-render/components/fallback.jsx +0 -13
- package/src/core/plugins/safe-render/fn.jsx +0 -32
- package/src/core/plugins/safe-render/index.js +0 -42
- package/src/core/plugins/spec/actions.js +0 -531
- package/src/core/plugins/spec/index.js +0 -20
- package/src/core/plugins/spec/reducers.js +0 -176
- package/src/core/plugins/spec/selectors.js +0 -575
- package/src/core/plugins/spec/wrap-actions.js +0 -39
- package/src/core/plugins/swagger-client/configs-wrap-actions.js +0 -6
- package/src/core/plugins/swagger-client/index.js +0 -54
- package/src/core/plugins/syntax-highlighting/after-load.js +0 -25
- package/src/core/plugins/syntax-highlighting/components/HighlightCode.jsx +0 -107
- package/src/core/plugins/syntax-highlighting/components/PlainTextViewer.jsx +0 -17
- package/src/core/plugins/syntax-highlighting/components/SyntaxHighlighter.jsx +0 -42
- package/src/core/plugins/syntax-highlighting/index.js +0 -34
- package/src/core/plugins/syntax-highlighting/root-injects.js +0 -22
- package/src/core/plugins/syntax-highlighting/wrap-components/SyntaxHighlighter.jsx +0 -31
- package/src/core/plugins/util/index.js +0 -11
- package/src/core/plugins/versions/after-load.js +0 -19
- package/src/core/plugins/versions/index.js +0 -10
- package/src/core/plugins/view/fn.js +0 -1
- package/src/core/plugins/view/index.js +0 -34
- package/src/core/plugins/view/root-injects.jsx +0 -118
- package/src/core/plugins/view-legacy/index.js +0 -25
- package/src/core/plugins/view-legacy/root-injects.jsx +0 -12
- package/src/core/presets/apis/index.js +0 -18
- package/src/core/presets/base/index.js +0 -55
- package/src/core/presets/base/plugins/core-components/index.js +0 -130
- package/src/core/presets/base/plugins/form-components/index.js +0 -10
- package/src/core/system.js +0 -511
- package/src/core/utils/create-html-ready-id.js +0 -10
- package/src/core/utils/get-parameter-schema.js +0 -94
- package/src/core/utils/index.js +0 -847
- package/src/core/utils/jsonParse.js +0 -15
- package/src/core/utils/memoizeN.js +0 -48
- package/src/core/utils/url.js +0 -79
- package/src/core/window.js +0 -30
- package/src/index.js +0 -3
- package/src/standalone/plugins/stadalone-layout/components/StandaloneLayout.jsx +0 -40
- package/src/standalone/plugins/stadalone-layout/index.js +0 -12
- package/src/standalone/plugins/top-bar/assets/lightbulb-off.svg +0 -1
- package/src/standalone/plugins/top-bar/assets/lightbulb.svg +0 -1
- package/src/standalone/plugins/top-bar/assets/logo_small.svg +0 -60
- package/src/standalone/plugins/top-bar/components/DarkModeToggle.jsx +0 -47
- package/src/standalone/plugins/top-bar/components/Logo.jsx +0 -9
- package/src/standalone/plugins/top-bar/components/TopBar.jsx +0 -183
- package/src/standalone/plugins/top-bar/index.js +0 -12
- package/src/standalone/presets/standalone/index.js +0 -19
- package/src/style/_authorize.scss +0 -96
- package/src/style/_buttons.scss +0 -199
- package/src/style/_dark-mode.scss +0 -664
- package/src/style/_errors.scss +0 -72
- package/src/style/_form.scss +0 -214
- package/src/style/_information.scss +0 -99
- package/src/style/_layout.scss +0 -941
- package/src/style/_markdown.scss +0 -34
- package/src/style/_mixins.scss +0 -159
- package/src/style/_modal.scss +0 -95
- package/src/style/_models.scss +0 -330
- package/src/style/_servers.scss +0 -66
- package/src/style/_split-pane-mode.scss +0 -3
- package/src/style/_table.scss +0 -191
- package/src/style/_topbar.scss +0 -126
- package/src/style/_type.scss +0 -21
- package/src/style/_variables.scss +0 -230
- package/src/style/main.scss +0 -28
- package/stylelint.config.js +0 -11
- package/swagger-ui-dist-package/absolute-path.js +0 -14
- package/swagger-ui-dist-package/index.js +0 -17
- package/swagger-ui-dist-package/package.json +0 -20
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
import { createSelector } from "reselect"
|
|
2
|
-
import constant from "lodash/constant"
|
|
3
|
-
import { sorters, paramToIdentifier } from "core/utils"
|
|
4
|
-
import { fromJS, Set, Map, OrderedMap, List } from "immutable"
|
|
5
|
-
|
|
6
|
-
const DEFAULT_TAG = "default"
|
|
7
|
-
|
|
8
|
-
const OPERATION_METHODS = [
|
|
9
|
-
"get", "put", "post", "delete", "options", "head", "patch", "trace"
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
const state = state => {
|
|
13
|
-
return state || Map()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const lastError = createSelector(
|
|
17
|
-
state,
|
|
18
|
-
spec => spec.get("lastError")
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
export const url = createSelector(
|
|
22
|
-
state,
|
|
23
|
-
spec => spec.get("url")
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
export const specStr = createSelector(
|
|
27
|
-
state,
|
|
28
|
-
spec => spec.get("spec") || ""
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
export const specSource = createSelector(
|
|
32
|
-
state,
|
|
33
|
-
spec => spec.get("specSource") || "not-editor"
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
export const specJson = createSelector(
|
|
37
|
-
state,
|
|
38
|
-
spec => spec.get("json", Map())
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
export const specJS = createSelector(
|
|
42
|
-
specJson,
|
|
43
|
-
(spec) => spec.toJS()
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
export const specResolved = createSelector(
|
|
47
|
-
state,
|
|
48
|
-
spec => spec.get("resolved", Map())
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
export const specResolvedSubtree = (state, path) => {
|
|
52
|
-
return state.getIn(["resolvedSubtrees", ...path], undefined)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const mergerFn = (oldVal, newVal) => {
|
|
56
|
-
if(Map.isMap(oldVal) && Map.isMap(newVal)) {
|
|
57
|
-
if(newVal.get("$$ref")) {
|
|
58
|
-
// resolver artifacts indicated that this key was directly resolved
|
|
59
|
-
// so we should drop the old value entirely
|
|
60
|
-
return newVal
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return OrderedMap().mergeWith(
|
|
64
|
-
mergerFn,
|
|
65
|
-
oldVal,
|
|
66
|
-
newVal
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return newVal
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const specJsonWithResolvedSubtrees = createSelector(
|
|
74
|
-
state,
|
|
75
|
-
spec => OrderedMap().mergeWith(
|
|
76
|
-
mergerFn,
|
|
77
|
-
spec.get("json"),
|
|
78
|
-
spec.get("resolvedSubtrees")
|
|
79
|
-
)
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
// Default Spec ( as an object )
|
|
83
|
-
export const spec = state => {
|
|
84
|
-
let res = specJson(state)
|
|
85
|
-
return res
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const isOAS3 = createSelector(
|
|
89
|
-
// isOAS3 is stubbed out here to work around an issue with injecting more selectors
|
|
90
|
-
// in the OAS3 plugin, and to ensure that the function is always available.
|
|
91
|
-
// It's not perfect, but our hybrid (core+plugin code) implementation for OAS3
|
|
92
|
-
// needs this. //KS
|
|
93
|
-
spec,
|
|
94
|
-
() => false
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
export const info = createSelector(
|
|
98
|
-
spec,
|
|
99
|
-
spec => returnSelfOrNewMap(spec && spec.get("info"))
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
export const externalDocs = createSelector(
|
|
103
|
-
spec,
|
|
104
|
-
spec => returnSelfOrNewMap(spec && spec.get("externalDocs"))
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
export const version = createSelector(
|
|
108
|
-
info,
|
|
109
|
-
info => info && info.get("version")
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
export const semver = createSelector(
|
|
113
|
-
version,
|
|
114
|
-
version => /v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(version).slice(1)
|
|
115
|
-
)
|
|
116
|
-
|
|
117
|
-
export const paths = createSelector(
|
|
118
|
-
specJsonWithResolvedSubtrees,
|
|
119
|
-
spec => spec.get("paths")
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
export const validOperationMethods = constant(["get", "put", "post", "delete", "options", "head", "patch"])
|
|
123
|
-
|
|
124
|
-
export const operations = createSelector(
|
|
125
|
-
paths,
|
|
126
|
-
paths => {
|
|
127
|
-
let list = List()
|
|
128
|
-
|
|
129
|
-
if (!Map.isMap(paths) || paths.isEmpty()) {
|
|
130
|
-
return list
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
paths.forEach((path, pathName) => {
|
|
134
|
-
if(!path || !path.forEach) {
|
|
135
|
-
return {}
|
|
136
|
-
}
|
|
137
|
-
path.forEach((operation, method) => {
|
|
138
|
-
if(OPERATION_METHODS.indexOf(method) < 0) {
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
list = list.push(fromJS({
|
|
142
|
-
path: pathName,
|
|
143
|
-
method,
|
|
144
|
-
operation,
|
|
145
|
-
id: `${method}-${pathName}`
|
|
146
|
-
}))
|
|
147
|
-
})
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
return list
|
|
151
|
-
}
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
export const consumes = createSelector(
|
|
155
|
-
spec,
|
|
156
|
-
spec => Set(spec.get("consumes"))
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
export const produces = createSelector(
|
|
160
|
-
spec,
|
|
161
|
-
spec => Set(spec.get("produces"))
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
export const security = createSelector(
|
|
165
|
-
spec,
|
|
166
|
-
spec => spec.get("security", List())
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
export const securityDefinitions = createSelector(
|
|
170
|
-
spec,
|
|
171
|
-
spec => spec.get("securityDefinitions")
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
export const findDefinition = ( state, name ) => {
|
|
176
|
-
const resolvedRes = state.getIn(["resolvedSubtrees", "definitions", name], null)
|
|
177
|
-
const unresolvedRes = state.getIn(["json", "definitions", name], null)
|
|
178
|
-
return resolvedRes || unresolvedRes || null
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export const definitions = createSelector(
|
|
182
|
-
spec,
|
|
183
|
-
spec => {
|
|
184
|
-
const res = spec.get("definitions")
|
|
185
|
-
return Map.isMap(res) ? res : Map()
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
export const basePath = createSelector(
|
|
190
|
-
spec,
|
|
191
|
-
spec => spec.get("basePath")
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
export const host = createSelector(
|
|
195
|
-
spec,
|
|
196
|
-
spec => spec.get("host")
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
export const schemes = createSelector(
|
|
200
|
-
spec,
|
|
201
|
-
spec => spec.get("schemes", Map())
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
export const operationsWithRootInherited = createSelector(
|
|
205
|
-
[
|
|
206
|
-
operations,
|
|
207
|
-
consumes,
|
|
208
|
-
produces
|
|
209
|
-
],
|
|
210
|
-
(operations, consumes, produces) => {
|
|
211
|
-
return operations.map( ops => ops.update("operation", op => {
|
|
212
|
-
if (Map.isMap(op)) {
|
|
213
|
-
return op.withMutations( op => {
|
|
214
|
-
if ( !op.get("consumes") ) {
|
|
215
|
-
op.update("consumes", a => Set(a).merge(consumes))
|
|
216
|
-
}
|
|
217
|
-
if ( !op.get("produces") ) {
|
|
218
|
-
op.update("produces", a => Set(a).merge(produces))
|
|
219
|
-
}
|
|
220
|
-
return op
|
|
221
|
-
})
|
|
222
|
-
} else {
|
|
223
|
-
// return something with Immutable methods
|
|
224
|
-
return Map()
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
}))
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
export const tags = createSelector(
|
|
232
|
-
spec,
|
|
233
|
-
json => {
|
|
234
|
-
const tags = json.get("tags", List())
|
|
235
|
-
return List.isList(tags) ? tags.filter(tag => Map.isMap(tag)) : List()
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
export const tagDetails = (state, tag) => {
|
|
240
|
-
let currentTags = tags(state) || List()
|
|
241
|
-
return currentTags.filter(Map.isMap).find(t => t.get("name") === tag, Map())
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export const operationsWithTags = createSelector(
|
|
245
|
-
operationsWithRootInherited,
|
|
246
|
-
tags,
|
|
247
|
-
(operations, tags) => {
|
|
248
|
-
return operations.reduce( (taggedMap, op) => {
|
|
249
|
-
let tags = Set(op.getIn(["operation","tags"]))
|
|
250
|
-
if(tags.count() < 1)
|
|
251
|
-
return taggedMap.update(DEFAULT_TAG, List(), ar => ar.push(op))
|
|
252
|
-
return tags.reduce( (res, tag) => res.update(tag, List(), (ar) => ar.push(op)), taggedMap )
|
|
253
|
-
}, tags.reduce( (taggedMap, tag) => {
|
|
254
|
-
return taggedMap.set(tag.get("name"), List())
|
|
255
|
-
} , OrderedMap()))
|
|
256
|
-
}
|
|
257
|
-
)
|
|
258
|
-
|
|
259
|
-
export const taggedOperations = (state) => ({ getConfigs }) => {
|
|
260
|
-
let { tagsSorter, operationsSorter } = getConfigs()
|
|
261
|
-
return operationsWithTags(state)
|
|
262
|
-
.sortBy(
|
|
263
|
-
(val, key) => key, // get the name of the tag to be passed to the sorter
|
|
264
|
-
(tagA, tagB) => {
|
|
265
|
-
let sortFn = (typeof tagsSorter === "function" ? tagsSorter : sorters.tagsSorter[ tagsSorter ])
|
|
266
|
-
return (!sortFn ? null : sortFn(tagA, tagB))
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
.map((ops, tag) => {
|
|
270
|
-
let sortFn = (typeof operationsSorter === "function" ? operationsSorter : sorters.operationsSorter[ operationsSorter ])
|
|
271
|
-
let operations = (!sortFn ? ops : ops.sort(sortFn))
|
|
272
|
-
|
|
273
|
-
return Map({ tagDetails: tagDetails(state, tag), operations: operations })
|
|
274
|
-
})
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export const responses = createSelector(
|
|
278
|
-
state,
|
|
279
|
-
state => state.get( "responses", Map() )
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
export const requests = createSelector(
|
|
283
|
-
state,
|
|
284
|
-
state => state.get( "requests", Map() )
|
|
285
|
-
)
|
|
286
|
-
|
|
287
|
-
export const mutatedRequests = createSelector(
|
|
288
|
-
state,
|
|
289
|
-
state => state.get( "mutatedRequests", Map() )
|
|
290
|
-
)
|
|
291
|
-
|
|
292
|
-
export const responseFor = (state, path, method) => {
|
|
293
|
-
return responses(state).getIn([path, method], null)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export const requestFor = (state, path, method) => {
|
|
297
|
-
return requests(state).getIn([path, method], null)
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export const mutatedRequestFor = (state, path, method) => {
|
|
301
|
-
return mutatedRequests(state).getIn([path, method], null)
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export const allowTryItOutFor = () => {
|
|
305
|
-
// This is just a hook for now.
|
|
306
|
-
return true
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
export const parameterWithMetaByIdentity = (state, pathMethod, param) => {
|
|
310
|
-
const opParams = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod, "parameters"], OrderedMap())
|
|
311
|
-
const metaParams = state.getIn(["meta", "paths", ...pathMethod, "parameters"], OrderedMap())
|
|
312
|
-
|
|
313
|
-
const mergedParams = opParams.map((currentParam) => {
|
|
314
|
-
const inNameKeyedMeta = metaParams.get(`${param.get("in")}.${param.get("name")}`)
|
|
315
|
-
const hashKeyedMeta = metaParams.get(`${param.get("in")}.${param.get("name")}.hash-${param.hashCode()}`)
|
|
316
|
-
return OrderedMap().merge(
|
|
317
|
-
currentParam,
|
|
318
|
-
inNameKeyedMeta,
|
|
319
|
-
hashKeyedMeta
|
|
320
|
-
)
|
|
321
|
-
})
|
|
322
|
-
return mergedParams.find(curr => curr.get("in") === param.get("in") && curr.get("name") === param.get("name"), OrderedMap())
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export const parameterInclusionSettingFor = (state, pathMethod, paramName, paramIn) => {
|
|
326
|
-
const paramKey = `${paramIn}.${paramName}`
|
|
327
|
-
return state.getIn(["meta", "paths", ...pathMethod, "parameter_inclusions", paramKey], false)
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
export const parameterWithMeta = (state, pathMethod, paramName, paramIn) => {
|
|
332
|
-
const opParams = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod, "parameters"], OrderedMap())
|
|
333
|
-
const currentParam = opParams.find(param => param.get("in") === paramIn && param.get("name") === paramName, OrderedMap())
|
|
334
|
-
return parameterWithMetaByIdentity(state, pathMethod, currentParam)
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export const operationWithMeta = (state, path, method) => {
|
|
338
|
-
const op = specJsonWithResolvedSubtrees(state).getIn(["paths", path, method], OrderedMap())
|
|
339
|
-
const meta = state.getIn(["meta", "paths", path, method], OrderedMap())
|
|
340
|
-
|
|
341
|
-
const mergedParams = op.get("parameters", List()).map((param) => {
|
|
342
|
-
return parameterWithMetaByIdentity(state, [path, method], param)
|
|
343
|
-
})
|
|
344
|
-
|
|
345
|
-
return OrderedMap()
|
|
346
|
-
.merge(op, meta)
|
|
347
|
-
.set("parameters", mergedParams)
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// Get the parameter value by parameter name
|
|
351
|
-
export function getParameter(state, pathMethod, name, inType) {
|
|
352
|
-
pathMethod = pathMethod || []
|
|
353
|
-
let params = state.getIn(["meta", "paths", ...pathMethod, "parameters"], fromJS([]))
|
|
354
|
-
return params.find( (p) => {
|
|
355
|
-
return Map.isMap(p) && p.get("name") === name && p.get("in") === inType
|
|
356
|
-
}) || Map() // Always return a map
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export const hasHost = createSelector(
|
|
360
|
-
spec,
|
|
361
|
-
spec => {
|
|
362
|
-
const host = spec.get("host")
|
|
363
|
-
return typeof host === "string" && host.length > 0 && host[0] !== "/"
|
|
364
|
-
}
|
|
365
|
-
)
|
|
366
|
-
|
|
367
|
-
// Get the parameter values, that the user filled out
|
|
368
|
-
export function parameterValues(state, pathMethod, isXml) {
|
|
369
|
-
pathMethod = pathMethod || []
|
|
370
|
-
let paramValues = operationWithMeta(state, ...pathMethod).get("parameters", List())
|
|
371
|
-
return paramValues.reduce( (hash, p) => {
|
|
372
|
-
let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value")
|
|
373
|
-
if (List.isList(value)) {
|
|
374
|
-
value = value.filter(v => v !== "")
|
|
375
|
-
}
|
|
376
|
-
return hash.set(paramToIdentifier(p, { allowHashes: false }), value)
|
|
377
|
-
}, fromJS({}))
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// True if any parameter includes `in: ?`
|
|
381
|
-
export function parametersIncludeIn(parameters, inValue="") {
|
|
382
|
-
if(List.isList(parameters)) {
|
|
383
|
-
return parameters.some( p => Map.isMap(p) && p.get("in") === inValue )
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// True if any parameter includes `type: ?`
|
|
388
|
-
export function parametersIncludeType(parameters, typeValue="") {
|
|
389
|
-
if(List.isList(parameters)) {
|
|
390
|
-
return parameters.some( p => Map.isMap(p) && p.get("type") === typeValue )
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// Get the consumes/produces value that the user selected
|
|
395
|
-
export function contentTypeValues(state, pathMethod) {
|
|
396
|
-
pathMethod = pathMethod || []
|
|
397
|
-
let op = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod], fromJS({}))
|
|
398
|
-
let meta = state.getIn(["meta", "paths", ...pathMethod], fromJS({}))
|
|
399
|
-
let producesValue = currentProducesFor(state, pathMethod)
|
|
400
|
-
|
|
401
|
-
const parameters = op.get("parameters") || new List()
|
|
402
|
-
|
|
403
|
-
const requestContentType = (
|
|
404
|
-
meta.get("consumes_value") ? meta.get("consumes_value")
|
|
405
|
-
: parametersIncludeType(parameters, "file") ? "multipart/form-data"
|
|
406
|
-
: parametersIncludeType(parameters, "formData") ? "application/x-www-form-urlencoded"
|
|
407
|
-
: undefined
|
|
408
|
-
)
|
|
409
|
-
|
|
410
|
-
return fromJS({
|
|
411
|
-
requestContentType,
|
|
412
|
-
responseContentType: producesValue
|
|
413
|
-
})
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
// Get the currently selected produces value for an operation
|
|
417
|
-
export function currentProducesFor(state, pathMethod) {
|
|
418
|
-
pathMethod = pathMethod || []
|
|
419
|
-
|
|
420
|
-
const operation = specJsonWithResolvedSubtrees(state).getIn([ "paths", ...pathMethod], null)
|
|
421
|
-
|
|
422
|
-
if(operation === null) {
|
|
423
|
-
// return nothing if the operation does not exist
|
|
424
|
-
return
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
const currentProducesValue = state.getIn(["meta", "paths", ...pathMethod, "produces_value"], null)
|
|
428
|
-
const firstProducesArrayItem = operation.getIn(["produces", 0], null)
|
|
429
|
-
|
|
430
|
-
return currentProducesValue || firstProducesArrayItem || "application/json"
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// Get the produces options for an operation
|
|
435
|
-
export function producesOptionsFor(state, pathMethod) {
|
|
436
|
-
pathMethod = pathMethod || []
|
|
437
|
-
|
|
438
|
-
const spec = specJsonWithResolvedSubtrees(state)
|
|
439
|
-
const operation = spec.getIn([ "paths", ...pathMethod], null)
|
|
440
|
-
|
|
441
|
-
if(operation === null) {
|
|
442
|
-
// return nothing if the operation does not exist
|
|
443
|
-
return
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
const [path] = pathMethod
|
|
447
|
-
|
|
448
|
-
const operationProduces = operation.get("produces", null)
|
|
449
|
-
const pathItemProduces = spec.getIn(["paths", path, "produces"], null)
|
|
450
|
-
const globalProduces = spec.getIn(["produces"], null)
|
|
451
|
-
|
|
452
|
-
return operationProduces || pathItemProduces || globalProduces
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// Get the consumes options for an operation
|
|
456
|
-
export function consumesOptionsFor(state, pathMethod) {
|
|
457
|
-
pathMethod = pathMethod || []
|
|
458
|
-
|
|
459
|
-
const spec = specJsonWithResolvedSubtrees(state)
|
|
460
|
-
const operation = spec.getIn(["paths", ...pathMethod], null)
|
|
461
|
-
|
|
462
|
-
if (operation === null) {
|
|
463
|
-
// return nothing if the operation does not exist
|
|
464
|
-
return
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
const [path] = pathMethod
|
|
468
|
-
|
|
469
|
-
const operationConsumes = operation.get("consumes", null)
|
|
470
|
-
const pathItemConsumes = spec.getIn(["paths", path, "consumes"], null)
|
|
471
|
-
const globalConsumes = spec.getIn(["consumes"], null)
|
|
472
|
-
|
|
473
|
-
return operationConsumes || pathItemConsumes || globalConsumes
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export const operationScheme = ( state, path, method ) => {
|
|
477
|
-
let url = state.get("url")
|
|
478
|
-
let matchResult = url.match(/^([a-z][a-z0-9+\-.]*):/)
|
|
479
|
-
let urlScheme = Array.isArray(matchResult) ? matchResult[1] : null
|
|
480
|
-
|
|
481
|
-
return state.getIn(["scheme", path, method]) || state.getIn(["scheme", "_defaultScheme"]) || urlScheme || ""
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
export const canExecuteScheme = ( state, path, method ) => {
|
|
485
|
-
return ["http", "https"].indexOf(operationScheme(state, path, method)) > -1
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export const validationErrors = (state, pathMethod) => {
|
|
489
|
-
pathMethod = pathMethod || []
|
|
490
|
-
const paramValues = state.getIn(["meta", "paths", ...pathMethod, "parameters"], fromJS([]))
|
|
491
|
-
const result = []
|
|
492
|
-
|
|
493
|
-
if (paramValues.length === 0) return result
|
|
494
|
-
|
|
495
|
-
const getErrorsWithPaths = (errors, path = []) => {
|
|
496
|
-
const getNestedErrorsWithPaths = (e, path) => {
|
|
497
|
-
const currPath = [...path, e.get("propKey") || e.get("index")]
|
|
498
|
-
return Map.isMap(e.get("error"))
|
|
499
|
-
? getErrorsWithPaths(e.get("error"), currPath)
|
|
500
|
-
: { error: e.get("error"), path: currPath }
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return List.isList(errors)
|
|
504
|
-
? errors.map((e) => (Map.isMap(e) ? getNestedErrorsWithPaths(e, path) : { error: e, path }))
|
|
505
|
-
: getNestedErrorsWithPaths(errors, path)
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
const formatError = (error, path, paramName) => {
|
|
509
|
-
path = path.reduce((acc, curr) => {
|
|
510
|
-
return typeof curr === "number"
|
|
511
|
-
? `${acc}[${curr}]`
|
|
512
|
-
: acc
|
|
513
|
-
? `${acc}.${curr}`
|
|
514
|
-
: curr
|
|
515
|
-
}, "")
|
|
516
|
-
return `For '${paramName}'${path ? ` at path '${path}'` : ""}: ${error}.`
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
paramValues.forEach( (p, key) => {
|
|
520
|
-
const paramName = key.split(".").slice(1, -1).join(".")
|
|
521
|
-
const errors = p.get("errors")
|
|
522
|
-
if (errors && errors.count()) {
|
|
523
|
-
const errorsWithPaths = getErrorsWithPaths(errors)
|
|
524
|
-
errorsWithPaths.forEach(({error, path}) => {
|
|
525
|
-
result.push(formatError(error, path, paramName))
|
|
526
|
-
})
|
|
527
|
-
}
|
|
528
|
-
})
|
|
529
|
-
return result
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
export const validateBeforeExecute = (state, pathMethod) => {
|
|
533
|
-
return validationErrors(state, pathMethod).length === 0
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
export const getOAS3RequiredRequestBodyContentType = (state, pathMethod) => {
|
|
537
|
-
let requiredObj = {
|
|
538
|
-
requestBody: false,
|
|
539
|
-
requestContentType: {}
|
|
540
|
-
}
|
|
541
|
-
let requestBody = state.getIn(["resolvedSubtrees", "paths", ...pathMethod, "requestBody"], fromJS([]))
|
|
542
|
-
if (requestBody.size < 1) {
|
|
543
|
-
return requiredObj
|
|
544
|
-
}
|
|
545
|
-
if (requestBody.getIn(["required"])) {
|
|
546
|
-
requiredObj.requestBody = requestBody.getIn(["required"])
|
|
547
|
-
}
|
|
548
|
-
requestBody.getIn(["content"]).entrySeq().forEach((contentType) => { // e.g application/json
|
|
549
|
-
const key = contentType[0]
|
|
550
|
-
if (contentType[1].getIn(["schema", "required"])) {
|
|
551
|
-
const val = contentType[1].getIn(["schema", "required"]).toJS()
|
|
552
|
-
requiredObj.requestContentType[key] = val
|
|
553
|
-
}
|
|
554
|
-
})
|
|
555
|
-
return requiredObj
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
export const isMediaTypeSchemaPropertiesEqual = ( state, pathMethod, currentMediaType, targetMediaType) => {
|
|
559
|
-
if((currentMediaType || targetMediaType) && currentMediaType === targetMediaType ) {
|
|
560
|
-
return true
|
|
561
|
-
}
|
|
562
|
-
let requestBodyContent = state.getIn(["resolvedSubtrees", "paths", ...pathMethod, "requestBody", "content"], fromJS([]))
|
|
563
|
-
if (requestBodyContent.size < 2 || !currentMediaType || !targetMediaType) {
|
|
564
|
-
// nothing to compare
|
|
565
|
-
return false
|
|
566
|
-
}
|
|
567
|
-
let currentMediaTypeSchemaProperties = requestBodyContent.getIn([currentMediaType, "schema", "properties"], fromJS([]))
|
|
568
|
-
let targetMediaTypeSchemaProperties = requestBodyContent.getIn([targetMediaType, "schema", "properties"], fromJS([]))
|
|
569
|
-
return !!currentMediaTypeSchemaProperties.equals(targetMediaTypeSchemaProperties)
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
function returnSelfOrNewMap(obj) {
|
|
573
|
-
// returns obj if obj is an Immutable map, else returns a new Map
|
|
574
|
-
return Map.isMap(obj) ? obj : new Map()
|
|
575
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import get from "lodash/get"
|
|
2
|
-
import isPlainObject from "lodash/isPlainObject"
|
|
3
|
-
|
|
4
|
-
export const updateSpec = (ori, {specActions}) => (...args) => {
|
|
5
|
-
ori(...args)
|
|
6
|
-
specActions.parseToJson(...args)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const updateJsonSpec = (ori, {specActions}) => (...args) => {
|
|
10
|
-
ori(...args)
|
|
11
|
-
|
|
12
|
-
specActions.invalidateResolvedSubtreeCache()
|
|
13
|
-
|
|
14
|
-
// Trigger resolution of any path-level $refs.
|
|
15
|
-
const [json] = args
|
|
16
|
-
const pathItems = get(json, ["paths"]) || {}
|
|
17
|
-
const pathItemKeys = Object.keys(pathItems)
|
|
18
|
-
|
|
19
|
-
pathItemKeys.forEach(k => {
|
|
20
|
-
const val = get(pathItems, [k])
|
|
21
|
-
|
|
22
|
-
if (isPlainObject(val) && val.$ref) {
|
|
23
|
-
specActions.requestResolvedSubtree(["paths", k])
|
|
24
|
-
}
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
// Trigger resolution of any securitySchemes-level $refs.
|
|
28
|
-
specActions.requestResolvedSubtree(["components", "securitySchemes"])
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Log the request ( just for debugging, shouldn't affect prod )
|
|
32
|
-
export const executeRequest = (ori, { specActions }) => (req) => {
|
|
33
|
-
specActions.logRequest(req)
|
|
34
|
-
return ori(req)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const validateParams = (ori, { specSelectors }) => (req) => {
|
|
38
|
-
return ori(req, specSelectors.isOAS3())
|
|
39
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import genericResolveStrategy from "swagger-client/es/resolver/strategies/generic"
|
|
2
|
-
import openApi2ResolveStrategy from "swagger-client/es/resolver/strategies/openapi-2"
|
|
3
|
-
import openApi30ResolveStrategy from "swagger-client/es/resolver/strategies/openapi-3-0"
|
|
4
|
-
import openApi31ApiDOMResolveStrategy from "swagger-client/es/resolver/strategies/openapi-3-1-apidom"
|
|
5
|
-
import { makeResolve } from "swagger-client/es/resolver"
|
|
6
|
-
import { execute, buildRequest } from "swagger-client/es/execute"
|
|
7
|
-
import Http, { makeHttp, serializeRes } from "swagger-client/es/http"
|
|
8
|
-
import { makeResolveSubtree } from "swagger-client/es/subtree-resolver"
|
|
9
|
-
import { opId } from "swagger-client/es/helpers"
|
|
10
|
-
import { loaded } from "./configs-wrap-actions"
|
|
11
|
-
|
|
12
|
-
export default function({ configs, getConfigs }) {
|
|
13
|
-
return {
|
|
14
|
-
fn: {
|
|
15
|
-
fetch: makeHttp(Http, configs.preFetch, configs.postFetch),
|
|
16
|
-
buildRequest,
|
|
17
|
-
execute,
|
|
18
|
-
resolve: makeResolve({
|
|
19
|
-
strategies: [
|
|
20
|
-
openApi31ApiDOMResolveStrategy,
|
|
21
|
-
openApi30ResolveStrategy,
|
|
22
|
-
openApi2ResolveStrategy,
|
|
23
|
-
genericResolveStrategy,
|
|
24
|
-
],
|
|
25
|
-
}),
|
|
26
|
-
resolveSubtree: async (obj, path, options = {}) => {
|
|
27
|
-
const freshConfigs = getConfigs()
|
|
28
|
-
const defaultOptions = {
|
|
29
|
-
modelPropertyMacro: freshConfigs.modelPropertyMacro,
|
|
30
|
-
parameterMacro: freshConfigs.parameterMacro,
|
|
31
|
-
requestInterceptor: freshConfigs.requestInterceptor,
|
|
32
|
-
responseInterceptor: freshConfigs.responseInterceptor,
|
|
33
|
-
strategies: [
|
|
34
|
-
openApi31ApiDOMResolveStrategy,
|
|
35
|
-
openApi30ResolveStrategy,
|
|
36
|
-
openApi2ResolveStrategy,
|
|
37
|
-
genericResolveStrategy,
|
|
38
|
-
],
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return makeResolveSubtree(defaultOptions)(obj, path, options)
|
|
42
|
-
},
|
|
43
|
-
serializeRes,
|
|
44
|
-
opId
|
|
45
|
-
},
|
|
46
|
-
statePlugins: {
|
|
47
|
-
configs: {
|
|
48
|
-
wrapActions: {
|
|
49
|
-
loaded,
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @prettier
|
|
3
|
-
*/
|
|
4
|
-
import SyntaxHighlighter from "react-syntax-highlighter/dist/esm/light"
|
|
5
|
-
import js from "react-syntax-highlighter/dist/esm/languages/hljs/javascript"
|
|
6
|
-
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json"
|
|
7
|
-
import xml from "react-syntax-highlighter/dist/esm/languages/hljs/xml"
|
|
8
|
-
import bash from "react-syntax-highlighter/dist/esm/languages/hljs/bash"
|
|
9
|
-
import yaml from "react-syntax-highlighter/dist/esm/languages/hljs/yaml"
|
|
10
|
-
import http from "react-syntax-highlighter/dist/esm/languages/hljs/http"
|
|
11
|
-
import powershell from "react-syntax-highlighter/dist/esm/languages/hljs/powershell"
|
|
12
|
-
import javascript from "react-syntax-highlighter/dist/esm/languages/hljs/javascript"
|
|
13
|
-
|
|
14
|
-
const afterLoad = () => {
|
|
15
|
-
SyntaxHighlighter.registerLanguage("json", json)
|
|
16
|
-
SyntaxHighlighter.registerLanguage("js", js)
|
|
17
|
-
SyntaxHighlighter.registerLanguage("xml", xml)
|
|
18
|
-
SyntaxHighlighter.registerLanguage("yaml", yaml)
|
|
19
|
-
SyntaxHighlighter.registerLanguage("http", http)
|
|
20
|
-
SyntaxHighlighter.registerLanguage("bash", bash)
|
|
21
|
-
SyntaxHighlighter.registerLanguage("powershell", powershell)
|
|
22
|
-
SyntaxHighlighter.registerLanguage("javascript", javascript)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default afterLoad
|