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:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { fromJS } from "immutable"
|
||||
import getParameterSchema from "../../../../src/helpers/get-parameter-schema"
|
||||
import getParameterSchema from "../../../../src/core/utils/get-parameter-schema"
|
||||
|
||||
describe("getParameterSchema", () => {
|
||||
it("should return an empty Map when given no parameters", () => {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
authorizeOauth2WithPersistOption,
|
||||
logoutWithPersistOption,
|
||||
persistAuthorizationIfNeeded
|
||||
} from "corePlugins/auth/actions"
|
||||
} from "core/plugins/auth/actions"
|
||||
import {authorizeAccessCodeWithBasicAuthentication, authPopup} from "../../../../../src/core/plugins/auth/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("authorization data restoration", () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { fromJS } from "immutable"
|
||||
import { preauthorizeBasic, preauthorizeApiKey } from "corePlugins/auth"
|
||||
import { authorize } from "corePlugins/auth/actions"
|
||||
import { preauthorizeBasic, preauthorizeApiKey } from "core/plugins/auth"
|
||||
import { authorize } from "core/plugins/auth/actions"
|
||||
|
||||
const S2_SYSTEM = {
|
||||
authActions: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { fromJS } from "immutable"
|
||||
import { definitionsToAuthorize, definitionsForRequirements } from "corePlugins/auth/selectors"
|
||||
import { definitionsToAuthorize, definitionsForRequirements } from "core/plugins/auth/selectors"
|
||||
|
||||
describe("auth plugin - selectors", () => {
|
||||
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(){
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @prettier
|
||||
*/
|
||||
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", () => {
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { downloadConfig } from "corePlugins/configs/spec-actions"
|
||||
import { downloadConfig } from "core/plugins/configs/spec-actions"
|
||||
|
||||
describe("configs plugin - actions", () => {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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", () => {
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-useless-escape */
|
||||
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", () => {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Map } from "immutable"
|
||||
import opsFilter from "corePlugins/filter/opsFilter"
|
||||
import opsFilter from "core/plugins/filter/opsFilter"
|
||||
|
||||
describe("opsFilter", function() {
|
||||
const taggedOps = Map([["pet"], ["store"], ["user"]])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fromJS } from "immutable"
|
||||
import { isOAS30, isSwagger2 } from "corePlugins/oas3/helpers"
|
||||
import { isOAS30, isSwagger2 } from "core/plugins/oas3/helpers"
|
||||
|
||||
const isOAS3Shorthand = (version) => isOAS30(fromJS({
|
||||
openapi: version
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { fromJS } from "immutable"
|
||||
import reducer from "corePlugins/oas3/reducers"
|
||||
import reducer from "core/plugins/oas3/reducers"
|
||||
|
||||
describe("oas3 plugin - reducer", function () {
|
||||
describe("SET_REQUEST_BODY_VALIDATE_ERROR", () => {
|
||||
@@ -518,13 +518,13 @@ describe("oas3 plugin - reducer", function () {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const result = clearRequestBodyValue(state, {
|
||||
payload: {
|
||||
pathMethod: ["/pet", "post"],
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const expectedResult = {
|
||||
requestData: {
|
||||
"/pet": {
|
||||
@@ -535,7 +535,7 @@ describe("oas3 plugin - reducer", function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
expect(result.toJS()).toEqual(expectedResult)
|
||||
})
|
||||
})
|
||||
@@ -556,13 +556,13 @@ describe("oas3 plugin - reducer", function () {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const result = clearRequestBodyValue(state, {
|
||||
payload: {
|
||||
pathMethod: ["/pet", "post"],
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const expectedResult = {
|
||||
requestData: {
|
||||
"/pet": {
|
||||
@@ -573,7 +573,7 @@ describe("oas3 plugin - reducer", function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
expect(result.toJS()).toEqual(expectedResult)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@ import { mount } from "enzyme"
|
||||
import { fromJS } from "immutable"
|
||||
import ServersContainer from "core/plugins/oas3/components/servers-container"
|
||||
import Servers from "core/plugins/oas3/components/servers"
|
||||
import { Col } from "components/layout-utils"
|
||||
import { Col } from "core/components/layout-utils"
|
||||
|
||||
describe("<ServersContainer/>", function(){
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ import {
|
||||
serverVariableValue,
|
||||
serverVariables,
|
||||
serverEffectiveValue
|
||||
} from "corePlugins/oas3/selectors"
|
||||
} from "core/plugins/oas3/selectors"
|
||||
|
||||
import reducers from "corePlugins/oas3/reducers"
|
||||
import reducers from "core/plugins/oas3/reducers"
|
||||
|
||||
import {
|
||||
setSelectedServer,
|
||||
setServerVariableValue,
|
||||
} from "corePlugins/oas3/actions"
|
||||
} from "core/plugins/oas3/actions"
|
||||
|
||||
describe("OAS3 plugin - state", function() {
|
||||
describe("action + reducer + selector integration", function() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { fromJS, Map } from "immutable"
|
||||
import {
|
||||
definitionsToAuthorize
|
||||
} from "corePlugins/oas3/auth-extensions/wrap-selectors"
|
||||
} from "core/plugins/oas3/auth-extensions/wrap-selectors"
|
||||
|
||||
describe("oas3 plugin - auth extensions - wrapSelectors", function(){
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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(){
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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", () => {
|
||||
it("handles Immutable.js objects for nested schemas", function () {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
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(){
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { fromJS } from "immutable"
|
||||
import reducer from "corePlugins/spec/reducers"
|
||||
import reducer from "core/plugins/spec/reducers"
|
||||
|
||||
describe("spec plugin - reducer", function(){
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
consumesOptionsFor,
|
||||
taggedOperations,
|
||||
isMediaTypeSchemaPropertiesEqual
|
||||
} from "corePlugins/spec/selectors"
|
||||
} from "core/plugins/spec/selectors"
|
||||
|
||||
import Petstore from "./assets/petstore.json"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { loaded } from "corePlugins/swagger-js/configs-wrap-actions"
|
||||
import { loaded } from "core/plugins/swagger-client/configs-wrap-actions"
|
||||
|
||||
describe("swagger-js plugin - withCredentials", () => {
|
||||
describe("swagger-client plugin - withCredentials", () => {
|
||||
it("should have no effect by default", () => {
|
||||
const system = {
|
||||
fn: {
|
||||
@@ -34,7 +34,7 @@ describe("swagger-js plugin - withCredentials", () => {
|
||||
expect(oriExecute.mock.calls.length).toBe(1)
|
||||
expect(system.fn.fetch.withCredentials).toBe(true)
|
||||
})
|
||||
|
||||
|
||||
it("should allow setting flag to false via config", () => {
|
||||
const system = {
|
||||
fn: {
|
||||
@@ -52,7 +52,7 @@ describe("swagger-js plugin - withCredentials", () => {
|
||||
expect(oriExecute.mock.calls.length).toBe(1)
|
||||
expect(system.fn.fetch.withCredentials).toBe(false)
|
||||
})
|
||||
|
||||
|
||||
it("should allow setting flag to true via config as string", () => {
|
||||
// for query string config
|
||||
const system = {
|
||||
@@ -71,7 +71,7 @@ describe("swagger-js plugin - withCredentials", () => {
|
||||
expect(oriExecute.mock.calls.length).toBe(1)
|
||||
expect(system.fn.fetch.withCredentials).toBe(true)
|
||||
})
|
||||
|
||||
|
||||
it("should allow setting flag to false via config as string", () => {
|
||||
// for query string config
|
||||
const system = {
|
||||
|
||||
Reference in New Issue
Block a user